declare const propertyText: "text"; declare const propertyBoolean: "boolean"; declare const propertyNumber: "number"; type PropertyType = typeof propertyText | typeof propertyBoolean | typeof propertyNumber; interface PropertyTypeToRealTypeMape { [propertyText]: string; [propertyBoolean]: boolean; [propertyNumber]: number; } interface Prop { type?: PropertyType; description?: string; defaultValue?: unknown; } interface Functions { description?: string; } interface Event { description?: string; } type PropertiesConfig = Record; type EventsConfig = Record; type FunctionsConfig = Record; type ExtractWidgetProps = { -readonly [Property in keyof Q]: Q[Property]['type'] extends PropertyType ? PropertyTypeToRealTypeMape[Q[Property]['type']] : Q[Property]['defaultValue']; }; type ExtractWidgetFunctions = { [Property in keyof T]: (...params: any[]) => any; }; type ExtractWidgetEvents = { [Property in keyof T as `on${Capitalize}`]: (cb: (...args: any[]) => void) => void; }; type DefineAPIFn = (config: { props?: T; functions?: Q; events?: E; }) => { _types: { flat: ExtractWidgetProps & ExtractWidgetFunctions & ExtractWidgetEvents & Record; props: ExtractWidgetProps; events: { [Property in keyof E]: any; }; functions: ExtractWidgetFunctions; }; properties: any[]; events: any[]; functions: any[]; }; export declare const WidgetPropertyType: { STRING: "text"; BOOLEAN: "boolean"; NUMBER: "number"; }; export declare const defineAPI: DefineAPIFn; export {}; //# sourceMappingURL=api.d.ts.map