@thi.ng/imgui
Version:
Immediate mode GUI with flexible state handling & data only shape output
78 lines • 1.85 kB
TypeScript
import type { Predicate } from "@thi.ng/api";
import type { IGridLayout, LayoutBox } from "@thi.ng/layout";
import type { IMGUI } from "./gui.js";
export type Color = string | number | number[];
export type Hash = number;
export interface GUITheme {
globalBg?: Color;
font?: string;
fontSize: number;
charWidth: number;
baseLine: number;
pad: number;
focus: Color;
cursor: Color;
cursorBlink: number;
bg: Color;
bgDisabled: Color;
bgHover: Color;
fg: Color;
fgDisabled: Color;
fgHover: Color;
text: Color;
textDisabled: Color;
textHover: Color;
bgTooltip: Color;
textTooltip: Color;
}
export interface IMGUIOpts {
theme?: Partial<GUITheme>;
}
export interface ComponentOpts {
id: string;
gui: IMGUI;
layout: IGridLayout<any> | LayoutBox;
label?: string;
info?: string;
}
export declare enum MouseButton {
LEFT = 1,
RIGHT = 2,
MIDDLE = 4
}
export declare enum KeyModifier {
SHIFT = 1,
CONTROL = 2,
META = 4,
ALT = 8
}
export declare enum Key {
ALT = "Alt",
BACKSPACE = "Backspace",
CAPSLOCK = "CapsLock",
CONTEXT_MENU = "ContextMenu",
CONTROL = "Control",
DELETE = "Delete",
DOWN = "ArrowDown",
END = "End",
ENTER = "Enter",
ESC = "Escape",
HELP = "Help",
HOME = "Home",
LEFT = "ArrowLeft",
META = "Meta",
NUM_LOCK = "NumLock",
PAGE_DOWN = "PageDown",
PAGE_UP = "PageUp",
RIGHT = "ArrowRight",
SHIFT = "Shift",
SPACE = " ",
TAB = "Tab",
UP = "ArrowUp"
}
export declare const CONTROL_KEYS: Set<string>;
export declare const NONE = "__NONE__";
export declare const DEFAULT_THEME: GUITheme;
export declare const INPUT_ALPHA: Predicate<string>;
export declare const INPUT_DIGITS: Predicate<string>;
//# sourceMappingURL=api.d.ts.map