add ts define
This commit is contained in:
@@ -20,6 +20,7 @@ import { loge } from "../util/log";
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
import { LayoutConfig } from '../util/layoutconfig'
|
||||
import { IAnimation } from "./animation";
|
||||
import { FlexConfig } from "../util/flexbox";
|
||||
|
||||
export function Property(target: View, propKey: string) {
|
||||
Object.defineProperty(target, propKey, {
|
||||
@@ -79,6 +80,11 @@ export interface IView {
|
||||
*/
|
||||
rotation?: number
|
||||
/**----------transform----------*/
|
||||
|
||||
/**
|
||||
* Only affected when its superview or itself is FlexLayout.
|
||||
*/
|
||||
flexConfig?: FlexConfig
|
||||
}
|
||||
|
||||
export type NativeViewModel = {
|
||||
@@ -343,6 +349,9 @@ export abstract class View implements Modeling, IView {
|
||||
rotation?: number
|
||||
/**----------transform----------*/
|
||||
|
||||
@Property
|
||||
flexConfig?: FlexConfig
|
||||
|
||||
doAnimation(context: BridgeContext, animation: IAnimation) {
|
||||
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
|
||||
for (let key in args) {
|
||||
|
@@ -20,6 +20,7 @@ import { loge } from "../util/log";
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
import { LayoutConfig } from '../util/layoutconfig'
|
||||
import { IAnimation } from "./animation";
|
||||
import { FlexConfig } from "../util/flexbox";
|
||||
|
||||
export function Property(target: Object, propKey: string) {
|
||||
Reflect.defineMetadata(propKey, true, target)
|
||||
@@ -68,6 +69,11 @@ export interface IView {
|
||||
*/
|
||||
rotation?: number
|
||||
/**----------transform----------*/
|
||||
|
||||
/**
|
||||
* Only affected when its superview or itself is FlexLayout.
|
||||
*/
|
||||
flexConfig?: FlexConfig
|
||||
}
|
||||
|
||||
export type NativeViewModel = {
|
||||
@@ -338,6 +344,9 @@ export abstract class View implements Modeling, IView {
|
||||
rotation?: number
|
||||
/**----------transform----------*/
|
||||
|
||||
@Property
|
||||
flexConfig?: FlexConfig
|
||||
|
||||
doAnimation(context: BridgeContext, animation: IAnimation) {
|
||||
return this.nativeChannel(context, "doAnimation")(animation.toModel()).then((args) => {
|
||||
for (let key in args) {
|
||||
|
Reference in New Issue
Block a user