mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00

* 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
118 lines
6.0 KiB
TypeScript
118 lines
6.0 KiB
TypeScript
/**
|
|
* @module "ui/styling/style-properties"
|
|
*/ /** */
|
|
|
|
import { TransformFunctionsInfo } from "../animation/animation";
|
|
import { Color } from "../../color";
|
|
import { Style, CssProperty, CssAnimationProperty, ShorthandProperty, InheritedCssProperty } from "../core/properties";
|
|
import { Font, FontStyle, FontWeight } from "./font";
|
|
import { Background } from "./background";
|
|
import { dip, px, percent } from "../core/view";
|
|
|
|
export type LengthDipUnit = { readonly unit: "dip", readonly value: dip };
|
|
export type LengthPxUnit = { readonly unit: "px", readonly value: px };
|
|
export type LengthPercentUnit = { readonly unit: "%", readonly value: percent };
|
|
|
|
export type Length = "auto" | dip | LengthDipUnit | LengthPxUnit;
|
|
export type PercentLength = "auto" | dip | LengthDipUnit | LengthPxUnit | LengthPercentUnit;
|
|
|
|
export namespace Length {
|
|
export function parse(text: string): Length;
|
|
export function equals(a: Length, b: Length): boolean;
|
|
/**
|
|
* Converts Length unit to device pixels.
|
|
* @param length The Length to convert.
|
|
* @param auto Value to use for conversion of "auto". By default is Math.NaN.
|
|
*/
|
|
export function toDevicePixels(length: Length, auto?: number): number;
|
|
export function convertToString(length: Length): string;
|
|
}
|
|
|
|
export namespace PercentLength {
|
|
export function parse(text: string): PercentLength;
|
|
export function equals(a: PercentLength, b: PercentLength): boolean;
|
|
/**
|
|
* Converts PercentLength unit to device pixels.
|
|
* @param length The PercentLength to convert.
|
|
* @param auto Value to use for conversion of "auto". By default is Math.NaN.
|
|
* @param parentAvailableWidth Value to use as base when converting percent unit. By default is Math.NaN.
|
|
*/
|
|
export function toDevicePixels(length: PercentLength, auto?: number, parentAvailableWidth?: px): number;
|
|
export function convertToString(length: PercentLength): string;
|
|
}
|
|
|
|
export const zeroLength: Length;
|
|
|
|
export const rotateProperty: CssAnimationProperty<Style, number>;
|
|
export const scaleXProperty: CssAnimationProperty<Style, number>;
|
|
export const scaleYProperty: CssAnimationProperty<Style, number>;
|
|
export const translateXProperty: CssAnimationProperty<Style, dip>;
|
|
export const translateYProperty: CssAnimationProperty<Style, dip>;
|
|
|
|
export function transformConverter(text: string): TransformFunctionsInfo;
|
|
|
|
export const clipPathProperty: CssProperty<Style, string>;
|
|
export const colorProperty: InheritedCssProperty<Style, Color>;
|
|
|
|
export const backgroundProperty: ShorthandProperty<Style, string>;
|
|
export const backgroundColorProperty: CssAnimationProperty<Style, Color>;
|
|
export const backgroundImageProperty: CssProperty<Style, string>;
|
|
export const backgroundRepeatProperty: CssProperty<Style, BackgroundRepeat>;
|
|
export const backgroundSizeProperty: CssProperty<Style, string>;
|
|
export const backgroundPositionProperty: CssProperty<Style, string>;
|
|
|
|
export const borderColorProperty: ShorthandProperty<Style, string | Color>;
|
|
export const borderTopColorProperty: CssProperty<Style, Color>;
|
|
export const borderRightColorProperty: CssProperty<Style, Color>;
|
|
export const borderBottomColorProperty: CssProperty<Style, Color>;
|
|
export const borderLeftColorProperty: CssProperty<Style, Color>;
|
|
|
|
export const borderWidthProperty: ShorthandProperty<Style, string | Length>;
|
|
export const borderTopWidthProperty: CssProperty<Style, Length>;
|
|
export const borderRightWidthProperty: CssProperty<Style, Length>;
|
|
export const borderBottomWidthProperty: CssProperty<Style, Length>;
|
|
export const borderLeftWidthProperty: CssProperty<Style, Length>;
|
|
|
|
export const borderRadiusProperty: ShorthandProperty<Style, string | Length>;
|
|
export const borderTopLeftRadiusProperty: CssProperty<Style, Length>;
|
|
export const borderTopRightRadiusProperty: CssProperty<Style, Length>;
|
|
export const borderBottomRightRadiusProperty: CssProperty<Style, Length>;
|
|
export const borderBottomLeftRadiusProperty: CssProperty<Style, Length>;
|
|
|
|
export const zIndexProperty: CssProperty<Style, number>;
|
|
export const visibilityProperty: CssProperty<Style, Visibility>;
|
|
export const opacityProperty: CssAnimationProperty<Style, number>;
|
|
|
|
export const minWidthProperty: CssProperty<Style, dip | LengthDipUnit | LengthPxUnit>;
|
|
export const minHeightProperty: CssProperty<Style, dip | LengthDipUnit | LengthPxUnit>;
|
|
export const widthProperty: CssAnimationProperty<Style, PercentLength>;
|
|
export const heightProperty: CssAnimationProperty<Style, PercentLength>;
|
|
export const lineHeightProperty: CssProperty<Style, number>;
|
|
export const marginProperty: ShorthandProperty<Style, string | PercentLength>;
|
|
export const marginLeftProperty: CssProperty<Style, PercentLength>;
|
|
export const marginRightProperty: CssProperty<Style, PercentLength>;
|
|
export const marginTopProperty: CssProperty<Style, PercentLength>;
|
|
export const marginBottomProperty: CssProperty<Style, PercentLength>;
|
|
|
|
export const paddingProperty: ShorthandProperty<Style, string | Length>;
|
|
export const paddingLeftProperty: CssProperty<Style, Length>;
|
|
export const paddingRightProperty: CssProperty<Style, Length>;
|
|
export const paddingTopProperty: CssProperty<Style, Length>;
|
|
export const paddingBottomProperty: CssProperty<Style, Length>;
|
|
|
|
export const horizontalAlignmentProperty: CssProperty<Style, HorizontalAlignment>;
|
|
export const verticalAlignmentProperty: CssProperty<Style, VerticalAlignment>;
|
|
|
|
export const fontSizeProperty: InheritedCssProperty<Style, number>;
|
|
export const fontFamilyProperty: InheritedCssProperty<Style, string>;
|
|
export const fontStyleProperty: InheritedCssProperty<Style, FontStyle>;
|
|
export const fontWeightProperty: InheritedCssProperty<Style, FontWeight>;
|
|
|
|
export const backgroundInternalProperty: CssProperty<Style, Background>;
|
|
export const fontInternalProperty: InheritedCssProperty<Style, Font>;
|
|
|
|
export type BackgroundRepeat = "repeat" | "repeat-x" | "repeat-y" | "no-repeat";
|
|
export type Visibility = "visible" | "hidden" | "collapse";
|
|
export type HorizontalAlignment = "left" | "center" | "right" | "stretch";
|
|
export type VerticalAlignment = "top" | "middle" | "bottom" | "stretch";
|