2024-11-06 04:36:48 -05:00
|
|
|
/*
|
|
|
|
|
Copyright 2024 New Vector Ltd.
|
|
|
|
|
|
2025-02-18 17:59:58 +00:00
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-12-11 09:27:55 +00:00
|
|
|
import { type MediaViewModel, type UserMediaViewModel } from "./MediaViewModel";
|
2025-06-18 18:33:35 -04:00
|
|
|
import { type Behavior } from "./Behavior";
|
2024-11-06 04:36:48 -05:00
|
|
|
|
|
|
|
|
let nextId = 0;
|
|
|
|
|
function createId(): string {
|
|
|
|
|
return (nextId++).toString();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 13:57:08 -04:00
|
|
|
export class GridTileViewModel {
|
2024-11-06 04:36:48 -05:00
|
|
|
public readonly id = createId();
|
|
|
|
|
|
2025-10-16 13:57:08 -04:00
|
|
|
public constructor(public readonly media$: Behavior<UserMediaViewModel>) {}
|
2024-11-06 04:36:48 -05:00
|
|
|
}
|
|
|
|
|
|
2025-10-16 13:57:08 -04:00
|
|
|
export class SpotlightTileViewModel {
|
2024-11-06 04:36:48 -05:00
|
|
|
public constructor(
|
2025-06-18 18:33:35 -04:00
|
|
|
public readonly media$: Behavior<MediaViewModel[]>,
|
|
|
|
|
public readonly maximised$: Behavior<boolean>,
|
2025-10-16 13:57:08 -04:00
|
|
|
) {}
|
2024-11-06 04:36:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type TileViewModel = GridTileViewModel | SpotlightTileViewModel;
|