UNPKG

@scalar/api-client

Version:

the open source API testing client

30 lines 1.2 kB
import type { ApiClientPlugin, hooksSchema } from '@scalar/types/api-reference'; import type { InjectionKey } from 'vue'; import type { z } from 'zod'; export type { ApiClientPlugin }; type HookFunctions = z.infer<typeof hooksSchema>; type CreatePluginManagerParams = { plugins?: ApiClientPlugin[]; }; /** * Create the plugin manager store * * This store manages all plugins registered with the API client */ export declare const createPluginManager: ({ plugins }: CreatePluginManagerParams) => { /** * Get all components for a specific view */ getViewComponents: (view: keyof NonNullable<ReturnType<ApiClientPlugin>["views"]>) => { component: unknown; title?: string | undefined; props?: Record<string, any> | undefined; }[]; /** * Execute a hook for a specific event */ executeHook: <E extends keyof HookFunctions>(event: E, ...args: HookFunctions[E] extends z.ZodFunction<infer Args, any> ? z.infer<Args> : any) => Promise<unknown[]>; }; export type PluginManager = ReturnType<typeof createPluginManager>; export declare const PLUGIN_MANAGER_SYMBOL: InjectionKey<PluginManager>; //# sourceMappingURL=plugin-manager.d.ts.map