@muban/template
Version:
Writing templates for Muban components during development
11 lines (10 loc) • 431 B
TypeScript
declare type ValueOf<T> = T[keyof T];
export declare type TemplateMap<T> = ValueOf<{
[P in keyof T]: {
name: P;
props: T[P] extends (...args: any) => any ? Parameters<T[P]>[0] : never;
};
}>;
export declare type ComponentTemplateResult = string | Array<string>;
export declare type ComponentTemplate<P extends Record<string, unknown> = any> = (props: P, ref?: string) => ComponentTemplateResult;
export {};