/** * @description * @author 阿怪 * @date 2022/12/12 14:52 * @version v1.0.0 * * 江湖的业务千篇一律,复杂的代码好几百行。 */ import { RenderFunction, SetupContext } from 'vue'; import { MCOPO } from './props'; type WithArray = T | T[]; // todo fix this export type HTMLElementEvent = Event & { target: T; }; type MVNodeRenderParams = { if?: boolean, show?: boolean, }; interface ElementEventListener { (event: HTMLElementEvent): void; } export type MNodeProps = Record | ElementEventListener | Record>; export declare type MNodeSlot = MVNodeRenderParams & { props?: MNodeProps, }; export declare type MNodeTemplate = { type: string, props?: MNodeProps, children?: Record, slots?: Map, innerText?: string[], initProps?: (templateProps: MCOPO, props: MNodeProps, filter?: string[]) => void, } & MVNodeRenderParams; export declare type MVNode = { name: string, template?: MNodeTemplate, dom?: HTMLElement, props?: MNodeTemplate['props'], children?: Record, slots?: MNodeTemplate['slots'] }; export declare type CustomElementParams = { name: string, style?: string, template?: MNodeTemplate, props?: MCOPO }; export declare type WCSetup = (slot?: HTMLSlotElement) => (props: Readonly, ctx: SetupContext) => RenderFunction;