import type { ApiClientTranslations } from '@scalar/types/api-reference'; import type { MergedSecuritySchemes, OAuthFlowsObjectSecret } from '@scalar/workspace-store/request-example'; import type { ComponentsObject, OpenApiDocument, SecurityRequirementObject, SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'; /** A single security scheme option used in the auth dropdown */ export type SecuritySchemeOption = { id: string; label: string; value: SecurityRequirementObject; isDeletable?: boolean; payload?: SecuritySchemeObject; }; /** A group of security scheme options used in the auth dropdown */ export type SecuritySchemeGroup = { label: string; options: SecuritySchemeOption[]; }; /** * Format a scheme object into a display object * * We also add a hash to the id to ensure it is unique across * multiple requirements of the same scheme with different scopes */ export declare const formatScheme: ({ name, value }: { name: string; value: SecurityRequirementObject; }) => { id: string; label: string; value: Partial>; isDeletable: boolean; }; /** Formats complex security schemes */ export declare const formatComplexScheme: (scheme: NonNullable[number]) => { id: string; label: string; value: Partial>; isDeletable: boolean; }; /** * Finds the oauth2 scheme best suited to power a bearer scheme's "Authorize via OAuth2" shortcut: * the first scheme with an interactive grant (authorization code / implicit), the kind that sends * a user to an IdP login. Prefers the authorization-code grant (which can refresh) over one * offering only implicit, so the more capable flow wins even when it is declared later. * * This only surfaces a convenience shortcut on the bearer form — it never hides the oauth2 scheme, * which stays independently selectable in the auth dropdown. */ export declare const getOauth2AcquisitionTarget: (securitySchemes: NonNullable | MergedSecuritySchemes) => { name: string; flows: OAuthFlowsObjectSecret; flowType: "authorizationCode" | "implicit"; scopes: string[]; } | null; /** * Generates the options for the security scheme combobox * * Contains either a flat list, or different groups of required, available, and add new */ export declare const getSecuritySchemeOptions: (security: NonNullable, securitySchemes: NonNullable | MergedSecuritySchemes, /** We need to add the selected schemes if they do not already exist in the calculated options */ selectedSchemes: SecurityRequirementObject[], /** Allows adding authentication which is not in the document */ canAddNewAuth?: boolean, labels?: Pick) => SecuritySchemeOption[] | SecuritySchemeGroup[]; //# sourceMappingURL=security-scheme.d.ts.map