import type { NextResponse } from "next/server";
type UsernameStatus = {
    /**
     * ```text
     * 200: Username is available
     * 402: Pro username, must be purchased
     * 418: A user exists with that username
     * ```
     */
    statusCode: 200 | 402 | 418;
    requestedUserName: string;
    json: {
        available: boolean;
        premium: boolean;
        message?: string;
        suggestion?: string;
    };
};
export type CustomNextApiHandler = (body: Record<string, string>, usernameStatus: UsernameStatus) => Promise<NextResponse<any>>;
export declare function isBlacklisted(username: string): Promise<boolean>;
export declare const isPremiumUserName: (username: string) => Promise<boolean>;
export declare const generateUsernameSuggestion: (users: string[], username: string) => Promise<string>;
declare const usernameHandler: (handler: CustomNextApiHandler) => (body: Record<string, string>) => Promise<NextResponse<any>>;
declare const usernameCheck: (usernameRaw: string, currentOrgDomain?: string | null) => Promise<{
    available: boolean;
    premium: boolean;
    suggestedUsername: string;
}>;
/**
 * Should be used when in global namespace(i.e. outside of an organization)
 */
export declare const isUsernameReservedDueToMigration: (username: string) => Promise<boolean>;
/**
 * It is a bit different from usernameCheck because it also check if the user signing up is the same user that has a pending invitation to organization
 * So, it uses email to uniquely identify the user and then also checks if the username requested by that user is available for taking or not.
 * TODO: We should reuse `usernameCheck` and then do the additional thing in here.
 */
declare const usernameCheckForSignup: ({ username: usernameRaw, email, }: {
    username: string;
    email: string;
}) => Promise<{
    available: boolean;
    premium: boolean;
    suggestedUsername: string;
}>;
export { usernameHandler, usernameCheck, usernameCheckForSignup };
//# sourceMappingURL=username.d.ts.map