add ts define

This commit is contained in:
pengfei.zhou
2020-04-09 17:07:24 +08:00
committed by osborn
parent dd06675253
commit 404b4b594f
13 changed files with 485 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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) {