Files
tmdb-ts/src/endpoints/trending.ts
2024-02-23 11:36:05 +02:00

26 lines
567 B
TypeScript

import {
TrendingMediaType,
TimeWindow,
TrendingResults,
LanguageOption,
PageOption,
} from '../types';
import { BaseEndpoint } from './base';
export class TrendingEndpoint extends BaseEndpoint {
constructor(accessToken: string) {
super(accessToken);
}
async trending<T extends TrendingMediaType>(
mediaType: T,
timeWindow: TimeWindow,
options?: LanguageOption & PageOption
): Promise<TrendingResults<T>> {
return await this.api.get<TrendingResults<T>>(
`/trending/${mediaType}/${timeWindow}`,
options
);
}
}