@scalar/api-client
Version:
the open source API testing client
159 lines • 7.85 kB
TypeScript
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
import type { Theme } from '@scalar/themes';
import type { WorkspaceStore } from '@scalar/workspace-store/client';
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
import type { ClientLayout } from '../../../../v2/types/layout';
/** These props are provided at the route level */
export type RouteProps = {
/** The slug of the currently selected document in the workspace */
documentSlug: string;
/** The currently active document */
document: WorkspaceDocument | null;
/** The workspace event bus */
eventBus: WorkspaceEventBus;
/** The layout of the client */
layout: ClientLayout;
/** The API path currently selected (e.g. "/users/{id}") */
path?: string;
/** The HTTP method for the currently selected API path (e.g. GET, POST) */
method?: HttpMethod;
/** The name of the currently selected example (for examples within an endpoint) */
exampleName?: string;
/** The currently active environment */
environment: XScalarEnvironment;
/** The merged security schemes */
securitySchemes: MergedSecuritySchemes;
/** The workspace store */
workspaceStore: WorkspaceStore;
/** The currently active workspace */
activeWorkspace: {
id: string;
label: string;
};
/** Client plugins */
plugins: ClientPlugin[];
/** Custom themes available to the team */
customThemes?: Theme[];
/** The currently selected theme styles string */
currentTheme?: string;
/** Whether the current color mode is dark */
isDarkMode?: boolean;
};
/** When in the collections pages */
export type CollectionProps = RouteProps & ({
collectionType: 'document' | 'operation';
document: WorkspaceDocument;
} | {
collectionType: 'workspace';
document: null;
});
export type ScalarClientAppRouteParams = 'namespace' | 'workspaceSlug' | 'documentSlug' | 'pathEncoded' | 'method' | 'exampleName';
/** Routes for the API client app and web, the same as modal + workspace routes */
export declare const ROUTES: ({
path: string;
children: ({
path: string;
children: ({
path: string;
children: ({
name: string;
path: string;
component: import("vue").DefineComponent<RouteProps & {
options?: import("../../modal/Modal.vue.js").ModalProps["options"];
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps & {
options?: import("../../modal/Modal.vue.js").ModalProps["options"];
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
redirect?: undefined;
children?: undefined;
} | {
name: string;
path: string;
component: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
redirect: {
name: string;
};
children: {
name: string;
path: string;
component: import("vue").DefineComponent<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
})> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
}[];
})[];
name?: undefined;
component?: undefined;
} | {
name: string;
path: string;
component: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
children: ({
name: string;
path: string;
redirect: {
name: string;
};
component?: undefined;
} | {
name: string;
path: string;
component: import("vue").DefineComponent<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
})> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
redirect?: undefined;
})[];
})[];
name?: undefined;
component?: undefined;
} | {
name: string;
path: string;
component: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
children: {
name: string;
path: string;
component: import("vue").DefineComponent<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
}), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(RouteProps & {
collectionType: "document" | "operation";
document: WorkspaceDocument;
}) | (RouteProps & {
collectionType: "workspace";
document: null;
})> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
}[];
})[];
redirect?: undefined;
} | {
path: string;
redirect: () => string;
children?: undefined;
})[];
//# sourceMappingURL=routes.d.ts.map