1 | import { ViewBase } from '../view-base';
|
2 | import { Style } from '../../styling/style';
|
3 |
|
4 |
|
5 |
|
6 | export declare const unsetValue: any;
|
7 | export interface PropertyOptions<T, U> {
|
8 | readonly name: string;
|
9 | readonly defaultValue?: U;
|
10 | readonly affectsLayout?: boolean;
|
11 | readonly equalityComparer?: (x: U, y: U) => boolean;
|
12 | readonly valueChanged?: (target: T, oldValue: U, newValue: U) => void;
|
13 | readonly valueConverter?: (value: string) => U;
|
14 | }
|
15 | export interface CoerciblePropertyOptions<T, U> extends PropertyOptions<T, U> {
|
16 | readonly coerceValue: (t: T, u: U) => U;
|
17 | }
|
18 | export interface CssPropertyOptions<T extends Style, U> extends PropertyOptions<T, U> {
|
19 | readonly cssName: string;
|
20 | }
|
21 | export interface ShorthandPropertyOptions<P> {
|
22 | readonly name: string;
|
23 | readonly cssName: string;
|
24 | readonly converter: (value: string | P) => [CssProperty<any, any> | CssAnimationProperty<any, any>, any][];
|
25 | readonly getter: (this: Style) => string | P;
|
26 | }
|
27 | export interface CssAnimationPropertyOptions<T, U> {
|
28 | readonly name: string;
|
29 | readonly cssName?: string;
|
30 | readonly defaultValue?: U;
|
31 | readonly equalityComparer?: (x: U, y: U) => boolean;
|
32 | readonly valueChanged?: (target: T, oldValue: U, newValue: U) => void;
|
33 | readonly valueConverter?: (value: string) => U;
|
34 | }
|
35 | export declare function _printUnregisteredProperties(): void;
|
36 | export declare function _getProperties(): Property<any, any>[];
|
37 | export declare function _getStyleProperties(): CssProperty<any, any>[];
|
38 | export declare function isCssVariable(property: string): boolean;
|
39 | export declare function isCssCalcExpression(value: string): boolean;
|
40 | export declare function isCssVariableExpression(value: string): boolean;
|
41 | export declare function _evaluateCssVariableExpression(view: ViewBase, cssName: string, value: string): string;
|
42 | export declare function _evaluateCssCalcExpression(value: string): any;
|
43 | export declare class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<U>, Property<T, U> {
|
44 | private registered;
|
45 | readonly name: string;
|
46 | readonly key: symbol;
|
47 | readonly getDefault: symbol;
|
48 | readonly setNative: symbol;
|
49 | readonly defaultValueKey: symbol;
|
50 | readonly defaultValue: U;
|
51 | readonly nativeValueChange: (owner: T, value: U) => void;
|
52 | isStyleProperty: boolean;
|
53 | get: () => U;
|
54 | set: (value: U) => void;
|
55 | overrideHandlers: (options: PropertyOptions<T, U>) => void;
|
56 | enumerable: boolean;
|
57 | configurable: boolean;
|
58 | constructor(options: PropertyOptions<T, U>);
|
59 | register(cls: {
|
60 | prototype: T;
|
61 | }): void;
|
62 | isSet(instance: T): boolean;
|
63 | }
|
64 | export declare class CoercibleProperty<T extends ViewBase, U> extends Property<T, U> implements CoercibleProperty<T, U> {
|
65 | readonly coerce: (target: T) => void;
|
66 | constructor(options: CoerciblePropertyOptions<T, U>);
|
67 | }
|
68 | export declare class InheritedProperty<T extends ViewBase, U> extends Property<T, U> implements InheritedProperty<T, U> {
|
69 | readonly sourceKey: symbol;
|
70 | readonly setInheritedValue: (value: U) => void;
|
71 | constructor(options: PropertyOptions<T, U>);
|
72 | }
|
73 | export declare class CssProperty<T extends Style, U> implements CssProperty<T, U> {
|
74 | private registered;
|
75 | readonly name: string;
|
76 | readonly cssName: string;
|
77 | readonly cssLocalName: string;
|
78 | protected readonly cssValueDescriptor: PropertyDescriptor;
|
79 | protected readonly localValueDescriptor: PropertyDescriptor;
|
80 | isStyleProperty: boolean;
|
81 | readonly key: symbol;
|
82 | readonly getDefault: symbol;
|
83 | readonly setNative: symbol;
|
84 | readonly sourceKey: symbol;
|
85 | readonly defaultValueKey: symbol;
|
86 | readonly defaultValue: U;
|
87 | overrideHandlers: (options: CssPropertyOptions<T, U>) => void;
|
88 | constructor(options: CssPropertyOptions<T, U>);
|
89 | register(cls: {
|
90 | prototype: T;
|
91 | }): void;
|
92 | isSet(instance: T): boolean;
|
93 | }
|
94 | export declare class CssAnimationProperty<T extends Style, U> implements CssAnimationProperty<T, U> {
|
95 | readonly name: string;
|
96 | readonly cssName: string;
|
97 | readonly cssLocalName: string;
|
98 | readonly getDefault: symbol;
|
99 | readonly setNative: symbol;
|
100 | readonly register: (cls: {
|
101 | prototype: any;
|
102 | }) => void;
|
103 | readonly keyframe: string;
|
104 | readonly defaultValueKey: symbol;
|
105 | readonly key: symbol;
|
106 | private readonly source;
|
107 | readonly defaultValue: U;
|
108 | isStyleProperty: boolean;
|
109 | private static properties;
|
110 | _valueConverter?: (value: string) => any;
|
111 | constructor(options: CssAnimationPropertyOptions<T, U>);
|
112 | _initDefaultNativeValue(target: T): void;
|
113 | static _getByCssName(name: string): CssAnimationProperty<any, any>;
|
114 | static _getPropertyNames(): string[];
|
115 | isSet(instance: T): boolean;
|
116 | }
|
117 | export declare class InheritedCssProperty<T extends Style, U> extends CssProperty<T, U> implements InheritedCssProperty<T, U> {
|
118 | setInheritedValue: (value: U) => void;
|
119 | constructor(options: CssPropertyOptions<T, U>);
|
120 | }
|
121 | export declare class ShorthandProperty<T extends Style, P> implements ShorthandProperty<T, P> {
|
122 | private registered;
|
123 | readonly key: symbol;
|
124 | readonly name: string;
|
125 | readonly cssName: string;
|
126 | readonly cssLocalName: string;
|
127 | protected readonly cssValueDescriptor: PropertyDescriptor;
|
128 | protected readonly localValueDescriptor: PropertyDescriptor;
|
129 | protected readonly propertyBagDescriptor: PropertyDescriptor;
|
130 | readonly sourceKey: symbol;
|
131 | constructor(options: ShorthandPropertyOptions<P>);
|
132 | register(cls: typeof Style): void;
|
133 | }
|
134 | export declare const initNativeView: any;
|
135 | export declare function applyPendingNativeSetters(view: ViewBase): void;
|
136 | export declare function applyAllNativeSetters(view: ViewBase): void;
|
137 | export declare function resetNativeView(view: ViewBase): void;
|
138 | export declare function clearInheritedProperties(view: ViewBase): void;
|
139 | export declare function resetCSSProperties(style: Style): void;
|
140 | export declare function propagateInheritableProperties(view: ViewBase, child: ViewBase): void;
|
141 | export declare function propagateInheritableCssProperties(parentStyle: Style, childStyle: Style): void;
|
142 | export declare function makeValidator<T>(...values: T[]): (value: any) => value is T;
|
143 | export declare function makeParser<T>(isValid: (value: any) => boolean, allowNumbers?: boolean): (value: any) => T;
|
144 | export declare function getSetProperties(view: ViewBase): [string, any][];
|
145 | export declare function getComputedCssValues(view: ViewBase): [string, any][];
|