Files
element-call/src/state/TileViewModel.ts
T

30 lines
777 B
TypeScript
Raw Normal View History

2024-11-06 04:36:48 -05:00
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
2024-11-06 04:36:48 -05:00
Please see LICENSE in the repository root for full details.
*/
import { type MediaViewModel, type UserMediaViewModel } from "./MediaViewModel";
import { type Behavior } from "./Behavior";
2024-11-06 04:36:48 -05:00
let nextId = 0;
function createId(): string {
return (nextId++).toString();
}
export class GridTileViewModel {
2024-11-06 04:36:48 -05:00
public readonly id = createId();
public constructor(public readonly media$: Behavior<UserMediaViewModel>) {}
2024-11-06 04:36:48 -05:00
}
export class SpotlightTileViewModel {
2024-11-06 04:36:48 -05:00
public constructor(
public readonly media$: Behavior<MediaViewModel[]>,
public readonly maximised$: Behavior<boolean>,
) {}
2024-11-06 04:36:48 -05:00
}
export type TileViewModel = GridTileViewModel | SpotlightTileViewModel;