import { FastifyBaseLogger } from 'fastify'; import { FastifyPluginCallback } from 'fastify'; import { FastifyTypeProviderDefault } from 'fastify'; import { HtmlRenderingConfiguration } from '@scalar/client-side-rendering'; import { onRequestHookHandler } from 'fastify'; import { preHandlerHookHandler } from 'fastify'; import { RawServerDefault } from 'fastify'; /** * The configuration for the Scalar API Reference for Fastify */ export declare type ApiReferenceConfiguration = HtmlRenderingConfiguration; declare const fastifyApiReference: FastifyPluginCallback; export default fastifyApiReference; export declare type FastifyApiReferenceHooksOptions = Partial<{ onRequest?: onRequestHookHandler; preHandler?: preHandlerHookHandler; }>; export declare type FastifyApiReferenceOptions = { /** * If you're prefixing Fastify with a path, you can set it here. * It'll be added to the JavaScript URL and the route. * * Example: `${publicPath}${routePrefix}/js/scalar.js` * @deprecated We don't use this anymore. */ publicPath?: string; /** * Prefix the route with a path. This is where the API Reference will be available. * * @default '/reference' */ routePrefix?: `/${string}`; /** * Set where the OpenAPI specification is exposed under `${routePrefix}`. * * The specification is available on these endpoints (parsed by `@scalar/openapi-parser`) * when it is provided via `configuration.content` or `@fastify/swagger`. * * A `configuration.url` source is loaded directly by the reference in the browser, so it * is not re-exposed on these endpoints. * * These endpoints can be used to fetch the OpenAPI specification for your own programmatic use. * * @default{ json: '/openapi.json', yaml: '/openapi.yaml' } */ openApiDocumentEndpoints?: { /** * Set where the OpenAPI specification is exposed under `${routePrefix}`, in JSON format. * * With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.json` * * @default '/openapi.json' */ json?: `/${string}`; /** * Set where the OpenAPI specification is exposed under `${routePrefix}`, in YAML format. * * With the default value, the endpoint is: `${publicPath}${routePrefix}/openapi.yaml` * * @default '/openapi.yaml' */ yaml?: `/${string}`; }; /** * The universal configuration object for @scalar/api-reference. * * Read more: https://github.com/scalar/scalar */ configuration?: Partial; /** * The hooks for the API Reference. */ hooks?: FastifyApiReferenceHooksOptions; /** * The log level for all routes registered by this plugin. * Set to 'silent' to disable logging for these routes. */ logLevel?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'; }; export { }