import { Component } from "../component"; import { ContextMemberFactory } from "../context"; import "../prelude"; import { App } from "./app"; import { AppHookMap } from "./hooks"; export interface Plugin extends Partial { name?: string; components?: Record Component>; contextFuncs?: Record; htmlElementAlias?: Record; onInstall?(app: App): void; } type PluginItem = Plugin | false | null | undefined | readonly PluginItem[] | Promise; export type PluginOption = PluginItem[]; export declare function installPlugins(app: App, plugins: PluginOption): Promise; export interface Plugins { } type ExtractFuncName = N extends string ? N extends `$${string}` ? never : N : never; type GetContextFuncs = T extends any ? { [K in ExtractFuncName]: T["components"][K] extends new () => { $main: infer F; } ? F : never; } & { [K in ExtractFuncName]: T["contextFuncs"][K] extends ContextMemberFactory ? F : never; } : never; type GetComponents = T extends any ? { [K in ExtractFuncName]: T["components"][K] extends new () => infer C ? C : never; } : never; type UnionToIntersection = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never; type NormalizePlugins = T extends (...args: any[]) => infer R ? NormalizePlugins : T extends readonly any[] ? T[number] extends infer R ? NormalizePlugins : never : T extends Promise ? NormalizePlugins : T extends Plugin ? T : never; type PluginContextFuncs = UnionToIntersection>>; type PluginComponents = UnionToIntersection>>; declare module ".." { interface ContextFuncs extends PluginContextFuncs { } interface Components extends PluginComponents { } } export {}; //# sourceMappingURL=plugin.d.ts.map