From 0ef4e74b3166b327079916e464072f292c3dd712 Mon Sep 17 00:00:00 2001 From: enzoaicardi Date: Tue, 11 Jun 2024 19:25:03 +0200 Subject: [PATCH] [ts] types update --- dist/index.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 6dc6446..cb89613 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -26,18 +26,24 @@ declare module "vifjs" { useEffect(callback: Function): void; } + interface VifRenderFunctionProps { + [key: string]: any; + } + + interface VifRenderFunctionProperties { + props: VifRenderFunctionProps; + html: (string: TemplateStringsArray | string) => string; + css: (string: TemplateStringsArray | string) => string; + } + /** * Function used to hydrate datas and create component template & schema * @see {@link https://github.com/vifjs/vif/tree/main/wiki/methods/define.md} */ type VifRenderFunction = ( this: VifElement, - args: { - props: Object; - html: (string: string) => string; - css: (string: string) => string; - } - ) => VifElement | NodeList | void; + args: VifRenderFunctionProperties + ) => VifElement | NodeList | TemplateStringsArray | string | void; interface VifSignal { (updatedValue?: any): [updatedValue: any];