import { ConfigPointer } from '../config'; import { PluginArchiveDB } from '@delta-comic/db'; import type * as Share from './share'; export type * as Share from './share'; import type * as Content from './content'; export type * as Content from './content'; import type * as Subscribe from './subscribe'; export type * as Subscribe from './subscribe'; import type * as User from './user'; export type * as User from './user'; import type * as Api from './api'; export type * as Api from './api'; import type * as OtherProgress from './otherProgress'; export type * as OtherProgress from './otherProgress'; import type * as Search from './search'; export type * as Search from './search'; import type * as Auth from './auth'; export type * as Auth from './auth'; import type * as Resource from './resource'; export type * as Resource from './resource'; export declare const pluginEmitter: import('mitt').Emitter<{ definedPlugin: PluginConfig; }>; export interface PluginConfig { name: string; content?: Content.Config; resource?: Resource.Content; api?: Record; user?: User.Config; auth?: Auth.Config; otherProgress?: OtherProgress.Config[]; /** * 返回值如果不为空,则会await后作为expose暴露 */ onBooted?(ins: DefineResult): (PromiseLike | object) | void; search?: Search.Config; /** * 插件的配置项需在此处注册 * 传入`Store.ConfigPointer` */ config?: ConfigPointer[]; subscribe?: Record; share?: Share.Config; } export type DefineResult = { api?: Record; }; export declare const definePlugin: (config: T | ((safe: boolean) => T)) => Promise; export type PluginExpose Promise> = Awaited>['onBooted']>>>; export interface RawPluginMeta { 'name:display': string; 'name:id': string; 'version': string; 'author': string | undefined; 'description': string; 'require'?: string[] | string; } export declare const decodePluginMeta: (v: RawPluginMeta) => PluginArchiveDB.Meta;