@scalar/api-client
Version:
the open source API testing client
75 lines • 2.78 kB
TypeScript
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
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 { Workspace } from '../../../../v2/hooks/use-workspace-selector.js';
import type { ClientLayout } from '../../../../v2/types/layout';
/** These props are provided at the route level */
export type RouteProps = {
documentSlug: string;
document: WorkspaceDocument | null;
eventBus: WorkspaceEventBus;
layout: ClientLayout;
path?: string;
method?: HttpMethod;
exampleName?: string;
environment: XScalarEnvironment;
workspaceStore: WorkspaceStore;
activeWorkspace: Workspace;
};
/** When in the collections pages */
export type CollectionProps = RouteProps & ({
collectionType: 'document';
document: WorkspaceDocument;
} | {
collectionType: 'workspace';
document: null;
});
/** Routes for the API client app and web, the same as modal + workspace routes */
export declare const ROUTES: ({
path: string;
children: ({
path: string;
children: ({
name: string;
path: string;
component: () => Promise<typeof import("../../../../v2/features/operation/Operation.vue.js")>;
children?: undefined;
} | {
name: string;
path: string;
component: () => Promise<typeof import("../../../../v2/features/collection/DocumentCollection.vue.js")>;
children: ({
name: string;
path: string;
redirect: {
name: string;
};
component?: undefined;
} | {
name: string;
path: string;
component: () => Promise<typeof import("../../../../v2/features/collection/components/Overview.vue.js")>;
redirect?: undefined;
})[];
})[];
name?: undefined;
component?: undefined;
} | {
name: string;
path: string;
component: () => Promise<typeof import("../../../../v2/features/collection/WorkspaceCollection.vue.js")>;
children: {
name: string;
path: string;
component: () => Promise<typeof import("../../../../v2/features/collection/components/Environment.vue.js")>;
}[];
})[];
redirect?: undefined;
} | {
path: string;
redirect: () => string;
children?: undefined;
})[];
//# sourceMappingURL=routes.d.ts.map