import { DocumentNode } from '@apollo/client'; /** * Identity the generic controller resolves a resource by. Most entities read by * `id`; the two owner-keyed entities (scorecard, docs) additionally carry the * `(ownerId, ownerType)` pair their read query requires. */ export interface EntityShareIdentity { /** Stable resource id (always present once the surface has loaded the row). */ id: string; /** `(ownerId, ownerType)` for entities read by owner instead of by id. */ owner?: { ownerId: string; ownerType: string; } | null; } /** The five share mutation documents + read query for one entity. */ export interface EntityShareOps { /** Reads the resource's `shares` / `myRole` (+ display name + optional `vibeId`). */ sharesQuery: DocumentNode; /** `share(input: ShareEntityInput!)`. */ share: DocumentNode; /** `revokeShare(input: RevokeShareInput!)`. */ revokeShare: DocumentNode; /** `updateShareRole(input: UpdateShareRoleInput!)`. */ updateShareRole: DocumentNode; /** `createShareLink(input: CreateShareGrantLinkInput!)`. */ createShareLink: DocumentNode; /** `revokeShareLink(input: RevokeShareInput!)`. */ revokeShareLink: DocumentNode; /** Top-level read field name (`aiPrompt`, `action`, …) used to read the response. */ readField: string; /** Mutation field name that returns the created link grant (for `shareUrl`). */ createLinkField: string; /** * Maps the resource identity onto the variables {@link sharesQuery} expects. * Defaults to `{ id }` for the standard `($id: ID!)` read. Entities read by * owner (scorecard, docs) override this to emit `{ ownerId, ownerType }`. */ readVariables?: (identity: EntityShareIdentity) => Record; } /** Entity types served by the generic {@link useEntityShareController}. */ export type GenericShareEntity = 'aiprompt' | 'action' | 'aicontext' | 'instructionfile' | 'tunnel' | 'catalog' | 'component' | 'template' | 'scorecard' | 'target' | 'docs' | 'session' | 'vibedeck'; /** Resolve the inline-`gql` document set for a generic-sharing entity. */ export declare const ENTITY_SHARE_OPS: Record;