export interface RemoveWorkspaceMemberFromSubtreeProps { workspaceId: string; targetUserId: string; } /** * One descendant the subtree sweep did NOT clear, where the target user still * holds a direct membership. * * `id` / `name` are masked TOGETHER: an entry the acting user may see carries * both, and one they may not carries `null` for both — the sweep reports THAT a * membership survived without disclosing the existence or name of a sealed * sub-workspace the actor has no authority over (the same sealing fence the * descendant roster read applies). Modelled as a discriminated union so a * `null` check on `id` narrows `name` too. */ export type SkippedWorkspace = { id: string; name: string; /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */ reason: "out-of-reach"; } | { id: null; name: null; /** Why it was skipped. `out-of-reach`: the actor's authority does not extend there. */ reason: "out-of-reach"; }; export interface RemoveWorkspaceMemberFromSubtreeResponse { removedCount: number; removed: { workspaceId: string; userId: string; }[]; /** * How many descendant memberships the target RETAINED because the sweep could * not reach them. Always `0` for an owner / ancestor-owner / privileged key. * A non-zero value means the offboarding is PARTIAL — never conclude a user is * fully removed from `removedCount` alone. */ skippedCount: number; /** One entry per retained membership; `skippedCount === skipped.length`. */ skipped: SkippedWorkspace[]; } /** * Remove the target user's direct memberships on this workspace AND every * descendant. Requires `remove-member` (rank-bounded per node). Blocks with 409 * `workspace/owns-descendants` if the user OWNS any descendant workspace — * transfer or delete those first. * * A NON-owner's sweep can be PARTIAL: it stops at sealed sub-workspaces. Always * check `skippedCount` / `skipped` before treating someone as fully offboarded. */ declare function useRemoveWorkspaceMemberFromSubtree(): (props: RemoveWorkspaceMemberFromSubtreeProps) => Promise; export default useRemoveWorkspaceMemberFromSubtree;