UNPKG

3.23 kBTypeScriptView Raw
1import { GridLayout as GridLayoutDefinition, ItemSpec as ItemSpecDefinition } from '.';
2import { LayoutBase } from '../layout-base';
3import { View } from '../../core/view';
4import { Property } from '../../core/properties';
5import { Observable } from '../../../data/observable';
6export declare class ItemSpec extends Observable implements ItemSpecDefinition {
7 private _value;
8 private _unitType;
9 toJSON?: () => any;
10 constructor(...args: any[]);
11 owner: GridLayoutBase;
12 index: number;
13 _actualLength: number;
14 static create(value: number, type: GridUnitType): ItemSpec;
15 get actualLength(): number;
16 static equals(value1: ItemSpec, value2: ItemSpec): boolean;
17 get gridUnitType(): GridUnitType;
18 get isAbsolute(): boolean;
19 get isAuto(): boolean;
20 get isStar(): boolean;
21 get value(): number;
22}
23export declare class GridLayoutBase extends LayoutBase implements GridLayoutDefinition {
24 protected _rows: Array<ItemSpec>;
25 protected _cols: Array<ItemSpec>;
26 static getColumn(element: View): number;
27 static setColumn(element: View, value: number): void;
28 static getColumnSpan(element: View): number;
29 static setColumnSpan(element: View, value: number): void;
30 static getRow(element: View): number;
31 static setRow(element: View, value: number): void;
32 static getRowSpan(element: View): number;
33 static setRowSpan(element: View, value: number): void;
34 _addRow(itemSpec: ItemSpec): void;
35 addRow(itemSpec: ItemSpec): void;
36 addRows(itemSpecs: ItemSpec[]): void;
37 _addColumn(itemSpec: ItemSpec): void;
38 addColumn(itemSpec: ItemSpec): void;
39 addColumns(itemSpecs: ItemSpec[]): void;
40 addChildAtCell(view: View, row: number, column: number, rowSpan?: number, columnSpan?: number): void;
41 removeRow(itemSpec: ItemSpec): void;
42 removeColumn(itemSpec: ItemSpec): void;
43 removeColumns(): void;
44 removeRows(): void;
45 onRowChanged(element: View, oldValue: number, newValue: number): void;
46 onRowSpanChanged(element: View, oldValue: number, newValue: number): void;
47 onColumnChanged(element: View, oldValue: number, newValue: number): void;
48 onColumnSpanChanged(element: View, oldValue: number, newValue: number): void;
49 _onRowAdded(itemSpec: ItemSpec): void;
50 _onColumnAdded(itemSpec: ItemSpec): void;
51 _onRowRemoved(itemSpec: ItemSpec, index: number): void;
52 _onColumnRemoved(itemSpec: ItemSpec, index: number): void;
53 getColumns(): Array<ItemSpec>;
54 getRows(): Array<ItemSpec>;
55 protected get columnsInternal(): Array<ItemSpec>;
56 protected get rowsInternal(): Array<ItemSpec>;
57 protected invalidate(): void;
58 set rows(value: string);
59 set columns(value: string);
60}
61export declare const columnProperty: Property<View, number>;
62export declare const columnSpanProperty: Property<View, number>;
63export declare const rowProperty: Property<View, number>;
64export declare const rowSpanProperty: Property<View, number>;
65export type GridUnitType = 'pixel' | 'star' | 'auto';
66export declare namespace GridUnitType {
67 const PIXEL = "pixel";
68 const STAR = "star";
69 const AUTO = "auto";
70 const isValid: (value: any) => value is GridUnitType;
71 const parse: (value: any) => GridUnitType;
72}