getting decent logic and types and stuff for resizing and windows

This commit is contained in:
talksik
2022-05-02 07:48:03 -05:00
parent 77f54dd609
commit a97748d83d
7 changed files with 159 additions and 76 deletions
+19 -17
View File
@@ -13,25 +13,27 @@ export enum STORE_ITEMS {
AUTH_SESSION_JWT = "AUTH_SESSION_JWT",
}
export type Dimensions = {
height: number;
width: number;
export type Dimensions = { height: number; width: number };
export interface DimensionChangeRequest {
setAlwaysOnTop: boolean;
dimensions: Dimensions;
addDimensions: boolean;
}
export const TERMINAL_PRESET: Dimensions = {
height: 675,
width: 400,
};
export const DimensionPresets = {
terminal: {
height: 675,
width: 400,
},
terminalAndDetails: {
height: 675,
width: 800,
},
// todo: typically just send whatever dimensions are needed
overlayOnlyMode: {
height: 800,
width: 325,
},
export const TERMINAL_DETAILS_PRESET: Dimensions = {
height: 675,
width: 800,
};
export const OVERLAY_ONLY_INITIAL_PRESET: Dimensions = {
height: 50,
width: 325,
};
export default Channels;
+2 -1
View File
@@ -1,3 +1,4 @@
import { Dimensions, DimensionChangeRequest } from "./constants";
import { electronAPI } from "./preload";
export {};
@@ -12,7 +13,7 @@ declare global {
set(property: STORE_ITEMS, val: any): void;
};
window: {
resizeWindow(newDimensions: { width: number; height: number }): void;
resizeWindow(dimensionChangeRequest: DimensionChangeRequest): void;
};
on(channel: Channels, func: any): void;
once(channel: Channels, func: any): void;