@scalar/api-client
Version:
the open source API testing client
31 lines • 1.48 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 { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
import { type MaybeRefOrGetter, type Ref } from 'vue';
import type { UseAppSidebarReturn } from '../../../../v2/features/app/hooks/use-app-sidebar.js';
export type UseTabsReturn = {
tabs: Ref<Tab[]>;
activeTabIndex: Ref<number>;
copyTabUrl: (index: number) => Promise<void>;
isLoading: Ref<boolean>;
createTabFromCurrentRoute: () => Tab;
};
type UseTabsParams = {
workspaceStore: Ref<WorkspaceStore | null>;
eventBus: WorkspaceEventBus;
workspaceSlug: MaybeRefOrGetter<string | undefined>;
documentSlug: MaybeRefOrGetter<string | undefined>;
path: MaybeRefOrGetter<string | undefined>;
method: MaybeRefOrGetter<HttpMethod | undefined>;
getEntryByLocation: UseAppSidebarReturn['getEntryByLocation'];
};
/**
* Composable for managing desktop tabs functionality.
*
* Handles tab creation, switching, closing, and synchronization with the current route.
* Tabs are persisted in the workspace store to maintain state across sessions.
*/
export declare const useTabs: ({ workspaceStore, getEntryByLocation, workspaceSlug, documentSlug, path, method, }: UseTabsParams) => UseTabsReturn;
export {};
//# sourceMappingURL=use-tabs.d.ts.map