feat: add multi-search, adjust types to allow type narrowing

This commit is contained in:
Alexander B
2023-04-28 20:26:34 +06:00
parent e5ce15d58d
commit da6427807f
6 changed files with 53 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import { MediaType, TimeWindow, TrendingResults } from '../types';
import { TrendingMediaType, TimeWindow, TrendingResults } from '../types';
import { BaseEndpoint } from './base';
export class TrendingEndpoint extends BaseEndpoint {
@@ -6,7 +6,7 @@ export class TrendingEndpoint extends BaseEndpoint {
super(accessToken);
}
async trending<T extends MediaType>(
async trending<T extends TrendingMediaType>(
mediaType: T,
timeWindow: TimeWindow
): Promise<TrendingResults<T>> {