/// import { Collection } from '@discordjs/collection'; import EventEmitter from 'events'; import { Base } from '../structures/Base'; import { Client } from '../structures/Client'; /** * The collector of a data model. * @example new Collector(client); */ export declare class Collector> extends EventEmitter { readonly client: Client; readonly options: CollectorOptions; /** The collected data. */ readonly collected: Collection; /** The date the collector was created. */ readonly createdAt: Date; /** The date the collector was ended. */ endedAt?: Date; /** The idle timeout for the collector. */ private idleTimeout?; /** * @param client The client the collector belongs to. * @param options The options of the collector. */ constructor(client: Client, options?: CollectorOptions); /** The timestamp the collector was created. */ get createdTimestamp(): number; /** Whether the collector has ended. */ get isEnded(): boolean; /** The timestamp the collector was ended. */ get endedTimestamp(): number | undefined; /** The time the collector has been running. */ get uptime(): number; /** * End the collector. * @example collector.end(); */ end(): void; /** * Collect a item. * @param item The item to collect. * @returns The collected item. * @example collector.collect(item); */ collect(item: Model): Promise; /** * Dispose a collected item. * @param itemId The ID of the item to dispose. * @returns The disposed item. * @example collector.dispose('abc'); */ dispose(itemId: Model['id']): Model | undefined; } export interface Collector> { /** @ignore */ on>(event: Event, listener: (...args: CollectorEvents[Event]) => any): this; /** @ignore */ once>(event: Event, listener: (...args: CollectorEvents[Event]) => any): this; /** @ignore */ off>(event: Event, listener: (...args: CollectorEvents[Event]) => any): this; emit>(event: Event, ...args: CollectorEvents[Event]): boolean; } /** The collector events. */ export interface CollectorEvents> { /** Emitted when data is collected. */ collect: [item: Model]; /** Emitted when a collected item is disposed. */ dispose: [item: Model]; /** Emitted when the collector is finished collecting data. */ end: [collected: Collection]; } /** The options for the collector. */ export interface CollectorOptions> { /** The filter to apply to the collector. */ filter?: CollectorFilter; /** The time in milliseconds to wait before ending the collector. */ time?: number; /** The time in milliseconds to wait before ending the collector due to it being idle. */ idle?: number; /** The max amount of items to collect. */ max?: number; /** Whether to dispose data when it is deleted. */ dispose?: boolean; } /** The filter to apply to the collector. */ export declare type CollectorFilter = (item: Model) => boolean | Promise; //# sourceMappingURL=Collector.d.ts.map