import type { User } from './user.ts';
import type { ImpersonatePayload } from '../server/operationsServer.ts';
/**
 * Applies impersonation to a request. The authenticated user must be a super_user.
 * Returns a new User object with downgraded permissions based on the impersonate payload.
 *
 * Mode A (inline role): `impersonate.role` is present — builds a synthetic user with the given permissions.
 * Mode B (existing user): `impersonate.username` is present (no role/role_name) — looks up the user from cache.
 * Mode C (existing role): `impersonate.role_name` is present (no role) — looks up the role by name and builds a synthetic user.
 */
export declare function applyImpersonation(authenticatedUser: User, payload: ImpersonatePayload): Promise<User>;
