added trending endpoint and types
This commit is contained in:
@@ -12,4 +12,5 @@ export * from './tv-shows';
|
||||
export * from './discover';
|
||||
export * from './people';
|
||||
export * from './review';
|
||||
export * from './trending';
|
||||
|
||||
|
||||
14
src/endpoints/trending.ts
Normal file
14
src/endpoints/trending.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { MediaType, TimeWindow, TrendingResults, } from '../types';
|
||||
import { BaseEndpoint } from './base';
|
||||
|
||||
export class TrendingEndpoint extends BaseEndpoint {
|
||||
constructor(accessToken: string) {
|
||||
super(accessToken);
|
||||
}
|
||||
|
||||
async trending<T extends MediaType>(mediaType : T, timeWindow: TimeWindow): Promise<TrendingResults<T>> {
|
||||
return await this.api.get<TrendingResults<T>>(`/trending/${mediaType}/${timeWindow}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user