mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Types Improved
This commit is contained in:
@@ -4,17 +4,18 @@ export interface ChannelIconInterface {
|
||||
height: number;
|
||||
}
|
||||
|
||||
export class Channel {
|
||||
export class YouTubeChannel {
|
||||
name?: string;
|
||||
verified?: boolean;
|
||||
id?: string;
|
||||
type: 'video' | 'playlist' | 'channel';
|
||||
url?: string;
|
||||
icon?: ChannelIconInterface;
|
||||
subscribers?: string;
|
||||
|
||||
constructor(data: any) {
|
||||
if (!data) throw new Error(`Cannot instantiate the ${this.constructor.name} class without data!`);
|
||||
|
||||
this.type = 'channel';
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
@@ -41,10 +42,6 @@ export class Channel {
|
||||
return this.icon.url.replace(`=s${def}-c`, `=s${options.size}-c`);
|
||||
}
|
||||
|
||||
get type(): 'channel' {
|
||||
return 'channel';
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
return this.name || '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user