import type { OpenGeniBrowserClient } from "@opengeni/sdk/browser"; import type { WorkspaceArtifact } from "@opengeni/sdk"; import { type ReactNode } from "react"; export type Audience = "private" | "workspace"; /** The words an audience control uses for one kind of thing. */ type AudienceCopy = { /** "Site" or "file", as it reads mid-sentence. */ noun: string; /** Capitalized noun for toast titles: "Site", "File". */ Noun: string; onlyMeDescription: string; workspaceDescription: (workspaceName: string) => string; shareConfirm: (workspaceName: string) => string; limitConfirm: string; /** "Who can see this Site", "Who can open this file". */ whoCan: string; changeLabel: string; limitedToast: string; }; export declare const FILE_AUDIENCE_COPY: AudienceCopy; export type AudienceControls = { chip: ReactNode; shareButton: ReactNode; dialog: ReactNode; /** Opens the Share with workspace confirmation, while the owner's item is Only me. */ share: (() => void) | undefined; /** Opens the Limit to me confirmation, while the owner's item is shared and Only me is allowed. */ limit: (() => void) | undefined; }; /** * An item's audience on its page, in the same words and shape as a chat's: * a chip saying who can see it ("Only me" or "Workspace") that opens the * owner's choices, and, while it is Only me, a clear "Share with workspace" * button. Every change is confirmed first. Only the owner can change it; * everyone else just sees the chip. */ export declare function useArtifactAudience({ client, workspaceId, workspaceName, title, visibility, ownedByCurrentUser, copy, update, canLimitToMe: knownCanLimitToMe, }: { client: OpenGeniBrowserClient; workspaceId: string; workspaceName: string; title: string; visibility: Audience; /** The viewer owns the item and may change it in this workspace. */ ownedByCurrentUser: boolean; copy: AudienceCopy; /** Applies the change; throws when the server refuses it. */ update: (visibility: Audience) => Promise; /** * Skip asking whether Only me is allowed (lists, where every row would * ask) and offer Limit to me; the server still refuses it when it is off. */ canLimitToMe?: boolean | undefined; }): AudienceControls; /** * A Site's audience on its page, in the same words and shape as a chat's. * Only the owner can change it; everyone else just sees the chip. */ export declare function useSiteAudience({ client, workspaceId, workspaceName, artifact, ownedByCurrentUser, onChanged, }: { client: OpenGeniBrowserClient; workspaceId: string; workspaceName: string; artifact: WorkspaceArtifact; /** The viewer owns the Site and may publish in this workspace. */ ownedByCurrentUser: boolean; onChanged: (artifact: WorkspaceArtifact) => void; }): AudienceControls; export {};