diff --git a/doric-demo/src/NewGobangDemo.tsx b/doric-demo/src/NewGobangDemo.tsx index 36854700..4ea7938d 100644 --- a/doric-demo/src/NewGobangDemo.tsx +++ b/doric-demo/src/NewGobangDemo.tsx @@ -17,7 +17,7 @@ import { Scroller, jsx, VLayout, - makeRef, + createRef, HLayout, } from "doric"; import { colors } from "./utils"; @@ -216,11 +216,11 @@ interface GoBangState { class GoBangVH extends ViewHolder { root!: Group; gap = 0; - currentRole = makeRef(); - result = makeRef(); + currentRole = createRef(); + result = createRef(); targetZone: View[] = []; - gameMode = makeRef(); - assistant = makeRef(); + gameMode = createRef(); + assistant = createRef(); build(root: Group): void { this.root = root; } diff --git a/doric-demo/src/TSXDemo.tsx b/doric-demo/src/TSXDemo.tsx index b2a2e625..508ea7da 100644 --- a/doric-demo/src/TSXDemo.tsx +++ b/doric-demo/src/TSXDemo.tsx @@ -6,10 +6,7 @@ import { Group, layoutConfig, Text, - makeRef, - Stack, - Color, - modal, + createRef, } from "doric"; function createFragment() { @@ -25,7 +22,7 @@ function createFragment() { class Counter extends Panel { build(root: Group) { const fragments = createFragment(); - const ref = makeRef(); + const ref = createRef(); let count = 0; (): Ref; + export function createRef(): Ref; export abstract class View implements Modeling { width: number; height: number; diff --git a/doric-js/lib/src/ui/view.d.ts b/doric-js/lib/src/ui/view.d.ts index f7323d74..8c29e6ae 100644 --- a/doric-js/lib/src/ui/view.d.ts +++ b/doric-js/lib/src/ui/view.d.ts @@ -19,7 +19,7 @@ export declare class Ref { set current(v: T); get current(): T; } -export declare function makeRef(): Ref; +export declare function createRef(): Ref; export declare abstract class View implements Modeling { width: number; height: number; diff --git a/doric-js/lib/src/ui/view.js b/doric-js/lib/src/ui/view.js index f7878a80..6f19c7c1 100644 --- a/doric-js/lib/src/ui/view.js +++ b/doric-js/lib/src/ui/view.js @@ -34,7 +34,7 @@ export class Ref { return this.view; } } -export function makeRef() { +export function createRef() { return new Ref; } export class View { diff --git a/doric-js/src/ui/view.es5.ts b/doric-js/src/ui/view.es5.ts index 544b348a..9b9cc8f0 100644 --- a/doric-js/src/ui/view.es5.ts +++ b/doric-js/src/ui/view.es5.ts @@ -80,7 +80,7 @@ export class Ref { } } -export function makeRef() { +export function createRef() { return new Ref } diff --git a/doric-js/src/ui/view.ts b/doric-js/src/ui/view.ts index 9e61fe57..1cfa8807 100644 --- a/doric-js/src/ui/view.ts +++ b/doric-js/src/ui/view.ts @@ -62,7 +62,7 @@ export class Ref { } } -export function makeRef(): Ref { +export function createRef(): Ref { return new Ref } diff --git a/doric-web/dist/index.js b/doric-web/dist/index.js index dfd166b4..7a827673 100644 --- a/doric-web/dist/index.js +++ b/doric-web/dist/index.js @@ -1730,7 +1730,7 @@ class Ref { return this.view; } } -function makeRef() { +function createRef() { return new Ref; } class View { @@ -4769,6 +4769,7 @@ exports.ViewHolder = ViewHolder; exports.ViewModel = ViewModel; exports.animate = animate; exports.coordinator = coordinator; +exports.createRef = createRef; exports.draggable = draggable; exports.flexlayout = flexlayout; exports.flowItem = flowItem; @@ -4785,7 +4786,6 @@ exports.listItem = listItem; exports.log = log; exports.loge = loge; exports.logw = logw; -exports.makeRef = makeRef; exports.modal = modal; exports.navbar = navbar; exports.navigator = navigator;