mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
typings: fix lint script and linter errors
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
"docs:test": "docgen --source src --custom docs/index.yml",
|
"docs:test": "docgen --source src --custom docs/index.yml",
|
||||||
"lint": "eslint src",
|
"lint": "eslint src",
|
||||||
"lint:fix": "eslint --fix src",
|
"lint:fix": "eslint --fix src",
|
||||||
"lint:typings": "tslint index.d.ts discord.js-test.ts",
|
"lint:typings": "tslint typings/index.d.ts typings/discord.js-test.ts",
|
||||||
"webpack": "parallel-webpack"
|
"webpack": "parallel-webpack"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -8,6 +8,6 @@
|
|||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"index.d.ts"
|
"typings/index.d.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ client.login('dsfsd754.4fds4f68d4f6sd46f4s.7878easfdsgdfFDSIJIO');
|
|||||||
|
|
||||||
export class TestCollector extends Collector<Snowflake, Message> {
|
export class TestCollector extends Collector<Snowflake, Message> {
|
||||||
public filter: CollectorFilter;
|
public filter: CollectorFilter;
|
||||||
public constructor(client: Client, filter: CollectorFilter, ) {
|
public constructor(client: Client, filter: CollectorFilter) {
|
||||||
super(client, filter);
|
super(client, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +64,6 @@ class ReactionCollector extends Collector<Snowflake, MessageReaction> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public cleanup(): void {
|
public cleanup(): void {
|
||||||
this.client.removeListener('messageReactionAdd', this.listener);
|
this.client.removeListener('messageReactionAdd', this.listener as any);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
78
typings/index.d.ts
vendored
78
typings/index.d.ts
vendored
@@ -243,7 +243,7 @@ declare module 'discord.js' {
|
|||||||
public premium: boolean;
|
public premium: boolean;
|
||||||
public settings: ClientUserSettings;
|
public settings: ClientUserSettings;
|
||||||
public verified: boolean;
|
public verified: boolean;
|
||||||
public acceptInvite(invite: Invite | string): Promise<Guild>
|
public acceptInvite(invite: Invite | string): Promise<Guild>;
|
||||||
public addFriend(user?: UserResolvable): Promise<User>;
|
public addFriend(user?: UserResolvable): Promise<User>;
|
||||||
public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise<GroupDMChannel>;
|
public createGroupDM(recipients: GroupDMRecipientOptions[]): Promise<GroupDMChannel>;
|
||||||
public createGuild(name: string, region: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
|
public createGuild(name: string, region: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
|
||||||
@@ -462,7 +462,7 @@ declare module 'discord.js' {
|
|||||||
public readonly owner: User;
|
public readonly owner: User;
|
||||||
public ownerID: string;
|
public ownerID: string;
|
||||||
public recipients: Collection<Snowflake, User>;
|
public recipients: Collection<Snowflake, User>;
|
||||||
public addUser(accessTokenOrID: UserResolvable | string, nick?: string): Promise<GroupDMChannel>
|
public addUser(accessTokenOrID: UserResolvable | string, nick?: string): Promise<GroupDMChannel>;
|
||||||
public equals(channel: GroupDMChannel): boolean;
|
public equals(channel: GroupDMChannel): boolean;
|
||||||
public setIcon(icon: Base64Resolvable | BufferResolvable): Promise<GroupDMChannel>;
|
public setIcon(icon: Base64Resolvable | BufferResolvable): Promise<GroupDMChannel>;
|
||||||
public toString(): string;
|
public toString(): string;
|
||||||
@@ -471,7 +471,7 @@ declare module 'discord.js' {
|
|||||||
export class Guild {
|
export class Guild {
|
||||||
constructor(client: Client, data: object);
|
constructor(client: Client, data: object);
|
||||||
private readonly _sortedRoles: Collection<Snowflake, Role>;
|
private readonly _sortedRoles: Collection<Snowflake, Role>;
|
||||||
private _sortedChannels(type: string): Collection<Snowflake, GuildChannel>
|
private _sortedChannels(type: string): Collection<Snowflake, GuildChannel>;
|
||||||
private _sortPositionWithID(collection: Collection<any, any>): Collection<any, any>;
|
private _sortPositionWithID(collection: Collection<any, any>): Collection<any, any>;
|
||||||
|
|
||||||
protected setup(data: any): void;
|
protected setup(data: any): void;
|
||||||
@@ -608,7 +608,7 @@ declare module 'discord.js' {
|
|||||||
public position: number;
|
public position: number;
|
||||||
public clone(name?: string, withPermissions?: boolean, withTopic?: boolean, reason?: string): Promise<GuildChannel>;
|
public clone(name?: string, withPermissions?: boolean, withTopic?: boolean, reason?: string): Promise<GuildChannel>;
|
||||||
public createInvite(options?: InviteOptions, reason?: string): Promise<Invite>;
|
public createInvite(options?: InviteOptions, reason?: string): Promise<Invite>;
|
||||||
public delete(reason?: string): Promise<GuildChannel>
|
public delete(reason?: string): Promise<GuildChannel>;
|
||||||
public edit(data: ChannelData, reason?: string): Promise<GuildChannel>;
|
public edit(data: ChannelData, reason?: string): Promise<GuildChannel>;
|
||||||
public equals(channel: GuildChannel): boolean;
|
public equals(channel: GuildChannel): boolean;
|
||||||
public fetchInvites(): Promise<Collection<string, Invite>>;
|
public fetchInvites(): Promise<Collection<string, Invite>>;
|
||||||
@@ -619,7 +619,7 @@ declare module 'discord.js' {
|
|||||||
public replacePermissionOverwrites(options?: { overwrites?: (PermissionOverwrites | ChannelCreationOverwrites)[] | Collection<Snowflake, ChannelCreationOverwrites>, reason?: string }): Promise<GuildChannel>;
|
public replacePermissionOverwrites(options?: { overwrites?: (PermissionOverwrites | ChannelCreationOverwrites)[] | Collection<Snowflake, ChannelCreationOverwrites>, reason?: string }): Promise<GuildChannel>;
|
||||||
public rolePermissions(role: RoleResolvable): Permissions;
|
public rolePermissions(role: RoleResolvable): Permissions;
|
||||||
public setName(name: string, reason?: string): Promise<GuildChannel>;
|
public setName(name: string, reason?: string): Promise<GuildChannel>;
|
||||||
public setParent(parent: ChannelResolvable, reason?: string): Promise<GuildChannel>
|
public setParent(parent: ChannelResolvable, reason?: string): Promise<GuildChannel>;
|
||||||
public setPosition(position: number, relative?: boolean): Promise<GuildChannel>;
|
public setPosition(position: number, relative?: boolean): Promise<GuildChannel>;
|
||||||
public setTopic(topic: string, reason?: string): Promise<GuildChannel>;
|
public setTopic(topic: string, reason?: string): Promise<GuildChannel>;
|
||||||
public toString(): string;
|
public toString(): string;
|
||||||
@@ -945,14 +945,14 @@ declare module 'discord.js' {
|
|||||||
|
|
||||||
public bitfield: number;
|
public bitfield: number;
|
||||||
public member: GuildMember;
|
public member: GuildMember;
|
||||||
public add(...permissions: PermissionResolvable): this;
|
public add(...permissions: PermissionResolvable[]): this;
|
||||||
public freeze(): this;
|
public freeze(): this;
|
||||||
public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
public has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
||||||
public hasPermission(permission: PermissionResolvable, explicit?: boolean): boolean;
|
public hasPermission(permission: PermissionResolvable, explicit?: boolean): boolean;
|
||||||
public hasPermissions(permissions: PermissionResolvable, explicit?: boolean): boolean;
|
public hasPermissions(permissions: PermissionResolvable, explicit?: boolean): boolean;
|
||||||
public missing(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
|
public missing(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
|
||||||
public missingPermissions(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
|
public missingPermissions(permissions: PermissionResolvable, checkAdmin?: boolean): PermissionResolvable;
|
||||||
public remove(...permissions: PermissionResolvable): this;
|
public remove(...permissions: PermissionResolvable[]): this;
|
||||||
public serialize(checkAdmin?: boolean): PermissionObject;
|
public serialize(checkAdmin?: boolean): PermissionObject;
|
||||||
public toArray(checkAdmin?: boolean): PermissionString[];
|
public toArray(checkAdmin?: boolean): PermissionString[];
|
||||||
public valueOf(): number;
|
public valueOf(): number;
|
||||||
@@ -1583,7 +1583,7 @@ declare module 'discord.js' {
|
|||||||
roles?: Collection<string, Role> | Role[] | string[];
|
roles?: Collection<string, Role> | Role[] | string[];
|
||||||
mute?: boolean;
|
mute?: boolean;
|
||||||
deaf?: boolean;
|
deaf?: boolean;
|
||||||
}
|
};
|
||||||
|
|
||||||
type AuditLogChange = {
|
type AuditLogChange = {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -1698,7 +1698,7 @@ declare module 'discord.js' {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type DefaultMessageNotifications = 'ALL'
|
type DefaultMessageNotifications = 'ALL'
|
||||||
| 'MENTIONS'
|
| 'MENTIONS';
|
||||||
|
|
||||||
type EmojiEditData = {
|
type EmojiEditData = {
|
||||||
name?: string;
|
name?: string;
|
||||||
@@ -1721,33 +1721,33 @@ declare module 'discord.js' {
|
|||||||
type GuildAuditLogsAction = keyof GuildAuditLogsActions;
|
type GuildAuditLogsAction = keyof GuildAuditLogsActions;
|
||||||
|
|
||||||
type GuildAuditLogsActions = {
|
type GuildAuditLogsActions = {
|
||||||
ALL?: null,
|
ALL?: null;
|
||||||
GUILD_UPDATE?: number,
|
GUILD_UPDATE?: number;
|
||||||
CHANNEL_CREATE?: number,
|
CHANNEL_CREATE?: number;
|
||||||
CHANNEL_UPDATE?: number,
|
CHANNEL_UPDATE?: number;
|
||||||
CHANNEL_DELETE?: number,
|
CHANNEL_DELETE?: number;
|
||||||
CHANNEL_OVERWRITE_CREATE?: number,
|
CHANNEL_OVERWRITE_CREATE?: number;
|
||||||
CHANNEL_OVERWRITE_UPDATE?: number,
|
CHANNEL_OVERWRITE_UPDATE?: number;
|
||||||
CHANNEL_OVERWRITE_DELETE?: number,
|
CHANNEL_OVERWRITE_DELETE?: number;
|
||||||
MEMBER_KICK?: number,
|
MEMBER_KICK?: number;
|
||||||
MEMBER_PRUNE?: number,
|
MEMBER_PRUNE?: number;
|
||||||
MEMBER_BAN_ADD?: number,
|
MEMBER_BAN_ADD?: number;
|
||||||
MEMBER_BAN_REMOVE?: number,
|
MEMBER_BAN_REMOVE?: number;
|
||||||
MEMBER_UPDATE?: number,
|
MEMBER_UPDATE?: number;
|
||||||
MEMBER_ROLE_UPDATE?: number,
|
MEMBER_ROLE_UPDATE?: number;
|
||||||
ROLE_CREATE?: number,
|
ROLE_CREATE?: number;
|
||||||
ROLE_UPDATE?: number,
|
ROLE_UPDATE?: number;
|
||||||
ROLE_DELETE?: number,
|
ROLE_DELETE?: number;
|
||||||
INVITE_CREATE?: number,
|
INVITE_CREATE?: number;
|
||||||
INVITE_UPDATE?: number,
|
INVITE_UPDATE?: number;
|
||||||
INVITE_DELETE?: number,
|
INVITE_DELETE?: number;
|
||||||
WEBHOOK_CREATE?: number,
|
WEBHOOK_CREATE?: number;
|
||||||
WEBHOOK_UPDATE?: number,
|
WEBHOOK_UPDATE?: number;
|
||||||
WEBHOOK_DELETE?: number,
|
WEBHOOK_DELETE?: number;
|
||||||
EMOJI_CREATE?: number,
|
EMOJI_CREATE?: number;
|
||||||
EMOJI_UPDATE?: number,
|
EMOJI_UPDATE?: number;
|
||||||
EMOJI_DELETE?: number,
|
EMOJI_DELETE?: number;
|
||||||
MESSAGE_DELETE?: number,
|
MESSAGE_DELETE?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type GuildAuditLogsActionType = 'CREATE'
|
type GuildAuditLogsActionType = 'CREATE'
|
||||||
@@ -1896,7 +1896,7 @@ declare module 'discord.js' {
|
|||||||
type MessageSearchResult = {
|
type MessageSearchResult = {
|
||||||
totalResults: number;
|
totalResults: number;
|
||||||
messages: Message[][];
|
messages: Message[][];
|
||||||
}
|
};
|
||||||
|
|
||||||
type ActivityFlags = {
|
type ActivityFlags = {
|
||||||
INSTANCE?: number;
|
INSTANCE?: number;
|
||||||
@@ -1905,7 +1905,7 @@ declare module 'discord.js' {
|
|||||||
JOIN_REQUEST?: number;
|
JOIN_REQUEST?: number;
|
||||||
SYNC?: number;
|
SYNC?: number;
|
||||||
PLAY?: number;
|
PLAY?: number;
|
||||||
}
|
};
|
||||||
|
|
||||||
type PermissionFlags = {
|
type PermissionFlags = {
|
||||||
ADMINISTRATOR?: number;
|
ADMINISTRATOR?: number;
|
||||||
@@ -2024,7 +2024,7 @@ declare module 'discord.js' {
|
|||||||
url?: string;
|
url?: string;
|
||||||
type?: ActivityType;
|
type?: ActivityType;
|
||||||
} | null;
|
} | null;
|
||||||
}
|
};
|
||||||
|
|
||||||
type PresenceStatus = 'online' | 'idle' | 'invisible' | 'dnd';
|
type PresenceStatus = 'online' | 'idle' | 'invisible' | 'dnd';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user