update js

This commit is contained in:
pengfei.zhou
2020-01-03 16:35:04 +08:00
committed by osborn
parent 4b3a370f5f
commit 680b95f05d
18 changed files with 124 additions and 141 deletions

View File

@@ -57,6 +57,13 @@ export interface IView {
*/
rotation?: number;
}
export declare type NativeViewModel = {
id: string;
type: string;
props: {
[index: string]: Model;
};
};
export declare abstract class View implements Modeling, IView {
width: number;
height: number;
@@ -114,24 +121,12 @@ export declare abstract class View implements Modeling, IView {
get dirtyProps(): {
[index: string]: Model;
};
nativeViewModel: {
id: string;
type: string;
props: {
[index: string]: Model;
};
};
nativeViewModel: NativeViewModel;
onPropertyChanged(propKey: string, oldV: Model, newV: Model): void;
clean(): void;
isDirty(): boolean;
responseCallback(id: string, ...args: any): any;
toModel(): {
id: string;
type: string;
props: {
[index: string]: Model;
};
};
toModel(): NativeViewModel;
let(block: (it: this) => void): void;
also(block: (it: this) => void): this;
apply(config: IView): this;
@@ -159,13 +154,7 @@ export declare abstract class Superview extends View {
abstract allSubviews(): Iterable<View>;
isDirty(): boolean;
clean(): void;
toModel(): {
id: string;
type: string;
props: {
[index: string]: Model;
};
};
toModel(): NativeViewModel;
}
export declare abstract class Group extends Superview {
readonly children: View[];

View File

@@ -1,5 +1,5 @@
import { Stack } from './layouts';
import { IView, Superview, View } from '../ui/view';
import { IView, Superview, View, NativeViewModel } from '../ui/view';
export declare class FlowLayoutItem extends Stack {
/**
* Set to reuse native view
@@ -31,13 +31,7 @@ export declare class FlowLayout extends Superview implements IFlowLayout {
private getItem;
isDirty(): boolean;
private renderBunchedItems;
toModel(): {
id: string;
type: string;
props: {
[index: string]: import("../util/types").Model;
};
};
toModel(): NativeViewModel;
}
export declare function flowlayout(config: IFlowLayout): FlowLayout;
export declare function flowItem(item: View): FlowLayoutItem;

View File

@@ -1,4 +1,4 @@
import { View, Superview, IView } from "../ui/view";
import { View, Superview, IView, NativeViewModel } from "../ui/view";
import { Stack } from "./layouts";
export declare class ListItem extends Stack {
/**
@@ -25,13 +25,7 @@ export declare class List extends Superview implements IList {
private getItem;
isDirty(): boolean;
private renderBunchedItems;
toModel(): {
id: string;
type: string;
props: {
[index: string]: import("../..").Model;
};
};
toModel(): NativeViewModel;
}
export declare function list(config: IList): List;
export declare function listItem(item: View): ListItem;

View File

@@ -1,4 +1,4 @@
import { View, Superview, IView } from "../ui/view";
import { View, Superview, IView, NativeViewModel } from "../ui/view";
import { List } from "./list";
import { Scroller } from "./scroller";
import { BridgeContext } from "../runtime/global";
@@ -16,13 +16,7 @@ export declare class Refreshable extends Superview implements IRefreshable {
setRefreshing(context: BridgeContext, refreshing: boolean): Promise<any>;
isRefreshable(context: BridgeContext): Promise<boolean>;
isRefreshing(context: BridgeContext): Promise<boolean>;
toModel(): {
id: string;
type: string;
props: {
[index: string]: import("../..").Model;
};
};
toModel(): NativeViewModel;
}
export declare function refreshable(config: IRefreshable): Refreshable;
export interface IPullable {

View File

@@ -1,4 +1,4 @@
import { Superview, View, IView } from '../ui/view';
import { Superview, View, IView, NativeViewModel } from '../ui/view';
export declare function scroller(content: View): Scroller;
export interface IScroller extends IView {
content: View;
@@ -6,11 +6,5 @@ export interface IScroller extends IView {
export declare class Scroller extends Superview implements IScroller {
content: View;
allSubviews(): View[];
toModel(): {
id: string;
type: string;
props: {
[index: string]: import("../..").Model;
};
};
toModel(): NativeViewModel;
}