Files
test/src/types/state.d.ts
T
Kyle Geib df868f1126 ISSUE-025 - Partial failure. Realized that maybe the only way to get the dimensions of the loaded images is to measure them and include them with the file name definitions. To load an image at the center of the element would require writing information at the same time we read it. It's not a race condition; it's more like the chicken and the egg.
I'm sure, if I really wanted to, I could find a two step process of loading at 0 opacity, finding the dimensions, and then moving it to the center and revealing it. But I don't have the desire.

Still. I went ahead and added workspace properties to the central state and read from them when it makes sense.
2022-01-14 15:17:23 -05:00

44 lines
1009 B
TypeScript

export type RootState = {
pageDimensions: PageDimensions,
workspace: Workspace,
overlayTool: OverlayTool,
};
// Page Dimensions
export type PageDimensions = {
mainMenu: Dimensions,
app: Dimensions,
workspace: Dimensions,
};
export type Dimensions = { width: number, height: number };
// Workspace
export type Workspace = {
workspaceId: WorkspaceId,
animatedBG: boolean,
workspaceProperties: WorkspaceProperties,
};
export type WorkspaceId = string;
export type WorkspaceProperties = {
name: string,
overlayIds: OverlayIds,
previewWindowDimensions: Dimensions,
};
// Overlay Tool
export type OverlayTool = {
currentWorkspaceId: WorkspaceId,
overlayIds: OverlayIds,
currentOverlayId: OverlayId | null,
currentOverlayItem: OverlayItem | null,
visible: boolean,
};
export type OverlayId = string;
export type OverlayIds = Array<OverlayId>;
export type OverlayPosition = { x: number, y: number };
export type OverlayItem = {
position: OverlayPosition,
opacity: number,
};