/** The ways a shared resource can be shared. */ export type SiteSharingMode = 'all' | 'selected' | 'allExcept'; /** * What a person has picked. The shape `sharingFromChoice` takes, restated here * because this lib may not depend on `@aglyn/aglyn`. */ export type SiteSharingValue = { mode: 'all'; } | { mode: 'selected'; hostIds: readonly string[]; } | { mode: 'allExcept'; exceptHostIds: readonly string[]; }; export interface SiteSharingSite { id: string; name: string; } export interface SiteSharingFieldProps { /** Null while nobody has chosen: the resource stores no sharing at all. */ value: SiteSharingValue | null; onChange: (next: SiteSharingValue) => void; /** The workspace's sites this member can name. */ sites: readonly SiteSharingSite[]; /** False while `sites` is still being read. */ sitesReady: boolean; /** The choices this resource offers. Every one by default. */ modes?: readonly SiteSharingMode[]; /** * The most sites this resource can reach, for one whose stored fields multiply * by site. Past it, "All sites except…" is switched off with the reason. */ maxIncluded?: number | null; label?: string; readOnly?: boolean; /** Why it is read-only. Shown when it is. */ readOnlyReason?: string; /** Why the caller cannot save this choice, from `sharingFromChoice`. */ problem?: string | null; /** * The sentence under a choice, for a resource where the default one is not * true: a copy installed onto today's sites, which a site added later never * gets whichever choice made it (AGL-4047). A reason a choice is off still * wins over it. */ modeDetails?: Partial>; /** The caption over the list of sites, per choice, where "share" is not the verb. */ listLabels?: Partial>; } /** * Who a shared resource is shared with: All sites, the sites you choose, or all * sites except the ones you leave out (AGL-4047). * * Radios and a list of checkboxes that are all on screen, never a dropdown: who * can see something should read at a glance, and the sites left out are the part * people came to check. * * DELIBERATELY PRESENTATIONAL. It takes the sites and hands back a choice. What a * choice writes, and whether it can be, is `sharingFromChoice` in `@aglyn/aglyn`, * for the caller and again for the route that writes it. So this holds no wording * for a refusal it could disagree with: the caller passes `problem`. What it does * itself is keep two choices out of reach that are never right, and say why: a * workspace with one site has nothing to leave out, and the last site in can't be * left out too. * * Moving between the modes carries the picks across: chosen sites become "all * except the others", and back. Moving from All sites starts with nothing left * out, which the caller refuses until something is. * * NOT IN THE BARREL (AGL-1290). Console-only; import by subpath: * `@aglyn/shared-ui-jsx/components/site-sharing-field.component`. */ export declare function SiteSharingField(props: SiteSharingFieldProps): import("react").JSX.Element; export declare namespace SiteSharingField { var displayName: string; } export default SiteSharingField;