mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 17:11:17 +00:00
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
|
|
import { TflSource, type ITflApi } from "@aris/source-tfl"
|
||
|
|
|
||
|
|
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
||
|
|
|
||
|
|
export type TflSourceProviderOptions =
|
||
|
|
| { apiKey: string; client?: never }
|
||
|
|
| { apiKey?: never; client: ITflApi }
|
||
|
|
|
||
|
|
export class TflSourceProvider implements FeedSourceProvider {
|
||
|
|
private readonly options: TflSourceProviderOptions
|
||
|
|
|
||
|
|
constructor(options: TflSourceProviderOptions) {
|
||
|
|
this.options = options
|
||
|
|
}
|
||
|
|
|
||
|
|
feedSourceForUser(_userId: string): TflSource {
|
||
|
|
return new TflSource(this.options)
|
||
|
|
}
|
||
|
|
}
|