think I've found a reasonable way of collecting type declarations