neofunkin/src/types/wm.ts

43 lines
No EOL
1.7 KiB
TypeScript

export type wm_create_conf = {
w?: number; // Width
h?: number; // Height
x?: number; // X start pos
y?: number; // Y start pos
whp?: boolean; // is w and h in percentages
xyp?: boolean; // is x and y in percentages
noBorder?: boolean; // Hide OS window decorations
noBackground?: boolean; // Hide window background
onCreate?: Function; // wm.create(...)
onMinimize?: Function; // USER pressed '_'
onMaximize?: Function; // USER pressed '[]'
onRestore?: Function; // USER pressed '[]]'
onUnfocus?: Function; // USER unfocused on the window
onFocus?: Function; // USER focused on the window
onClose?: Function; // USER pressed 'x'
onDestroy?: Function; // USER pressed 'x' OR wm.destroy(...)
};
export type wm_move_conf = {
id: string; // ID of the window to perform everythin on
x?: number; // New X
y?: number; // New Y
p?: boolean; // Use percentages
fromCenter?: boolean; // Should be performed from the center of the window?
smooth?: boolean; // Should it be smooth?
ease?: Function; // Calculates the easing (lib/animations.ts)
duration?: number; // (ms) The total duration of the animation
tick?: number; // (ms) Delay between window movenments
}
export type wm_resize_conf = {
id: string; // ID of the window to perform everythin on
w?: number; // New width
h?: number; // New height
p?: boolean; // Use percentages
fromCenter?: boolean; // Should be performed from the center of the window?
smooth?: boolean; // Should it be smooth?
ease?: Function; // Calculates the easing (lib/animations.ts)
duration?: number; // (ms) The total duration of the animation
tick?: number; // (ms) Delay between window resizings
anchor?: string; // bottom, top, left, right
}