tsx:add ref and parent support

This commit is contained in:
pengfei.zhou
2021-09-02 11:39:51 +08:00
committed by osborn
parent c1f39de8e3
commit aeff0a06dc
13 changed files with 265 additions and 62 deletions

7
doric-js/index.d.ts vendored
View File

@@ -191,6 +191,11 @@ declare module 'doric/lib/src/ui/view' {
[index: string]: Model;
};
};
export class Ref<T extends View> {
set current(v: T);
get current(): T;
}
export function makeRef<T extends View>(): Ref<T>;
export abstract class View implements Modeling {
width: number;
height: number;
@@ -304,6 +309,8 @@ declare module 'doric/lib/src/ui/view' {
*/
flexConfig?: FlexConfig;
set props(props: Partial<this>);
set parent(v: Group);
set ref(ref: Ref<this>);
doAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
clearAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;
cancelAnimation(context: BridgeContext, animation: IAnimation): Promise<void>;