import { IncomingMessage, ServerResponse } from 'node:http';
import type { Api } from '../../api';
import { Update, UpdateType } from './api';
export type WebhookOptions = {
    domain: string;
    port?: number;
    path?: string;
    secret?: string;
};
export declare class Webhook {
    private readonly api;
    private readonly allowedUpdates;
    readonly url: string;
    private server;
    private readonly port;
    private readonly hookPath;
    private readonly secret?;
    constructor(api: Api, allowedUpdates: UpdateType[] | undefined, token: string, options: WebhookOptions);
    static clearSubscriptions: (api: Api, activeUrl?: string) => Promise<(void | import("./api").ActionResponse)[]>;
    static getWebhookUrl: (domain: string, path: string) => string;
    static generateTokenRelatedHash: (token: string) => string;
    createCallback: (handleUpdate: (update: Update) => Promise<void>) => (req: IncomingMessage, res: ServerResponse) => void;
    subscribe: () => Promise<void>;
    start: (handleUpdate: (update: Update) => Promise<void>) => Promise<void>;
    stop: () => Promise<void>;
    private isSecretValid;
}
