@scalar/api-client
Version:
the open source API testing client
30 lines • 1.21 kB
TypeScript
import type { ApiClientPlugin, HooksSchema } from '@scalar/types/api-client';
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"]>) => {
title?: string | undefined;
component?: unknown;
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<(void | undefined)[]>;
};
export type PluginManager = ReturnType<typeof createPluginManager>;
export declare const PLUGIN_MANAGER_SYMBOL: InjectionKey<PluginManager>;
//# sourceMappingURL=plugin-manager.d.ts.map