typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

external and internal Args type #593

Closed patricklx closed 1 year ago

patricklx commented 1 year ago

Is it somehow possible to have external & internal args type definitions?

I have a component where some properties are mutable exclusive and have a type def for it like:

type Only<T, U> = {
  [P in keyof T]: T[P];
} & {
  [P in keyof U]?: never;
};

type Either<T, U> = Only<T, U> | Only<U, T>

then Args look like this: type Args = Either<A,B>. which works fine when component is invoked, but in the components own template it fails to resolve the args, or rather it resolves all to never