UNPKG

@scalar/api-client

Version:

the open source API testing client

39 lines 1.7 kB
import type { WorkspaceStore } from '@scalar/workspace-store/client'; import { type RoutePayload } from '../../../../v2/features/modal/helpers/resolve-route-parameters.js'; import type { ClientPlugin } from '../../../../v2/helpers/plugins.js'; export type CreateApiClientModalOptions = { /** Element to mount the client modal to. */ el: HTMLElement | null; /** * Will attempt to mount the references immediately. * For SSR this may need to be disabled and handled manually on the client side. */ mountOnInitialize?: boolean; /** The workspace store must be initialized and passed in. */ workspaceStore: WorkspaceStore; /** Api client plugins to include in the modal */ plugins?: ClientPlugin[]; }; /** * Creates the API Client Modal. * * The modal does not require a router. Instead, navigation is handled by setting * active entities directly through the returned `route` function. */ export declare const createApiClientModal: ({ el, workspaceStore, mountOnInitialize, plugins, }: CreateApiClientModalOptions) => { /** The Vue app instance for the modal. Use with caution. */ app: import("vue").App<Element>; /** Open the modal and optionally navigate to a specific route. */ open: (payload?: RoutePayload) => void; /** Mount the modal to a given element. */ mount: (mountingEl?: HTMLElement | null) => void; /** Navigate to the specified path, method, and example. */ route: (payload: RoutePayload) => void; /** Controls the visibility of the modal. */ modalState: { open: boolean; show: () => void; hide: () => void; }; }; //# sourceMappingURL=create-api-client-modal.d.ts.map