import { DataTag, QueryClient } from '@tanstack/react-query'; import { APIError } from 'better-auth'; import { OrganizationAuthServer } from '../../../lib/auth-server'; export type HasPermissionData = Awaited>; export type HasPermissionParams = Parameters[0]; /** * Query options factory for organization permission checks. * * @param auth - The Better Auth server instance. * @param userId - The signed-in user's ID. Used for cache partitioning so * the key matches the client-side `hasPermissionOptions` for SSR hydration. * @param params - Parameters forwarded to `auth.api.hasPermission`. */ export declare function hasPermissionOptions(auth: TAuth, userId: string, params: HasPermissionParams): (import('@tanstack/query-core').OmitKeyof>, APIError, Awaited>, readonly ["auth", "user", string | undefined, "organization", "permissions", "has", NonNullable<{ permissions: { readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | "delete" | "create")[] | undefined; readonly ac?: ("update" | "delete" | "create" | "read")[] | undefined; }; } & { organizationId?: string | undefined; }> | null]>, "queryFn"> & { queryFn?: import('@tanstack/query-core').QueryFunction>, readonly ["auth", "user", string | undefined, "organization", "permissions", "has", NonNullable<{ permissions: { readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | "delete" | "create")[] | undefined; readonly ac?: ("update" | "delete" | "create" | "read")[] | undefined; }; } & { organizationId?: string | undefined; }> | null], never> | undefined; } & { queryKey: readonly ["auth", "user", string | undefined, "organization", "permissions", "has", NonNullable<{ permissions: { readonly organization?: ("update" | "delete")[] | undefined; readonly member?: ("update" | "delete" | "create")[] | undefined; readonly invitation?: ("create" | "cancel")[] | undefined; readonly team?: ("update" | "delete" | "create")[] | undefined; readonly ac?: ("update" | "delete" | "create" | "read")[] | undefined; }; } & { organizationId?: string | undefined; }> | null] & { [dataTagSymbol]: Awaited>; [dataTagErrorSymbol]: APIError; }; }) & { queryKey: DataTag | null], Awaited>, APIError>; }; export declare const ensureHasPermission: (queryClient: QueryClient, auth: TAuth, userId: string, params: HasPermissionParams) => Promise>>; export declare const prefetchHasPermission: (queryClient: QueryClient, auth: TAuth, userId: string, params: HasPermissionParams) => Promise; export declare const fetchHasPermission: (queryClient: QueryClient, auth: TAuth, userId: string, params: HasPermissionParams) => Promise>>;