declare module 'devbotsvotes' {
    export interface Vote {
        _id: string;
        user: string;
        bot: string;
        Date: string;
        ms: number;
    }

    export interface HasUserVotedResult {
        hasVoted: boolean;
        timeRemaining: string | null;
        voteDate: string | null;
    }

    export interface BotInfo {
        _id: string;
        botID: string;
        ownerID: string;
        username: string;
        discrim: string;
        votes: number;
        certificate: string;
        [key: string]: any;
    }

    export interface VoteNotifierOptions {
        botID: string;
        token: string;
        pollingInterval?: number;
        autoRetry?: boolean;
        debug?: boolean;
    }

    export default class VoteNotifier {
        constructor(options: VoteNotifierOptions);

        start(): void;
        stop(): void;

        apiRequest(endpoint: string, params?: Record<string, any>): Promise<any>;

        checkVotes(): Promise<void>;

        getAllVotes(): Promise<Vote[]>;

        hasUserVoted(userID: string): Promise<HasUserVotedResult>;

        getBotInfo(): Promise<BotInfo>;

        isCertified(): Promise<boolean>;

        getTopVotes(): Promise<Vote[]>;

        updateConfig(newConfig: Partial<VoteNotifierOptions>): void;

        on(event: 'vote', listener: (vote: Vote) => void): this;

        on(event: 'error', listener: (error: Error) => void): this;
    }
}
