mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-24 01:43:52 +08:00
Merge pull request #3618 from NativeScript/angular-animations
Expose some private APIs used in the angular animations
This commit is contained in:
@ -553,11 +553,18 @@ export class CssAnimationProperty<T extends Style, U> {
|
|||||||
public readonly keyframe: string;
|
public readonly keyframe: string;
|
||||||
public readonly defaultValueKey: symbol;
|
public readonly defaultValueKey: symbol;
|
||||||
|
|
||||||
|
private static properties: { [cssName: string]: CssAnimationProperty<any, any> } = {};
|
||||||
|
|
||||||
|
public _valueConverter?: (value: string) => any;
|
||||||
|
|
||||||
constructor(private options: definitions.CssAnimationPropertyOptions<T, U>) {
|
constructor(private options: definitions.CssAnimationPropertyOptions<T, U>) {
|
||||||
const { valueConverter, equalityComparer, valueChanged, defaultValue } = options;
|
const { valueConverter, equalityComparer, valueChanged, defaultValue } = options;
|
||||||
const propertyName = options.name;
|
const propertyName = options.name;
|
||||||
this.name = propertyName;
|
this.name = propertyName;
|
||||||
|
|
||||||
|
CssAnimationProperty.properties[options.cssName || propertyName] = this;
|
||||||
|
this._valueConverter = options.valueConverter;
|
||||||
|
|
||||||
const cssName = "css:" + (options.cssName || propertyName);
|
const cssName = "css:" + (options.cssName || propertyName);
|
||||||
this.cssName = cssName;
|
this.cssName = cssName;
|
||||||
|
|
||||||
|
3
tns-core-modules/ui/definitions.d.ts
vendored
3
tns-core-modules/ui/definitions.d.ts
vendored
@ -236,6 +236,9 @@ declare module "ui/core/properties" {
|
|||||||
readonly keyframe: string;
|
readonly keyframe: string;
|
||||||
|
|
||||||
public register(cls: { prototype: T }): void;
|
public register(cls: { prototype: T }): void;
|
||||||
|
|
||||||
|
public _valueConverter?: (value: string) => any;
|
||||||
|
public static _getByCssName(name: string): CssAnimationProperty<any, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<U> {
|
export class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<U> {
|
||||||
|
Reference in New Issue
Block a user