import { KeetaNet } from '../../client/index.js';
import type * as KeetaAnchorHTTPServer from '../../lib/http-server/index.js';
import type { KeetaAnchorMetadataServerConfig } from '../../lib/anchor-metadata-server.js';
import type { KeetaUsernameAnchorUsernameResolutionContext, KeetaUsernameAnchorAccountResolutionContext, KeetaUsernameAnchorSearchRequestParameters, KeetaUsernameAnchorUsernameWithAccount, KeetaUsernameAnchorClaimContext } from './common.js';
import type { ServiceMetadata } from '../../lib/resolver.ts';
import type { Routes } from '../../lib/http-server/index.ts';
import { KeetaAnchorMetadataServer } from '../../lib/anchor-metadata-server.js';
type ClaimHandlerResponse = {
    ok: true;
} | {
    ok: false;
    taken?: false;
} | {
    ok: false;
    taken: true;
};
type SearchHandlerResponse = {
    results: KeetaUsernameAnchorUsernameWithAccount[];
};
export interface KeetaAnchorUsernameServerConfig extends KeetaAnchorMetadataServerConfig {
    homepage?: string | (() => Promise<string> | string);
    usernames: {
        resolveUsername: (input: KeetaUsernameAnchorUsernameResolutionContext) => Promise<{
            account: InstanceType<typeof KeetaNet.lib.Account>;
        } | null>;
        resolveAccount: (input: KeetaUsernameAnchorAccountResolutionContext) => Promise<{
            username: string;
        } | null>;
        releaseUsername?: (input: {
            account: InstanceType<typeof KeetaNet.lib.Account>;
        }) => Promise<{
            ok: boolean;
        }>;
        claim?: ((input: KeetaUsernameAnchorClaimContext) => Promise<ClaimHandlerResponse>);
        search?: ((input: KeetaUsernameAnchorSearchRequestParameters) => Promise<SearchHandlerResponse>);
    };
    routes?: Routes;
    usernamePattern?: string | RegExp;
}
export declare class KeetaNetUsernameAnchorHTTPServer extends KeetaAnchorMetadataServer<NonNullable<ServiceMetadata['services']['username']>[string], KeetaAnchorUsernameServerConfig> {
    #private;
    readonly homepage: NonNullable<KeetaAnchorUsernameServerConfig['homepage']>;
    readonly usernames: KeetaAnchorUsernameServerConfig['usernames'];
    readonly routes: NonNullable<KeetaAnchorUsernameServerConfig['routes']>;
    constructor(config: KeetaAnchorUsernameServerConfig);
    protected initRoutes(config: KeetaAnchorUsernameServerConfig): Promise<KeetaAnchorHTTPServer.Routes>;
    protected buildServiceMetadata(): Promise<NonNullable<ServiceMetadata['services']['username']>[string]>;
}
export {};
//# sourceMappingURL=server.d.ts.map