2023-06-02 15:55:08 +02:00
|
|
|
import type { AssetResponseDto } from '@api';
|
2022-09-04 15:34:39 +02:00
|
|
|
|
2023-06-08 17:22:45 +02:00
|
|
|
export enum BucketPosition {
|
|
|
|
Above = 'above',
|
|
|
|
Below = 'below',
|
|
|
|
Visible = 'visible',
|
|
|
|
Unknown = 'unknown'
|
|
|
|
}
|
|
|
|
|
2022-09-04 15:34:39 +02:00
|
|
|
export class AssetBucket {
|
|
|
|
/**
|
|
|
|
* The DOM height of the bucket in pixel
|
|
|
|
* This value is first estimated by the number of asset and later is corrected as the user scroll
|
|
|
|
*/
|
|
|
|
bucketHeight!: number;
|
|
|
|
bucketDate!: string;
|
|
|
|
assets!: AssetResponseDto[];
|
|
|
|
cancelToken!: AbortController;
|
2023-06-08 17:22:45 +02:00
|
|
|
position!: BucketPosition;
|
2022-09-04 15:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export class AssetGridState {
|
|
|
|
/**
|
|
|
|
* The total height of the timeline in pixel
|
|
|
|
* This value is first estimated by the number of asset and later is corrected as the user scroll
|
|
|
|
*/
|
2022-09-08 17:30:49 +02:00
|
|
|
timelineHeight = 0;
|
2022-09-04 15:34:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The fixed viewport height in pixel
|
|
|
|
*/
|
2022-09-08 17:30:49 +02:00
|
|
|
viewportHeight = 0;
|
2022-09-04 15:34:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The fixed viewport width in pixel
|
|
|
|
*/
|
2022-09-08 17:30:49 +02:00
|
|
|
viewportWidth = 0;
|
2022-09-04 15:34:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* List of bucket information
|
|
|
|
*/
|
|
|
|
buckets: AssetBucket[] = [];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Total assets that have been loaded
|
|
|
|
*/
|
|
|
|
assets: AssetResponseDto[] = [];
|
2023-05-15 19:30:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* User that owns assets
|
|
|
|
*/
|
|
|
|
userId: string | undefined;
|
2022-09-04 15:34:39 +02:00
|
|
|
}
|