Skip to content

Commit

Permalink
Fix types for YouTube
Browse files Browse the repository at this point in the history
  • Loading branch information
timcole committed Sep 6, 2023
1 parent ae45174 commit 454f4f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/interfaces/matrix.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Data<Id, General, Statistics, Ranks> {

export interface Id {
id: string;
username: string;
username?: string;
}

export interface ExtendedId extends Id {
Expand All @@ -33,7 +33,7 @@ export interface SmallBranding {
}

export interface Branding extends SmallBranding {
banner: string;
banner?: string;
}

export interface UserGeneral<T = Branding> {
Expand Down
17 changes: 9 additions & 8 deletions lib/interfaces/youtube/shared.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { ExtendedId } from '../matrix.shared';

export interface YouTubeId extends ExtendedId {
cusername: string;
cusername?: string;
handle?: string;
}

export interface YouTubeGeneral {
created_at: Date;
channel_type: string;
geo: YouTubeGeo;
channel_type: string | null;
geo: YouTubeGeo | null;
}

export interface YouTubeGeo {
Expand All @@ -22,9 +23,9 @@ export interface YouTubeTotal {
}

export interface YouTubeRanks {
sbrank: number;
subscribers: number;
views: number;
country: number;
channel_type: number;
sbrank: number | null;
subscribers: number | null;
views: number | null;
country: number | null;
channel_type: number | null;
}
3 changes: 2 additions & 1 deletion lib/interfaces/youtube/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface YouTubeSocial {
instagram: string | null;
linkedin: string | null;
discord: string | null;
tiktok: string | null;
}

export interface YouTubeDaily extends Daily {
Expand All @@ -43,7 +44,7 @@ export interface YouTubeDaily extends Daily {

export interface YouTubeMisc extends Misc {
made_for_kids: boolean;
tags: string[];
tags?: string[];
}

export interface YouTubeGrowth {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socialblade",
"version": "1.0.5",
"version": "1.0.6",
"description": "Library for Social Blade's Official API in JavaScript (TypeScript)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 454f4f3

Please sign in to comment.