UNPKG

@muban/muban

Version:

Writing components for server-rendered HTML

16 lines (15 loc) 1.23 kB
import type { ComponentCreateOptions, ComponentFactory, DefineComponentOptions, InternalComponentInstance } from './Component.types'; import type { PropTypeDefinition } from './props/propDefinitions.types'; import type { ComponentRefItem } from './refs/refDefinitions.types'; export declare function getCurrentComponentInstance(): InternalComponentInstance | null; export declare function setCurrentComponentInstance(instance: InternalComponentInstance | null): void; export declare function createComponentInstance(createOptions: ComponentCreateOptions, element: HTMLElement, options: DefineComponentOptions<any, any, string>): InternalComponentInstance; export declare const defineComponent: <R extends Record<string, ComponentRefItem>, N extends string, P extends Record<string, PropTypeDefinition<any>> = {}>(options: DefineComponentOptions<P, R, N>) => ComponentFactory<P, N>; /** * Instantiate a child component if a list of conditions are met: * - it doesn't already have an instance on that element * - it isn't already created as part of a explicit refComponent * @param instance * @param element */ export declare function instantiateChildComponent(instance: InternalComponentInstance, element: HTMLElement): void;