fromType<T extends ApiResult> static method
Implementation
static ResultType fromType<T extends ApiResult>() => switch (T) {
YoutubeVideo => video,
YoutubeChannel => channel,
YoutubePlaylist => playlist,
_ => throw Exception('Invalid type.'),
};