import { type ReactNode } from "react"; export type WorkspaceReach = { /** The workspaces it works in; null for every workspace, including new ones. */ workspaceIds: readonly string[] | null; /** Organization things only: whether members can use it in their own Personal workspace. */ personalWorkspaces: boolean; }; export type ReachWorkspace = { id: string; name: string; /** The viewer's own Personal workspace, listed like the others. */ personal?: boolean | undefined; }; /** Who owns a thing, and so who manages it. */ export type ReachOwner = { kind: "organization"; name: string; } | { kind: "workspace"; id: string; name: string; } | { kind: "person"; }; /** * How Personal workspaces are handled: one checkbox for everyone's * (organization things), always included (your own things), or not offered. */ export type ReachPersonalWorkspaces = "choice" | "always" | "none"; /** * "Belongs to Acme. Organization owners manage it." Who manages a kind differs * (vaults and bots need organization owners, model accounts owners and admins), * so the caller says it; your own things are managed by you alone. */ export declare function reachOwnerLine(owner: ReachOwner, managedBy?: string): string; /** * The short value for an "Available in" row: "All workspaces + Personal", * "2 workspaces", "Personal workspaces only", "All my workspaces". Workspaces * that always have it (`alwaysIncluded`) count. */ export declare function workspaceReachSummary(reach: WorkspaceReach, input: { owner: ReachOwner["kind"]; personalWorkspaces: ReachPersonalWorkspaces; alwaysIncluded?: readonly string[] | undefined; }): string; /** Nothing can use it as drafted: no workspace ticked and no Personal workspaces. */ export declare function workspaceReachIsEmpty(reach: WorkspaceReach, input: { owner: ReachOwner["kind"]; personalWorkspaces: ReachPersonalWorkspaces; alwaysIncluded?: readonly string[] | undefined; }): boolean; /** * Workspaces to tick, with their loading, failed, empty and long-list states. * Rows in `alwaysIncluded` stay ticked with their reason; the workspace the * page was opened from says so. */ export declare function WorkspaceChecklist({ legend, workspaces, workspacesError, onRetryWorkspaces, selected, onSelectedChange, hereId, alwaysIncluded, emptyText, disabled, error, }: { legend?: string; /** null while loading. */ workspaces: readonly ReachWorkspace[] | null; workspacesError?: boolean; onRetryWorkspaces?: (() => void) | undefined; selected: readonly string[]; onSelectedChange: (next: string[]) => void; /** The workspace the page was opened from. */ hereId?: string | null | undefined; /** Workspace id to the reason it is always included. */ alwaysIncluded?: Readonly> | undefined; emptyText?: string; disabled?: boolean; error?: ReactNode; }): import("react").JSX.Element; /** * Another way to limit it, beside the workspace choices, such as "Only * selected people" for a model account. While chosen it replaces the * workspace list and the Personal workspaces choice. */ export type ReachExtraChoice = { value: string; title: string; description: string; chosen: boolean; onChoose: () => void; /** Shown under the choices while it is chosen. */ content?: ReactNode; }; /** * The "Available in" control: the owner line, all or selected workspaces, the * workspace list, and for organization things the Personal workspaces choice. */ export declare function WorkspaceReachFields({ owner, organizationName, managedBy, showOwner, label, labelHidden, value, onChange, workspaces, workspacesError, onRetryWorkspaces, hereId, alwaysIncluded, personalWorkspaces, seedSelected, extraChoice, emptyText, error, disabled, }: { owner: ReachOwner; organizationName: string; /** Who manages it, as a sentence: "Organization owners manage it." */ managedBy?: string | undefined; /** Off where the owner was chosen right above, so it isn't said twice. */ showOwner?: boolean; label?: string; /** On a page whose title already says it; the group keeps it as its name. */ labelHidden?: boolean; value: WorkspaceReach; onChange: (next: WorkspaceReach) => void; /** The workspaces it could reach; null while loading. */ workspaces: readonly ReachWorkspace[] | null; workspacesError?: boolean; onRetryWorkspaces?: (() => void) | undefined; hereId?: string | null | undefined; /** Workspace id to the reason it is always included (its owner, or one that keeps it). */ alwaysIncluded?: Readonly> | undefined; personalWorkspaces: ReachPersonalWorkspaces; /** The workspaces ticked when switching to Selected workspaces. None by default. */ seedSelected?: (() => string[]) | undefined; extraChoice?: ReachExtraChoice | undefined; emptyText?: string | undefined; error?: ReactNode; disabled?: boolean; }): import("react").JSX.Element;