UNPKG

@muban/template

Version:

Writing templates for Muban components during development

24 lines (23 loc) 929 B
import type { ComponentTemplate } from '../mtl.types'; declare type TemplateComponentFactoryOptions<P extends Record<string, unknown>> = { tag?: string; component?: string | { displayName: string; }; tagAttributes?: Record<string, unknown>; children: (props: P) => string; jsonProps?: (props: P) => Record<string, any>; }; export declare function templateComponentFactory({ tag, component, tagAttributes, children, jsonProps, }: TemplateComponentFactoryOptions<any>): ComponentTemplate; declare type RenderComponentWrapperOptions = { tag?: string; ref?: string; component?: string | { displayName: string; }; tagAttributes?: Record<string, unknown>; children: string; jsonProps?: Record<string, any>; }; export declare function renderComponentWrapper({ tag, component, ref, children, tagAttributes, jsonProps, }: RenderComponentWrapperOptions): any; export {};