Files
Alexander Vakrilov cc97a16800 feat: Scoped Packages (#7911)
* chore: move tns-core-modules to nativescript-core

* chore: preparing compat generate script

* chore: add missing definitions

* chore: no need for http-request to be private

* chore: packages chore

* test: generate tests for tns-core-modules

* chore: add anroid module for consistency

* chore: add .npmignore

* chore: added privateModulesWhitelist

* chore(webpack): added bundle-entry-points

* chore: scripts

* chore: tests changed to use @ns/core

* test: add scoped-packages test project

* test: fix types

* test: update test project

* chore: build scripts

* chore: update build script

* chore: npm scripts cleanup

* chore: make the compat pgk work with old wp config

* test: generate diff friendly tests

* chore: create barrel exports

* chore: move files after rebase

* chore: typedoc config

* chore: compat mode

* chore: review of barrels

* chore: remove tns-core-modules import after rebase

* chore: dev workflow setup

* chore: update developer-workflow

* docs: experiment with API extractor

* chore: api-extractor and barrel exports

* chore: api-extractor configs

* chore: generate d.ts rollup with api-extractor

* refactor: move methods inside Frame

* chore: fic tests to use Frame static methods

* refactor: create Builder class

* refactor: use Builder class in tests

* refactor: include Style in ui barrel

* chore: separate compat build script

* chore: fix tslint errors

* chore: update NATIVESCRIPT_CORE_ARGS

* chore: fix compat pack

* chore: fix ui-test-app build with linked modules

* chore: Application, ApplicationSettings, Connectivity and Http

* chore: export Trace, Profiling and Utils

* refactor: Static create methods for ImageSource

* chore: fix deprecated usages of ImageSource

* chore: move Span and FormattedString to ui

* chore: add events-args and ImageSource to index files

* chore: check for CLI >= 6.2 when building for IOS

* chore: update travis build

* chore: copy Pod file to compat package

* chore: update error msg ui-tests-app

* refactor: Apply suggestions from code review

Co-Authored-By: Martin Yankov <m.i.yankov@gmail.com>

* chore: typings and refs

* chore: add missing d.ts files for public API

* chore: adress code review FB

* chore: update api-report

* chore: dev-workflow for other apps

* chore: api update

* chore: update api-report
2019-10-17 00:45:33 +03:00

187 lines
4.5 KiB
TypeScript

/**
* @module "ui/layouts/grid-layout"
*/ /** */
import { LayoutBase, Property, View } from "../layout-base";
/**
* Defines row/column specific properties that apply to GridLayout elements.
*/
export class ItemSpec {
constructor();
constructor(value: number, type: GridUnitType);
/**
* Gets the actual length of an ItemSpec.
*/
actualLength: number;
/**
* Returns unit type of this ItemSpec instance.
*/
gridUnitType: GridUnitType;
/**
* Returns true if this ItemSpec instance holds
* an absolute (pixel) value.
*/
isAbsolute: boolean;
/**
* Returns true if this GridLength instance is
* automatic (not specified).
*/
isAuto: boolean;
/**
* Returns true if this ItemSpec instance holds weighted proportion
* of available space.
*/
isStar: boolean;
/**
* Returns value part of this ItemSpec instance.
*/
value: number;
}
/**
* Defines a rectangular layout area that consists of columns and rows.
*/
export class GridLayout extends LayoutBase {
/**
* Gets the value of the Column attached property from a given View.
*/
static getColumn(view: View): number;
/**
* Sets the value of the Column attached property to a given View.
*/
static setColumn(view: View, value: number): void;
/**
* Gets the value of the ColumnSpan attached property from a given View.
*/
static getColumnSpan(view: View): number;
/**
* Sets the value of the ColumnSpan attached property to a given View.
*/
static setColumnSpan(view: View, value: number): void;
/**
* Gets the value of the Row attached property from a given View.
*/
static getRow(view: View): number;
/**
* Sets the value of the Row attached property to a given View.
*/
static setRow(view: View, value: number): void;
/**
* Gets the value of the RowSpan attached property from a given View.
*/
static getRowSpan(view: View): number;
/**
* Sets the value of the RowSpan attached property to a given View.
*/
static setRowSpan(view: View, value: number): void;
/**
* Adds a column specification to a GridLayout.
*/
public addColumn(itemSpec: ItemSpec): void;
/**
* Adds a row specification to a GridLayout.
*/
public addRow(itemSpec: ItemSpec): void;
/**
* Adds a child at specific cell in GridLayout. Optional rowSpan and columnSpan attributes
*/
public addChildAtCell(view: View, row: number, column: number, rowSpan?: number, columnSpan?: number): void;
/**
* Removes a column specification from a GridLayout.
*/
public removeColumn(itemSpec: ItemSpec): void;
/**
* Removes all column specifications from a GridLayout.
*/
public removeColumns(): void;
/**
* Removes a row specification from a GridLayout.
*/
public removeRow(itemSpec: ItemSpec): void;
/**
* Removes all row specifications from a GridLayout.
*/
public removeRows(): void;
/**
* Gets array of column specifications defined on this instance of GridLayout.
*/
public getColumns(): Array<ItemSpec>;
/**
* Gets array of row specifications defined on this instance of GridLayout.
*/
public getRows(): Array<ItemSpec>;
//@private
/**
* @private
*/
public _onRowAdded(itemSpec: ItemSpec): void;
/**
* @private
*/
public _onColumnAdded(itemSpec: ItemSpec): void;
/**
* @private
*/
public _onRowRemoved(itemSpec: ItemSpec, index: number): void;
/**
* @private
*/
public _onColumnRemoved(itemSpec: ItemSpec, index: number): void;
//@endprivate
}
/**
* Represents the observable property backing the column property.
*/
export const columnProperty: Property<View, number>;
/**
* Represents the observable property backing the columnSpan property.
*/
export const columnSpanProperty: Property<View, number>;
/**
* Represents the observable property backing the row property.
*/
export const rowProperty: Property<View, number>;
/**
* Represents the observable property backing the rowSpan property.
*/
export const rowSpanProperty: Property<View, number>;
export type GridUnitType = "pixel" | "star" | "auto";
export namespace GridUnitType {
export const PIXEL: "pixel";
export const STAR: "star";
export const AUTO: "auto";
export function isValid(value: any): boolean;
export function parse(value: string): GridUnitType;
}