UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

343 lines 13 kB
import type { XScalarSelectedSecurity } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-selected-security'; import { type SecuritySchemes } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; /** * Provides an interface to store and retrieve the selected client value * in local storage. */ export declare const clientStorage: () => { /** * Gets the stored selected client from local storage. */ get: () => string | null; /** * Stores the selected client value in local storage. * @param value The value to store */ set: (value: string) => void; }; /** * Provides an interface to store and retrieve authentication scheme * information in local storage, including both the available schemes and * the user's selected schemes. */ export declare const authStorage: () => { /** * Retrieves and coerces the authentication schemes stored in local storage. */ getSchemas: (slug: string) => { [x: string]: ({ description?: string | undefined; } & { 'x-scalar-secret-token': string; } & { type: "apiKey"; name: string; in: "header" | "query" | "cookie"; }) | ({ description?: string | undefined; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-secret-username': string; 'x-scalar-secret-password': string; } & { bearerFormat?: string | undefined; type: "http"; scheme: "basic" | "bearer"; }) | ({ description?: string | undefined; } & { type: "oauth2"; flows: { password?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { tokenUrl: string; } & { 'x-scalar-secret-username': string; 'x-scalar-secret-password': string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; implicit?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { authorizationUrl: string; } & { 'x-scalar-secret-redirect-uri': string; }) | undefined; clientCredentials?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { tokenUrl: string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; authorizationCode?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { authorizationUrl: string; tokenUrl: string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-secret-redirect-uri': string; } & { 'x-usePkce': "SHA-256" | "plain" | "no"; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; }; } & { 'x-default-scopes'?: string[] | undefined; }) | ({ description?: string | undefined; } & { type: "openIdConnect"; openIdConnectUrl: string; }) | ({ summary?: string | undefined; description?: string | undefined; $ref: string; } & { $status?: "loading" | "error" | undefined; $global?: boolean | undefined; } & { '$ref-value': ({ description?: string | undefined; } & { 'x-scalar-secret-token': string; } & { type: "apiKey"; name: string; in: "header" | "query" | "cookie"; }) | ({ description?: string | undefined; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-secret-username': string; 'x-scalar-secret-password': string; } & { bearerFormat?: string | undefined; type: "http"; scheme: "basic" | "bearer"; }) | ({ description?: string | undefined; } & { type: "oauth2"; flows: { password?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { tokenUrl: string; } & { 'x-scalar-secret-username': string; 'x-scalar-secret-password': string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; implicit?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { authorizationUrl: string; } & { 'x-scalar-secret-redirect-uri': string; }) | undefined; clientCredentials?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { tokenUrl: string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; authorizationCode?: ({ refreshUrl: string; scopes: { [x: string]: string; }; } & { 'x-scalar-secret-client-id': string; } & { 'x-scalar-secret-token': string; } & { 'x-scalar-security-query'?: { [x: string]: string; } | undefined; } & { 'x-scalar-security-body'?: { [x: string]: string; } | undefined; } & { 'x-tokenName'?: string | undefined; } & { authorizationUrl: string; tokenUrl: string; } & { 'x-scalar-secret-client-secret': string; } & { 'x-scalar-secret-redirect-uri': string; } & { 'x-usePkce': "SHA-256" | "plain" | "no"; } & { 'x-scalar-credentials-location'?: "body" | "header" | undefined; }) | undefined; }; } & { 'x-default-scopes'?: string[] | undefined; }) | ({ description?: string | undefined; } & { type: "openIdConnect"; openIdConnectUrl: string; }); }); }; /** * Stores the authentication schemes in local storage. * @param value The SecuritySchemes object to stringify and store. */ setSchemas: (slug: string, value: SecuritySchemes) => void; /** * Retrieves and coerces the selected authentication schemes stored in local storage. */ getSelectedSchemes: (slug: string) => { 'x-scalar-selected-security'?: { selectedIndex: number; selectedSchemes: {}[]; } | undefined; }; /** * Stores the user's selected authentication schemes in local storage. * @param value The XScalarSelectedSecurity object to stringify and store. */ setSelectedSchemes: (slug: string, value: XScalarSelectedSecurity) => void; }; //# sourceMappingURL=storage.d.ts.map