UNPKG

@djs-nest/core

Version:

Djs Nest Core Module provides functionality for handling discord events

55 lines (44 loc) 2.54 kB
import * as _nestjs_common from '@nestjs/common'; import { Provider, OnApplicationBootstrap, OnApplicationShutdown, OnModuleInit, DynamicModule } from '@nestjs/common'; import { ManagerShardEventsMap, MappedEvents, GatewayIntentBits } from '@discordjs/core'; import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter'; import * as _djs_nest_common from '@djs-nest/common'; import { EventMeta, ExplorerService, EventsDiscovery, AsyncModuleConfig } from '@djs-nest/common'; import { REST } from '@discordjs/rest'; import { WebSocketManager, OptionalWebSocketManagerOptions } from '@discordjs/ws'; import { DjsRestModuleOptions } from '@djs-nest/rest'; declare class DjsClient extends AsyncEventEmitter<ManagerShardEventsMap> { } declare const DjsClientProvider: Provider<DjsClient>; declare const Listener: (options: EventMeta) => _nestjs_common.CustomDecorator<string>; declare const On: <K extends keyof MappedEvents>(event: K) => _nestjs_common.CustomDecorator<string>; declare const Once: <K extends keyof MappedEvents>(event: K) => _nestjs_common.CustomDecorator<string>; declare class DjsService implements OnApplicationBootstrap, OnApplicationShutdown { private ws; private readonly logger; private readonly _client; constructor(rest: REST, ws: WebSocketManager); get client(): DjsClient; onApplicationBootstrap(): Promise<void>; onApplicationShutdown(): void; } declare class EventsService implements OnModuleInit { private readonly djsService; private readonly explorerService; private readonly logger; constructor(djsService: DjsService, explorerService: ExplorerService<EventsDiscovery>); onModuleInit(): void; } interface DjsCoreModuleOptions extends DjsRestModuleOptions { token: string; intents: GatewayIntentBits; ws?: Partial<OptionalWebSocketManagerOptions>; } declare const DjsCoreModule_base: _djs_nest_common.IConfigurableDynamicRootModule<unknown>; declare class DjsCoreModule extends DjsCoreModule_base { static forRootAsync(asyncModuleConfig: AsyncModuleConfig<DjsCoreModuleOptions>): DynamicModule; static forRoot(moduleConfig: DjsCoreModuleOptions): DynamicModule; static forExistingRestAsync(asyncModuleConfig: AsyncModuleConfig<Exclude<DjsCoreModuleOptions, 'rest'>>): DynamicModule; static forExistingRest(moduleConfig: Exclude<DjsCoreModuleOptions, 'rest'>): DynamicModule; } export { DjsClient, DjsClientProvider, DjsCoreModule, DjsCoreModuleOptions, EventsService, Listener, On, Once };