starchild-widget
Version:
Starchild Widget
50 lines • 1.26 kB
TypeScript
/**
* Common base type definitions
* Contains basic types and enums used throughout the application
*/
export interface Position {
x: number;
y: number;
}
export interface Size {
width: number;
height: number;
}
export interface SizeConstraints {
minWidth: number;
minHeight: number;
maxWidth: number;
maxHeight: number;
}
export interface Rect extends Position, Size {
}
export declare enum Locale {
EN_US = "en-US",
ZH_CN = "zh-CN"
}
export declare enum ThemeMode {
LIGHT = "light",
DARK = "dark"
}
export type EventCallback<T = void> = (data: T) => void;
export type ErrorCallback = EventCallback<Error>;
export type PositionCallback = EventCallback<Position>;
export type VoidCallback = () => void;
export type DockEdgeCallback = (edge: 'left' | 'right') => void;
export type ChatModalDetachFromEdgeCallback = VoidCallback;
export interface BaseConfig {
className?: string;
style?: React.CSSProperties;
disabled?: boolean;
}
export declare enum LoadingState {
IDLE = "idle",
LOADING = "loading",
SUCCESS = "success",
ERROR = "error"
}
export interface AppError extends Error {
code?: string | number;
context?: Record<string, any>;
}
//# sourceMappingURL=index.d.ts.map