Skip to content

Commit

Permalink
fix: allow in template input types
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed May 9, 2023
1 parent 55a5658 commit 058b839
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type RenderResult = AsyncReturnValue<typeof render>;

export async function render<T extends Marko.Template>(
template: T | { default: T },
input: Marko.Input<T> = {} as any,
input: Marko.TemplateInput<Marko.Input<T>> = {} as any,
options: RenderOptions = {}
) {
if (template && "default" in template) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let activeContainer: DocumentFragment | undefined;

export async function render<T extends Marko.Template>(
template: T | { default: T },
input: Marko.Input<T> = {} as any,
input: Marko.TemplateInput<Marko.Input<T>> = {} as any,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
options?: RenderOptions
): Promise<
Expand Down
2 changes: 2 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ declare namespace Marko {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Template {}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type TemplateInput<T> = any;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type Input<T> = any;
}

0 comments on commit 058b839

Please sign in to comment.