import { OnExecuteCredentialsExchange } from "../../types/Hooks";
/**
 * Creates a credentials-exchange hook that sets the `preferred_username`
 * claim on both access and ID tokens.
 *
 * The username is resolved from the primary user or any linked identity.
 * If no username is found, the hook does nothing.
 *
 * **Resolution order:**
 * 1. `user.username` — direct username on the primary user
 * 2. `user.preferred_username` — existing preferred_username field
 * 3. Linked identities — first identity with `username` or `profileData.username`
 *
 * @example
 * ```typescript
 * import { init, preDefinedHooks } from "authhero";
 *
 * const { app } = init({
 *   dataAdapter,
 *   hooks: {
 *     onExecuteCredentialsExchange: preDefinedHooks.setPreferredUsername(),
 *   },
 * });
 * ```
 */
export declare function setPreferredUsername(): OnExecuteCredentialsExchange;
