import { type ReactNode } from 'react'; import { type AccessModel } from './model.js'; import { type DescribeGroup, type DetailsCache, type SearchPrincipals } from './PrincipalPicker.js'; import type { AccessStrings } from './strings.js'; import type { AccessChange, AccessPrincipal } from './types.js'; export interface GrantSelection { principalIds: string[]; roleIds: string[]; } /** The grant form's body and footer, which the drawer lays out in its own body and footer. */ export declare function useGrantView({ model, selection, onSelectionChange, resourceName, describeGroup, searchPrincipals, groupCount, peopleCount, recentPrincipalIds, cache, seen, saving, failure, onGrant, onCancel, focusLater, boundary, singleRole, t, }: { model: AccessModel; selection: GrantSelection; onSelectionChange: (next: GrantSelection) => void; resourceName: string; describeGroup?: DescribeGroup | undefined; searchPrincipals?: SearchPrincipals | undefined; groupCount?: number | undefined; peopleCount?: number | undefined; recentPrincipalIds?: readonly string[] | undefined; cache: DetailsCache; seen: Map; saving: boolean; /** The failed grant's callout, which stays in the form so the choices can be retried. */ failure: ReactNode; onGrant: (change: AccessChange) => void; onCancel: () => void; /** Sends focus somewhere once the change it goes with has rendered. */ focusLater: (find: () => HTMLElement | null | undefined) => void; /** The drawer's body, above its footer, which the open list fills. */ boundary: Element | null; /** One role each: the form picks one, and granting it takes the role each already holds. */ singleRole?: boolean; t: AccessStrings; }): { body: ReactNode; footer: ReactNode; };