import { type ReactNode } from 'react'; import type { OpenMenu } from '../components/ContextMenu.js'; import { type AccessModel } from './model.js'; import type { AccessStrings } from './strings.js'; import type { AccessPrincipal, AccessRule } from './types.js'; /** The id the owner's section has among the roles' sections. */ export declare const OWNER_SECTION = "__owner"; /** A removal waiting on the reader: one role, or every role a principal holds here. */ export interface PendingRemoval { principalId: string; roleIds: string[]; /** Every role it holds, from its "Remove all access". */ all: boolean; } export interface ListActions { readOnly: boolean; /** The grants being saved, by `key()`. */ saving: ReadonlySet; removal: PendingRemoval | undefined; onAskRemove: (removal: PendingRemoval) => void; onCancelRemove: () => void; onRemove: (removal: PendingRemoval) => void; onGrantMore: (principalId: string) => void; /** Gives a principal this one role in place of the ones it holds, where each holds one. */ onChangeRole: (principalId: string, roleId: string) => void; /** Each principal holds one role here. */ singleRole: boolean; /** Opens a row's own menu on a right-click. */ openMenu: OpenMenu; /** The failed save's callout, and where it belongs: under the role or principal it was about. */ failure: { node: ReactNode; roleId?: string | undefined; principalId: string; } | undefined; } export declare const principalLabel: (principal: AccessPrincipal, t: AccessStrings) => string; /** Asks before a principal loses roles, saying exactly what it loses and what it keeps. */ export declare function RemoveConfirm({ model, removal, saving, onCancel, onConfirm, t, }: { model: AccessModel; removal: PendingRemoval; saving: boolean; onCancel: () => void; onConfirm: () => void; t: AccessStrings; }): import("react").JSX.Element | null; /** Marks the button that asked for a removal, so focus can go back to it. */ export declare const removeKey: (removal: PendingRemoval) => string; interface ViewProps { model: AccessModel; /** What the filter left: each role's principals, or each principal's roles. */ shown: ReadonlyMap; /** The sections in view, in order. */ order: readonly string[]; expanded: ReadonlySet; onExpandedChange: (id: string, open: boolean) => void; filtering: boolean; actions: ListActions; t: AccessStrings; sectionId: (id: string) => string; } /** Who has each role, role by role, after the owner. */ export declare function ByRole({ model, shown, order, expanded, onExpandedChange, filtering, actions, t, sectionId, }: ViewProps): (import("react").JSX.Element | null | undefined)[]; /** Which roles each person and group has, one by one. */ export declare function ByPrincipal({ model, shown, order, expanded, onExpandedChange, actions, t, sectionId, }: ViewProps): (import("react").JSX.Element | null)[]; /** A reason someone has access that no grant here changes, locked ahead of the grants. */ export declare function RuleRow({ rule, roleName, lead, t, }: { rule: AccessRule; roleName: string | undefined; /** Lines its title up with the rows below: in a chevron's column, in a tile's, or after both. */ lead: 'chevron' | 'tile' | 'both'; t: AccessStrings; }): import("react").JSX.Element; /** Person and group one by one where each holds one role: a flat row each, its role picked * from a list on the row. */ export declare function ByPrincipalSingle({ model, order, actions, t, sectionId }: ViewProps): (import("react").JSX.Element | null)[]; export {};