Skip to content

Commit

Permalink
Export EnsureSafeComponentHelper type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskrycho committed Dec 2, 2022
1 parent fe199e2 commit bafee9c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/util/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import { ComponentLike } from '@glint/template';
import Helper from '@ember/component/helper';

export function ensureSafeComponent<C extends string | ComponentLike<S>, S>(
component: C,
thingWithOwner: unknown
): C extends string ? ComponentLike<unknown> : C;

export class EnsureSafeComponentHelper<
C extends string | ComponentLike<S>,
S
> extends Helper<{
Args: {
Positional: [component: C];
};
Return: C extends string ? ComponentLike<unknown> : C;
}> {}

0 comments on commit bafee9c

Please sign in to comment.