Add FiltersOption type and make some types optional (#290)

This commit is contained in:
hands8142 2021-02-26 07:40:45 +09:00 committed by GitHub
parent 2a57842ccd
commit 031f7566e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
typings/index.d.ts vendored
View file

@ -30,8 +30,8 @@ declare module 'discord-player' {
public static get AudioFilters(): PlayerFilters;
public isPlaying(message: Message): boolean;
public setFilters(message: Message, newFilters: Partial<Filters>): Promise<void>;
public play(message: Message, query: string | Track, firstResult?: boolean): Promise<void>;
public setFilters(message: Message, newFilters: Partial<FiltersOption>): Promise<void>;
public play(message: Message, query: string | Track, firstResult?: boolean, isAttachment?: boolean): Promise<void>;
public pause(message: Message): void;
public resume(message: Message): void;
public stop(message: Message): void;
@ -45,7 +45,7 @@ declare module 'discord-player' {
public setLoopMode(message: Message, enabled: boolean): boolean
public shuffle(message: Message): Queue;
public remove(message: Message, trackOrPosition: Track | number): Track;
public createProgressBar(message: Message, progressBarOptions: ProgressBarOptions): string;
public createProgressBar(message: Message, progressBarOptions?: ProgressBarOptions): string;
public seek(message: Message, time: number): Promise<void>;
public moveTo(message: Message, channel: VoiceChannel): void;
@ -98,12 +98,15 @@ declare module 'discord-player' {
type FiltersStatuses = {
[key in Filters]: boolean;
}
type FiltersOption = {
[key in Filters]: boolean;
}
type PlayerFilters = {
[key in Filters]: string
}
interface ProgressBarOptions {
timecodes: boolean;
queue: boolean;
timecodes?: boolean;
queue?: boolean;
}
interface CustomPlaylist {
tracks: Track[];