import { v1 } from "@authzed/authzed-node";

//#region src/auth/authz/client.d.ts

type ZedClientInterface = ReturnType<typeof v1.NewClient>;
/**
 * Get the SpiceDB client singleton.
 * Creates a new client on first call.
 */
declare function getSpiceClient(): ZedClientInterface;
/**
 * Reset the client (useful for testing)
 */
declare function resetSpiceClient(): void;
declare const RelationshipOperation: typeof v1.RelationshipUpdate_Operation;
declare const Permissionship: typeof v1.CheckPermissionResponse_Permissionship;
/**
 * Check if a subject has a permission on a resource.
 */
declare function checkPermission(params: {
  resourceType: string;
  resourceId: string;
  permission: string;
  subjectType: string;
  subjectId: string;
}): Promise<boolean>;
/**
 * Check multiple permissions on a resource in a single request.
 * More efficient than multiple checkPermission calls.
 *
 * @returns Record mapping permission names to boolean results
 */
declare function checkBulkPermissions(params: {
  resourceType: string;
  resourceId: string;
  permissions: string[];
  subjectType: string;
  subjectId: string;
}): Promise<Record<string, boolean>>;
/**
 * Find all resources of a type that a subject has a permission on.
 */
declare function lookupResources(params: {
  resourceType: string;
  permission: string;
  subjectType: string;
  subjectId: string;
}): Promise<string[]>;
/**
 * Write a relationship to SpiceDB.
 */
declare function writeRelationship(params: {
  resourceType: string;
  resourceId: string;
  relation: string;
  subjectType: string;
  subjectId: string;
}): Promise<void>;
/**
 * Delete a relationship from SpiceDB.
 */
declare function deleteRelationship(params: {
  resourceType: string;
  resourceId: string;
  relation: string;
  subjectType: string;
  subjectId: string;
}): Promise<void>;
/**
 * Read relationships for a resource to list subjects with access.
 * Optionally filter by subject type and ID.
 */
declare function readRelationships(params: {
  resourceType: string;
  resourceId?: string;
  relation?: string;
  subjectType?: string;
  subjectId?: string;
}): Promise<Array<{
  resourceId: string;
  subjectType: string;
  subjectId: string;
  relation: string;
}>>;
//#endregion
export { Permissionship, RelationshipOperation, checkBulkPermissions, checkPermission, deleteRelationship, getSpiceClient, lookupResources, readRelationships, resetSpiceClient, v1, writeRelationship };