import type { AccessContext, AccountGrant, Workspace } from "@opengeni/sdk"; import { type OpenGeniText } from "./messages/runtime.js"; export type OrgOption = { accountId: string; label: string; /** Whether the subject has the owner/admin authority required by organization settings. */ canManage: boolean; }; /** Organizations the subject administers (owner or admin), sorted by id. */ export declare function organizationAdministrationAccountIds(accessContext: AccessContext): string[]; /** A short, stable id fragment for an account that has no human name. */ export declare function shortAccountId(accountId: string): string; /** The organization's real name, or null when the API sent none. */ export declare function orgName(accountId: string, grants: AccountGrant[]): string | null; /** Human label for an organization: the grant's subjectLabel, else a short id. */ export declare function orgLabel(t: OpenGeniText, accountId: string, grants: AccountGrant[]): string; /** * The organizations the subject belongs to, in a stable order (default org * first, then by name). Derived from account grants, unioned with the accounts * that own the accessible workspaces so an org always shows even without an * explicit grant. */ export declare function organizationsForSubject(t: OpenGeniText, context: AccessContext, workspaces: Workspace[]): OrgOption[]; /** Workspaces that belong to a given organization, ordered by name. */ export declare function workspacesInOrg(workspaces: Workspace[], accountId: string): Workspace[]; export type OrgWorkspaces = { org: OrgOption; workspaces: Workspace[]; }; /** * Every workspace open to the person, grouped by organization in the * switcher's order: organizations as `organizationsForSubject` orders them, * each one's workspaces by name. The workspace picker lists them this way and * the previous and next workspace keys walk them in the same order. */ export declare function workspacesByOrganization(t: OpenGeniText, context: AccessContext, workspaces: Workspace[]): OrgWorkspaces[]; /** Organization settings remain anchored to an accessible workspace in that organization. */ export declare function organizationSettingsWorkspaceId(workspaces: Workspace[], accountId: string, activeWorkspaceId: string): string | null; /** * Where switching to an organization lands: the workspace last used there * while it is still open to the person, else its first shared workspace, else * their Personal workspace there. Null when nothing in it is open to them. */ export declare function organizationLandingWorkspaceId(workspaces: Workspace[], accountId: string, rememberedWorkspaceId?: string | null): string | null;