@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
953 lines (952 loc) • 533 kB
TypeScript
import type { ApiClient, CreateApiClientParams } from '@scalar/api-client/libs';
type Props = Pick<CreateApiClientParams, 'el' | 'configuration' | 'store'>;
/** API Client instance */
declare const client: import("vue").Ref<{
open: (payload?: import("@scalar/api-client/libs").OpenClientPayload) => void;
resetStore: () => void;
updateConfig: (_newConfig: Partial<import("@scalar/types").ApiClientConfiguration>) => Promise<void>;
updateServer: (serverUrl: string) => void;
onUpdateServer: (callback: (url: string) => void) => void;
updateAuth: <P extends import("@scalar/object-utils/nested").Path<import("@scalar/types/entities").SecurityScheme>>({ nameKey, propertyKey, value, }: {
nameKey: string;
propertyKey: P;
value: NonNullable<import("@scalar/object-utils/nested").PathValue<import("@scalar/types/entities").SecurityScheme, P>>;
}) => void;
route: (payload?: import("@scalar/api-client/libs").OpenClientPayload) => void;
mount: (mountingEl?: HTMLElement | null) => void;
modalState: {
open: boolean;
show: () => void;
hide: () => void;
};
updateExample: (exampleKey: string, operationId: string) => void;
app: {
unmount: () => void;
};
store: {
hideClientButton: boolean;
servers: Record<string, {
url: string;
uid: string & import("zod").$brand<"server">;
description?: string | undefined;
variables?: Record<string, {
enum?: string[] | undefined;
default?: string | undefined;
description?: string | undefined;
value?: string | undefined;
}> | undefined;
}>;
showSidebar: boolean;
cookies: Record<string, {
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}>;
tags: Record<string, {
type: "tag";
name: string;
uid: string & import("zod").$brand<"tag">;
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
description?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
"x-scalar-children"?: {
tagName: string;
}[] | undefined;
"x-internal"?: boolean | undefined;
"x-scalar-ignore"?: boolean | undefined;
}>;
modalState: {
open: boolean;
show: () => void;
hide: () => void;
};
workspaces: Record<string, {
uid: string & import("zod").$brand<"workspace">;
name: string;
description: string;
collections: (string & import("zod").$brand<"collection">)[];
environments: Record<string, string>;
activeEnvironmentId: string;
cookies: (string & import("zod").$brand<"cookie">)[];
themeId: "default" | "alternate" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "laserwave" | "none";
selectedHttpClient: {
targetKey: string;
clientKey: string;
};
hotKeyConfig?: {
modifiers: ("default" | "Meta" | "Control" | "Shift" | "Alt")[];
hotKeys?: Partial<Record<"" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "Space" | "Backspace" | "Tab" | "Enter" | "Escape" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home" | "PageDown" | "PageUp" | "Delete" | "*" | "+" | "-" | "." | "/" | "F1" | "F2" | "F3" | "F4" | "F5" | "F6" | "F7" | "F8" | "F9" | "F10" | "F11" | "F12" | ";" | "=" | "," | "`" | "[" | "\\" | "]" | "4" | "1" | "2" | "3" | "5" | "6" | "7" | "8" | "9", {
event: "addTopNav" | "closeModal" | "closeTopNav" | "createNew" | "executeRequest" | "focusAddressBar" | "focusRequestSearch" | "jumpToLastTab" | "jumpToTab" | "navigateSearchResultsDown" | "navigateSearchResultsUp" | "navigateTopNavLeft" | "navigateTopNavRight" | "openCommandPalette" | "selectSearchResult" | "toggleSidebar";
modifiers?: ("default" | "Meta" | "Control" | "Shift" | "Alt")[] | undefined;
}>> | undefined;
} | undefined;
proxyUrl?: string | undefined;
}>;
collections: Record<string, {
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
security: Record<string, string[]>[];
"x-scalar-icon": string;
uid: string & import("zod").$brand<"collection">;
securitySchemes: string[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
servers: (string & import("zod").$brand<"server">)[];
requests: (string & import("zod").$brand<"operation">)[];
tags: (string & import("zod").$brand<"tag">)[];
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
watchMode: boolean;
useCollectionSecurity: boolean;
watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
jsonSchemaDialect?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
default: string;
description?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
selectedServerUid?: (string & import("zod").$brand<"server">) | undefined;
documentUrl?: string | undefined;
integration?: string | null | undefined;
}>;
environments: Record<string, {
uid: string & import("zod").$brand<"environment">;
name: string;
color: string;
value: string;
isDefault?: boolean | undefined;
}>;
requestExamples: Record<string, {
uid: string & import("zod").$brand<"example">;
type: "requestExample";
name: string;
body: {
activeBody: "raw" | "formData" | "binary";
raw?: {
encoding: "html" | "xml" | "json" | "text" | "javascript" | "yaml" | "edn";
value: string;
mimeType?: string | undefined;
} | undefined;
formData?: {
encoding: "form-data" | "urlencoded";
value: {
key: string;
value: string;
enabled: boolean;
file?: any;
description?: string | undefined;
required?: boolean | undefined;
enum?: string[] | undefined;
examples?: any[] | undefined;
type?: string | string[] | undefined;
format?: string | undefined;
minimum?: number | undefined;
maximum?: number | undefined;
default?: any;
nullable?: boolean | undefined;
}[];
} | undefined;
binary?: Blob | undefined;
};
parameters: {
path: {
key: string;
value: string;
enabled: boolean;
file?: any;
description?: string | undefined;
required?: boolean | undefined;
enum?: string[] | undefined;
examples?: any[] | undefined;
type?: string | string[] | undefined;
format?: string | undefined;
minimum?: number | undefined;
maximum?: number | undefined;
default?: any;
nullable?: boolean | undefined;
}[];
query: {
key: string;
value: string;
enabled: boolean;
file?: any;
description?: string | undefined;
required?: boolean | undefined;
enum?: string[] | undefined;
examples?: any[] | undefined;
type?: string | string[] | undefined;
format?: string | undefined;
minimum?: number | undefined;
maximum?: number | undefined;
default?: any;
nullable?: boolean | undefined;
}[];
headers: {
key: string;
value: string;
enabled: boolean;
file?: any;
description?: string | undefined;
required?: boolean | undefined;
enum?: string[] | undefined;
examples?: any[] | undefined;
type?: string | string[] | undefined;
format?: string | undefined;
minimum?: number | undefined;
maximum?: number | undefined;
default?: any;
nullable?: boolean | undefined;
}[];
cookies: {
key: string;
value: string;
enabled: boolean;
file?: any;
description?: string | undefined;
required?: boolean | undefined;
enum?: string[] | undefined;
examples?: any[] | undefined;
type?: string | string[] | undefined;
format?: string | undefined;
minimum?: number | undefined;
maximum?: number | undefined;
default?: any;
nullable?: boolean | undefined;
}[];
};
requestUid?: (string & import("zod").$brand<"operation">) | undefined;
serverVariables?: Record<string, string[]> | undefined;
}>;
requests: Record<string, {
type: "request";
uid: string & import("zod").$brand<"operation">;
path: string;
method: "delete" | "get" | "connect" | "head" | "options" | "patch" | "post" | "put" | "trace";
servers: (string & import("zod").$brand<"server">)[];
selectedServerUid: (string & import("zod").$brand<"server">) | null;
examples: (string & import("zod").$brand<"example">)[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
description?: string | undefined;
summary?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
"x-internal"?: boolean | undefined;
"x-scalar-ignore"?: boolean | undefined;
security?: Record<string, string[]>[] | undefined;
tags?: string[] | undefined;
deprecated?: boolean | undefined;
operationId?: string | undefined;
requestBody?: any;
parameters?: {
in: "path" | "cookie" | "query" | "header";
name: string;
required: boolean;
deprecated: boolean;
description?: string | undefined;
schema?: unknown;
content?: unknown;
style?: "matrix" | "simple" | "form" | "label" | "spaceDelimited" | "pipeDelimited" | "deepObject" | undefined;
explode?: boolean | undefined;
example?: unknown;
examples?: Record<string, {
value?: unknown;
summary?: string | undefined;
externalValue?: string | undefined;
}> | unknown[] | undefined;
}[] | undefined;
responses?: Record<string, any> | undefined;
callbacks?: Record<string, Record<string, Record<string, any>>> | undefined;
"x-codeSamples"?: {
source: string;
lang?: string | undefined;
label?: string | undefined;
}[] | undefined;
"x-code-samples"?: {
source: string;
lang?: string | undefined;
label?: string | undefined;
}[] | undefined;
"x-custom-examples"?: {
source: string;
lang?: string | undefined;
label?: string | undefined;
}[] | undefined;
"x-scalar-stability"?: import("@scalar/types").XScalarStability | undefined;
"x-post-response"?: string | undefined;
}>;
securitySchemes: Record<string, {
type: "apiKey";
name: string;
in: "cookie" | "query" | "header";
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
value: string;
description?: string | undefined;
} | {
type: "http";
scheme: "basic" | "bearer";
bearerFormat: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
username: string;
password: string;
token: string;
description?: string | undefined;
} | {
type: "openIdConnect";
openIdConnectUrl: string;
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
} | {
type: "oauth2";
flows: {
implicit?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "implicit";
authorizationUrl: string;
"x-scalar-redirect-uri": string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
} | undefined;
password?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "password";
tokenUrl: string;
clientSecret: string;
username: string;
password: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
clientCredentials?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "clientCredentials";
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
authorizationCode?: {
refreshUrl: string;
scopes: Record<string, string>;
selectedScopes: string[];
"x-scalar-client-id": string;
token: string;
type: "authorizationCode";
authorizationUrl: string;
"x-usePkce": "SHA-256" | "plain" | "no";
"x-scalar-redirect-uri": string;
tokenUrl: string;
clientSecret: string;
"x-scalar-security-query"?: Record<string, string> | undefined;
"x-scalar-security-body"?: Record<string, string> | undefined;
"x-tokenName"?: string | undefined;
"x-scalar-credentials-location"?: "header" | "body" | undefined;
} | undefined;
};
uid: string & import("zod").$brand<"securityScheme">;
nameKey: string;
description?: string | undefined;
"x-default-scopes"?: string[] | undefined;
}>;
setSidebarWidth: (width: string) => void;
integration: "elysiajs" | "fastify" | "go" | "rust" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "svelte" | "vue" | null | undefined;
importSpecFile: (_spec: string | Record<string, any> | undefined, workspaceUid: string, options?: Pick<{
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
type?: "collection" | undefined;
openapi?: string | undefined;
jsonSchemaDialect?: string | undefined;
security?: Record<string, string[] | undefined>[] | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-icon"?: string | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
description?: string | undefined;
default?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
uid?: string | undefined;
securitySchemes?: string[] | undefined;
selectedSecuritySchemeUids?: (string | string[])[] | undefined;
selectedServerUid?: string | undefined;
servers?: string[] | undefined;
requests?: string[] | undefined;
tags?: string[] | undefined;
children?: string[] | undefined;
documentUrl?: string | undefined;
watchMode?: boolean | undefined;
integration?: string | null | undefined;
useCollectionSecurity?: boolean | undefined;
watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
}, "documentUrl" | "watchMode"> & Pick<import("@scalar/types").ApiReferenceConfiguration, "slug" | "authentication" | "baseServerURL" | "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
useCollectionSecurity?: boolean;
shouldLoad?: boolean;
} & Pick<import("@scalar/types").ApiReferenceConfiguration, "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
}) => Promise<{
error: false;
collection: import("@scalar/oas-utils/entities/spec").Collection;
requests: import("@scalar/oas-utils/entities/spec").Request[];
schema: import("@scalar/openapi-types").OpenAPIV3_1.Document;
examples: import("@scalar/oas-utils/entities/spec").RequestExample[];
servers: import("@scalar/oas-utils/entities/spec").Server[];
tags: import("@scalar/oas-utils/entities/spec").Tag[];
securitySchemes: import("@scalar/types/entities").SecurityScheme[];
} | undefined>;
importSpecFromUrl: (url: string, workspaceUid: string, { proxyUrl, ...options }?: Omit<Pick<{
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
type?: "collection" | undefined;
openapi?: string | undefined;
jsonSchemaDialect?: string | undefined;
security?: Record<string, string[] | undefined>[] | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-icon"?: string | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
description?: string | undefined;
default?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
uid?: string | undefined;
securitySchemes?: string[] | undefined;
selectedSecuritySchemeUids?: (string | string[])[] | undefined;
selectedServerUid?: string | undefined;
servers?: string[] | undefined;
requests?: string[] | undefined;
tags?: string[] | undefined;
children?: string[] | undefined;
documentUrl?: string | undefined;
watchMode?: boolean | undefined;
integration?: string | null | undefined;
useCollectionSecurity?: boolean | undefined;
watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
}, "documentUrl" | "watchMode"> & Pick<import("@scalar/types").ApiReferenceConfiguration, "slug" | "authentication" | "baseServerURL" | "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
useCollectionSecurity?: boolean;
shouldLoad?: boolean;
} & Pick<import("@scalar/types").ApiReferenceConfiguration, "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
}, "documentUrl"> & Pick<import("@scalar/types").ApiReferenceConfiguration, "proxyUrl">) => Promise<import("@scalar/api-client/libs").ErrorResponse<Awaited<ReturnType<(_spec: string | Record<string, any> | undefined, workspaceUid: string, options?: Pick<{
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
type?: "collection" | undefined;
openapi?: string | undefined;
jsonSchemaDialect?: string | undefined;
security?: Record<string, string[] | undefined>[] | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-icon"?: string | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
description?: string | undefined;
default?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
uid?: string | undefined;
securitySchemes?: string[] | undefined;
selectedSecuritySchemeUids?: (string | string[])[] | undefined;
selectedServerUid?: string | undefined;
servers?: string[] | undefined;
requests?: string[] | undefined;
tags?: string[] | undefined;
children?: string[] | undefined;
documentUrl?: string | undefined;
watchMode?: boolean | undefined;
integration?: string | null | undefined;
useCollectionSecurity?: boolean | undefined;
watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
}, "documentUrl" | "watchMode"> & Pick<import("@scalar/types").ApiReferenceConfiguration, "slug" | "authentication" | "baseServerURL" | "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
useCollectionSecurity?: boolean;
shouldLoad?: boolean;
} & Pick<import("@scalar/types").ApiReferenceConfiguration, "servers"> & {
dereferencedDocument?: import("@scalar/openapi-types").OpenAPIV3_1.Document;
}) => Promise<{
error: false;
collection: import("@scalar/oas-utils/entities/spec").Collection;
requests: import("@scalar/oas-utils/entities/spec").Request[];
schema: import("@scalar/openapi-types").OpenAPIV3_1.Document;
examples: import("@scalar/oas-utils/entities/spec").RequestExample[];
servers: import("@scalar/oas-utils/entities/spec").Server[];
tags: import("@scalar/oas-utils/entities/spec").Tag[];
securitySchemes: import("@scalar/types/entities").SecurityScheme[];
} | undefined>>>>>;
cookieMutators: {
add: (item: {
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}) => void;
delete: (uid: (string & import("zod").$brand<"cookie">) | null | undefined) => void;
set: (item: {
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}) => void;
edit: <P extends "path" | "value" | "uid" | "name" | "domain">(uid: (string & import("zod").$brand<"cookie">) | null | undefined, path: P, value: P extends "path" | "value" | "uid" | "name" | "domain" ? {
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "uid" | "name" | "domain" ? R extends import("@scalar/object-utils/nested").Path<{
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
untrackedEdit: <P extends "path" | "value" | "uid" | "name" | "domain">(uid: string & import("zod").$brand<"cookie">, path: P, value: P extends "path" | "value" | "uid" | "name" | "domain" ? {
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "path" | "value" | "uid" | "name" | "domain" ? R extends import("@scalar/object-utils/nested").Path<{
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[K]> ? import("@scalar/object-utils/nested").PathValue<{
uid: string & import("zod").$brand<"cookie">;
name: string;
value: string;
domain?: string | undefined;
path?: string | undefined;
}[K], R> : never : K extends `${number}` ? never : never : P extends `${number}` ? never : never) => void;
undo: (uid: string & import("zod").$brand<"cookie">) => void;
redo: (uid: string & import("zod").$brand<"cookie">) => void;
reset: () => void;
};
collectionMutators: {
rawAdd: (item: {
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
security: Record<string, string[]>[];
"x-scalar-icon": string;
uid: string & import("zod").$brand<"collection">;
securitySchemes: string[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
servers: (string & import("zod").$brand<"server">)[];
requests: (string & import("zod").$brand<"operation">)[];
tags: (string & import("zod").$brand<"tag">)[];
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
watchMode: boolean;
useCollectionSecurity: boolean;
watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
jsonSchemaDialect?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
default: string;
description?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
selectedServerUid?: (string & import("zod").$brand<"server">) | undefined;
documentUrl?: string | undefined;
integration?: string | null | undefined;
}) => void;
add: (payload: import("@scalar/oas-utils/entities/spec").CollectionPayload, workspaceUid: import("@scalar/oas-utils/entities/workspace").Workspace["uid"]) => {
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
security: Record<string, string[]>[];
"x-scalar-icon": string;
uid: string & import("zod").$brand<"collection">;
securitySchemes: string[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
servers: (string & import("zod").$brand<"server">)[];
requests: (string & import("zod").$brand<"operation">)[];
tags: (string & import("zod").$brand<"tag">)[];
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
watchMode: boolean;
useCollectionSecurity: boolean;
watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
jsonSchemaDialect?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
default: string;
description?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
selectedServerUid?: (string & import("zod").$brand<"server">) | undefined;
documentUrl?: string | undefined;
integration?: string | null | undefined;
};
delete: (collection: import("@scalar/oas-utils/entities/spec").Collection, workspace: import("@scalar/oas-utils/entities/workspace").Workspace) => void;
addEnvironment: (environmentName: string, environment: import("@scalar/oas-utils/entities/spec").XScalarEnvironment, collectionUid: import("@scalar/oas-utils/entities/spec").Collection["uid"]) => void;
removeEnvironment: (environmentName: string, collectionUid: import("@scalar/oas-utils/entities/spec").Collection["uid"]) => void;
set: (item: {
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
security: Record<string, string[]>[];
"x-scalar-icon": string;
uid: string & import("zod").$brand<"collection">;
securitySchemes: string[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
servers: (string & import("zod").$brand<"server">)[];
requests: (string & import("zod").$brand<"operation">)[];
tags: (string & import("zod").$brand<"tag">)[];
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
watchMode: boolean;
useCollectionSecurity: boolean;
watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
jsonSchemaDialect?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
default: string;
description?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
selectedServerUid?: (string & import("zod").$brand<"server">) | undefined;
documentUrl?: string | undefined;
integration?: string | null | undefined;
}) => void;
edit: <P extends "servers" | "externalDocs" | "security" | "tags" | "type" | "uid" | "selectedServerUid" | "selectedSecuritySchemeUids" | "openapi" | "jsonSchemaDialect" | "info" | "components" | "webhooks" | "x-scalar-icon" | "x-scalar-active-environment" | "x-scalar-environments" | "x-scalar-secrets" | "securitySchemes" | "requests" | "children" | "documentUrl" | "watchMode" | "integration" | "useCollectionSecurity" | "watchModeStatus" | `servers.${number}` | "externalDocs.url" | "externalDocs.description" | `security.${number}` | `security.${number}.${string}` | `tags.${number}` | `selectedSecuritySchemeUids.${number}` | `selectedSecuritySchemeUids.${number}.${number}` | "info.title" | "info.summary" | "info.description" | "info.termsOfService" | "info.contact" | "info.license" | "info.version" | "info.x-scalar-sdk-installation" | "info.contact.url" | "info.contact.name" | "info.contact.email" | "info.license.url" | "info.license.name" | "info.license.identifier" | `info.x-scalar-sdk-installation.${number}` | `info.x-scalar-sdk-installation.${number}.description` | `info.x-scalar-sdk-installation.${number}.lang` | `info.x-scalar-sdk-installation.${number}.source` | `components.${string}` | `webhooks.${string}` | `x-scalar-environments.${string}` | `x-scalar-secrets.${string}` | `securitySchemes.${number}` | `requests.${number}` | `children.${number}`>(uid: (string & import("zod").$brand<"collection">) | null | undefined, path: P, value: P extends "servers" | "externalDocs" | "security" | "tags" | "type" | "uid" | "selectedServerUid" | "selectedSecuritySchemeUids" | "openapi" | "jsonSchemaDialect" | "info" | "components" | "webhooks" | "x-scalar-icon" | "x-scalar-active-environment" | "x-scalar-environments" | "x-scalar-secrets" | "securitySchemes" | "requests" | "children" | "documentUrl" | "watchMode" | "integration" | "useCollectionSecurity" | "watchModeStatus" ? {
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;
url?: string | undefined;
} | undefined;
"x-scalar-sdk-installation"?: {
lang: string;
source?: string | undefined;
description?: string | undefined;
}[] | undefined;
};
security: Record<string, string[]>[];
"x-scalar-icon": string;
uid: string & import("zod").$brand<"collection">;
securitySchemes: string[];
selectedSecuritySchemeUids: ((string & import("zod").$brand<"securityScheme">) | (string & import("zod").$brand<"securityScheme">)[])[];
servers: (string & import("zod").$brand<"server">)[];
requests: (string & import("zod").$brand<"operation">)[];
tags: (string & import("zod").$brand<"tag">)[];
children: ((string & import("zod").$brand<"operation">) | (string & import("zod").$brand<"tag">))[];
watchMode: boolean;
useCollectionSecurity: boolean;
watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
jsonSchemaDialect?: string | undefined;
externalDocs?: {
url: string;
description?: string | undefined;
} | undefined;
components?: Record<string, unknown> | undefined;
webhooks?: Record<string, unknown> | undefined;
"x-scalar-active-environment"?: string | undefined;
"x-scalar-environments"?: Record<string, {
variables: Record<string, string | {
default: string;
description?: string | undefined;
}>;
description?: string | undefined;
color?: string | undefined;
}> | undefined;
"x-scalar-secrets"?: Record<string, {
description?: string | undefined;
example?: string | undefined;
}> | undefined;
selectedServerUid?: (string & import("zod").$brand<"server">) | undefined;
documentUrl?: string | undefined;
integration?: string | null | undefined;
}[P] : P extends `${infer K}.${infer R}` ? K extends "servers" | "externalDocs" | "security" | "tags" | "type" | "uid" | "selectedServerUid" | "selectedSecuritySchemeUids" | "openapi" | "jsonSchemaDialect" | "info" | "components" | "webhooks" | "x-scalar-icon" | "x-scalar-active-environment" | "x-scalar-environments" | "x-scalar-secrets" | "securitySchemes" | "requests" | "children" | "documentUrl" | "watchMode" | "integration" | "useCollectionSecurity" | "watchModeStatus" ? R extends import("@scalar/object-utils/nested").Path<{
type: "collection";
openapi: string;
info: {
title: string;
version: string;
summary?: string | undefined;
description?: string | undefined;
termsOfService?: string | undefined;
contact?: {
name?: string | undefined;
url?: string | undefined;
email?: string | undefined;
} | undefined;
license?: {
name?: string | null | undefined;
identifier?: string | undefined;