Types Improved

This commit is contained in:
killer069
2021-09-27 22:20:50 +05:30
parent 842d704bf2
commit 70d1774508
12 changed files with 104 additions and 131 deletions

View File

@@ -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 || '';
}