UNPKG

1.5 kBTypeScriptView Raw
1import { IWidget } from './widget';
2/**
3 * A widget that contains other widgets in a horizontal row
4 *
5 * Widgets will be laid out next to each other
6 */
7export declare class Row implements IWidget {
8 readonly width: number;
9 readonly height: number;
10 /**
11 * List of contained widgets
12 */
13 readonly widgets: IWidget[];
14 /**
15 * Relative position of each widget inside this row
16 */
17 private readonly offsets;
18 constructor(...widgets: IWidget[]);
19 position(x: number, y: number): void;
20 toJson(): any[];
21}
22/**
23 * A widget that contains other widgets in a vertical column
24 *
25 * Widgets will be laid out next to each other
26 */
27export declare class Column implements IWidget {
28 readonly width: number;
29 readonly height: number;
30 /**
31 * List of contained widgets
32 */
33 readonly widgets: IWidget[];
34 constructor(...widgets: IWidget[]);
35 position(x: number, y: number): void;
36 toJson(): any[];
37}
38/**
39 * Props of the spacer
40 */
41export interface SpacerProps {
42 /**
43 * Width of the spacer
44 *
45 * @default 1
46 */
47 readonly width?: number;
48 /**
49 * Height of the spacer
50 *
51 * @default: 1
52 */
53 readonly height?: number;
54}
55/**
56 * A widget that doesn't display anything but takes up space
57 */
58export declare class Spacer implements IWidget {
59 readonly width: number;
60 readonly height: number;
61 constructor(props?: SpacerProps);
62 position(_x: number, _y: number): void;
63 toJson(): any[];
64}