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 49b0360
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/util/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { ComponentLike } from '@glint/template';
import { ComponentLike, HelperLike } from '@glint/template';

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

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

0 comments on commit 49b0360

Please sign in to comment.