mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 01:56:16 -08:00
Update channel.model to import Channel from the local interface file
instead of the package namespace. This fixes an incorrect module
resolution and keeps the codebase consistent with local typings.
Add a new SidebarView union type ('CHANNELS' | 'PLAYLISTS') to expose
possible sidebar view options for consumers of the shared interfaces.
21 lines
550 B
TypeScript
Executable File
21 lines
550 B
TypeScript
Executable File
import { Channel } from './channel.interface';
|
|
|
|
/**
|
|
* Creates new channel object based on the given fields
|
|
* @param params partial channel object
|
|
*/
|
|
export function createChannel(params: Partial<Channel>): Channel {
|
|
return {
|
|
id: params?.id || params.url,
|
|
name: params.name,
|
|
group: params.group,
|
|
url: params.url,
|
|
tvg: params.tvg,
|
|
timeshift: params.timeshift,
|
|
http: params.http,
|
|
} as Channel;
|
|
}
|
|
|
|
/** Possible sidebar view options */
|
|
export type SidebarView = 'CHANNELS' | 'PLAYLISTS';
|