/** * Generic sharing binding contract. * * These types are the *load-bearing* contract between the presentational * sharing UI in `@burdenoff/fe-libs/sharing` and the consuming microfrontend. * The fe-libs components are presentational + state-machine only — they never * import GraphQL codegen hooks. Each MFE implements a {@link ShareController} * (wiring its own queries/mutations) and injects it into the components. */ /** Capability/permission level a grant confers on the grantee. */ export type ShareRole = 'VIEWER' | 'COMMENTER' | 'EDITOR' | 'MANAGER'; /** Visibility mode of the shared resource. */ export type ShareVisibility = 'PRIVATE' | 'SHARED_WITH_USERS' | 'SHARED_WITH_VIBE' | 'PUBLIC_LINK'; /** Lifecycle status of an individual grant. */ export type ShareStatus = 'PENDING' | 'ACCEPTED' | 'REVOKED' | 'EXPIRED'; /** * Describes the resource being shared. `type` is an opaque, product-defined * string (e.g. `"file"`, `"vibe"`, `"session"`); the UI only uses it for * display + copy. `vibeId` gates the "Everyone with Vibe" mode. */ export interface ShareResourceRef { type: string; id: string; name: string; vibeId?: string | null; ownerId?: string | null; visibility?: ShareVisibility; } /** * A single share grant (a user invite or a public link), as projected for * the UI. The controller maps its own backend shape onto this view. */ export interface ShareGrantView { id: string; granteeUserId?: string | null; granteeEmail?: string | null; role: ShareRole; status: ShareStatus; visibility: ShareVisibility; expiresAt?: string | null; token?: string | null; shareUrl?: string | null; createdAt?: string; } /** Roles + descriptions surfaced in selectors. */ export interface ShareCapabilities { supportsUsers: boolean; supportsLink: boolean; supportsVibeShare: boolean; supportsExpiry: boolean; roles: ShareRole[]; } /** * The controller contract. The MFE implements this (typically by wrapping its * generated GraphQL hooks) and passes it to {@link ShareDialog} / * {@link SharedWithList}. Only `loading`, `grants`, `links`, `refetch`, * `createUserShare`, and `capabilities` are required; the rest are optional * and the UI feature-detects them (hiding/disabling controls when absent). */ export interface ShareController { loading: boolean; grants: ShareGrantView[]; links: ShareGrantView[]; refetch: () => void; createUserShare(input: { email: string; role: ShareRole; message?: string; expiresAt?: string; }): Promise; createLinkShare?(input: { role: ShareRole; expiresAt?: string | null; }): Promise<{ shareUrl: string; }>; updateRole?(grantId: string, role: ShareRole): Promise; revoke?(grantId: string): Promise; revokeLink?(grantId: string): Promise; setVisibility?(visibility: ShareVisibility): Promise; currentVisibility?: ShareVisibility; capabilities: ShareCapabilities; } /** Canonical, ordered list of roles (low → high privilege). */ export declare const SHARE_ROLES: readonly ShareRole[]; /** Human-friendly label per role. */ export declare const ROLE_LABELS: Record; /** One-line description of what each role can do. */ export declare const ROLE_DESCRIPTIONS: Record; /** Resolve a display label for a role, falling back to the raw value. */ export declare function roleLabel(role: ShareRole): string; /** Resolve a description for a role, falling back to an empty string. */ export declare function roleDescription(role: ShareRole): string; //# sourceMappingURL=types.d.ts.map