UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

20 lines 1.07 kB
import type { ClientPlugin } from '@scalar/api-client/v2/helpers'; import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'; import { type ComputedRef } from 'vue'; /** * Maps API reference configuration callbacks to client plugins. * * This function transforms the legacy onBeforeRequest and onRequestSent callbacks * into the new plugin hook system. The mapping is reactive, so changes to the * configuration will automatically update the plugin hooks. * * Note: onRequestSent is mapped to responseReceived hook. This is not a perfect * one-to-one mapping, but it maintains backward compatibility with the old API. * The old callback receives only the URL string, while the new hook receives * the full response object. * * @param config - Reactive configuration object containing optional hook callbacks * @returns Array containing a single plugin with the mapped hooks */ export declare const mapConfigPlugins: (config: ComputedRef<ApiReferenceConfigurationRaw>) => ClientPlugin[]; //# sourceMappingURL=map-config-plugins.d.ts.map