feat(jsdoc): done

This commit is contained in:
DjDeveloperr 2020-12-03 10:12:26 +05:30
parent db01e3eec1
commit caac5fc97e
3 changed files with 13 additions and 3 deletions

1
mod.ts
View file

@ -16,6 +16,7 @@ export { ChannelsManager } from './src/managers/channels.ts'
export { EmojisManager } from './src/managers/emojis.ts' export { EmojisManager } from './src/managers/emojis.ts'
export { GatewayCache } from './src/managers/gatewayCache.ts' export { GatewayCache } from './src/managers/gatewayCache.ts'
export { GuildChannelsManager } from './src/managers/guildChannels.ts' export { GuildChannelsManager } from './src/managers/guildChannels.ts'
export type { GuildChannel } from './src/managers/guildChannels.ts'
export { GuildManager } from './src/managers/guilds.ts' export { GuildManager } from './src/managers/guilds.ts'
export { GuildEmojisManager } from './src/managers/guildEmojis.ts' export { GuildEmojisManager } from './src/managers/guildEmojis.ts'
export { MembersManager } from './src/managers/members.ts' export { MembersManager } from './src/managers/members.ts'

View file

@ -36,7 +36,7 @@ export interface ClientOptions {
fetchUncachedReactions?: boolean fetchUncachedReactions?: boolean
} }
export declare interface Client { export interface ClientEventsEmitter {
on: <U extends string>(event: U, listener: ClientEvents[U]) => this on: <U extends string>(event: U, listener: ClientEvents[U]) => this
emit: <U extends string>( emit: <U extends string>(
@ -84,6 +84,15 @@ export class Client extends EventEmitter {
/** Client's presence. Startup one if set before connecting */ /** Client's presence. Startup one if set before connecting */
presence: ClientPresence = new ClientPresence() presence: ClientPresence = new ClientPresence()
private _untypedOn = this.on
private _untypedEmit = this.emit
public on = <K extends string>(event: K, listener: ClientEvents[K]): this =>
this._untypedOn(event, listener)
public emit = <K extends string>(
event: K,
...args: Parameters<ClientEvents[K]>
): boolean => this._untypedEmit(event, ...args)
constructor(options: ClientOptions = {}) { constructor(options: ClientOptions = {}) {
super() super()
this.token = options.token this.token = options.token

View file

@ -2,9 +2,9 @@ import {
Command, Command,
CommandClient, CommandClient,
Intents, Intents,
GuildChannel,
CommandContext, CommandContext,
Extension Extension,
GuildChannel
} from '../../mod.ts' } from '../../mod.ts'
import { Invite } from '../structures/invite.ts' import { Invite } from '../structures/invite.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'