import { SidebarWorkspace } from './configProvider'; /** * Sharing a workspace as JSON: what goes out, and how what comes back in is * read. * * Same shape as `groupShare.ts`, on purpose — read that file first, this one * follows its pattern rather than reinventing one. Kept out of the tree * component for the same reason too: building/parsing/validating a workspace * is a pure function over plain objects, and `sidebarTree.component.ts` is * already ~4900 lines. * * There is no purge here, unlike the group's. A workspace carries only ids — * an exclusion list and a couple of order maps — never a profile's `options`, * so there is nothing secret to strip on the way out or the way back in. */ export declare const SHARE_FORMAT = "tabby-better-sidebar/workspace"; export declare const SHARE_VERSION = 1; /** * What travels. No `id` — a pasted workspace always gets a fresh one, exactly * like a pasted folder (see `generateWorkspaceId()` below and * `applySharedGroup()` in groupShare's caller). */ export interface SharedWorkspace { name?: string; icon?: string; color?: string; hiddenProfileIds: string[]; hiddenGroupIds: string[]; favorites: string[]; favoriteGroups: string[]; groupOrder: Record; profileOrder: Record; } export interface WorkspaceSharePayload { format: string; version: number; workspace: SharedWorkspace; } /** * Everything a workspace carries, minus its id, ready to be copied to the * clipboard. */ export declare function buildWorkspacePayload(workspace: SidebarWorkspace): WorkspaceSharePayload; export interface ParseWorkspaceResult { payload?: WorkspaceSharePayload; /** Why it was refused, ready to show. Set when `payload` is not. */ error?: string; } /** * Reads what the clipboard holds, and refuses anything it does not * recognise. No second purge pass to speak of here (unlike groupShare's * `parsePayload()`) — there is nothing secret in a workspace payload to * begin with, so there is nothing for a re-purge to catch. */ export declare function parseWorkspacePayload(text: string): ParseWorkspaceResult; /** * A fresh workspace id, same shape `createWorkspace()` mints in * sidebarTree.component.ts — kept here too so the import path never has a * reason to reuse the id a payload carries (piège-shaped: an id copied from * another machine could collide with one already in use locally). */ export declare function generateWorkspaceId(): string; /** * "Prod" -> "Prod (2)" -> "Prod (3)"... among existing workspace names. * * A different suffix from `copyNameFor()`/`rootGroupCopyName()`'s "X - Copie" * in sidebarTree.component.ts on purpose: those name a *duplicate* made in * place, this names an *import* landing on a taken name — same dedup shape, * different gesture, so a different, equally conventional suffix reads as * intentional rather than as the two gestures disagreeing with themselves. */ export declare function uniqueWorkspaceName(name: string, existingNames: Iterable): string;