@tarojs/runtime 4.1.0-alpha.3 → 4.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bom/URL.d.ts +6 -3
- package/dist/bom/URLSearchParams.d.ts +2 -1
- package/dist/bom/document.d.ts +3 -2
- package/dist/bom/getComputedStyle.d.ts +5 -4
- package/dist/bom/history.d.ts +7 -5
- package/dist/bom/location.d.ts +5 -3
- package/dist/bom/navigator.d.ts +2 -1
- package/dist/bom/raf.d.ts +2 -2
- package/dist/bom/window.d.ts +9 -8
- package/dist/constants/index.d.ts +53 -52
- package/dist/current.d.ts +5 -5
- package/dist/dom/anchor-element.d.ts +3 -2
- package/dist/dom/class-list.d.ts +3 -2
- package/dist/dom/document.d.ts +10 -6
- package/dist/dom/element.d.ts +7 -6
- package/dist/dom/event-source.d.ts +3 -3
- package/dist/dom/event-target.d.ts +3 -2
- package/dist/dom/event.d.ts +6 -5
- package/dist/dom/form.d.ts +4 -3
- package/dist/dom/node.d.ts +39 -8
- package/dist/dom/root.d.ts +4 -3
- package/dist/dom/style.d.ts +3 -2
- package/dist/dom/svg.d.ts +3 -2
- package/dist/dom/text.d.ts +4 -3
- package/dist/dom/transfer.d.ts +3 -2
- package/dist/dom/tree.d.ts +3 -3
- package/dist/dom-external/element.d.ts +4 -3
- package/dist/dom-external/inner-html/html.d.ts +3 -2
- package/dist/dom-external/inner-html/parser.d.ts +7 -7
- package/dist/dom-external/inner-html/scaner.d.ts +3 -3
- package/dist/dom-external/inner-html/style.d.ts +3 -3
- package/dist/dom-external/inner-html/tags.d.ts +6 -5
- package/dist/dom-external/inner-html/utils.d.ts +2 -1
- package/dist/dom-external/mutation-observer/implements.d.ts +25 -6
- package/dist/dom-external/mutation-observer/index.d.ts +5 -6
- package/dist/dom-external/node.d.ts +6 -5
- package/dist/dsl/common.d.ts +15 -14
- package/dist/emitter/emitter.d.ts +2 -2
- package/dist/env.d.ts +2 -2
- package/dist/hydrate.d.ts +5 -4
- package/dist/index-26658829.d.ts +23 -0
- package/dist/index.cjs.d.ts +813 -0
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +32 -33
- package/dist/{dsl/instance.d.ts → instance-530729bd.d.ts} +14 -13
- package/dist/next-tick.d.ts +3 -2
- package/dist/{dom/node_types.d.ts → node_types-9ac5b4dd.d.ts} +2 -1
- package/dist/{interface/options.d.ts → options-530729bd.d.ts} +5 -4
- package/dist/options.d.ts +3 -2
- package/dist/perf.d.ts +2 -2
- package/dist/polyfill/array.d.ts +3 -2
- package/dist/polyfill/intersection-observer.d.ts +2 -1
- package/dist/polyfill/object.d.ts +4 -3
- package/dist/{dom-external/mutation-observer/record.d.ts → record-32b054d8.d.ts} +4 -3
- package/dist/runtime.esm.d.ts +813 -0
- package/dist/utils/cache.d.ts +2 -1
- package/dist/utils/index.d.ts +18 -17
- package/dist/utils/lodash.d.ts +3 -2
- package/dist/utils/router.d.ts +8 -7
- package/package.json +4 -3
- package/dist/interface/element.d.ts +0 -4
- package/dist/interface/event-target.d.ts +0 -11
- package/dist/interface/event.d.ts +0 -15
- package/dist/interface/hydrate.d.ts +0 -29
- package/dist/interface/index.d.ts +0 -7
- package/dist/interface/node.d.ts +0 -7
- package/dist/interface/utils.d.ts +0 -2
package/dist/bom/URL.d.ts
CHANGED
|
@@ -22,8 +22,10 @@ declare class TaroURL {
|
|
|
22
22
|
get origin(): string;
|
|
23
23
|
set origin(val: string);
|
|
24
24
|
get searchParams(): URLSearchParams;
|
|
25
|
+
// public method
|
|
25
26
|
toString(): string;
|
|
26
27
|
toJSON(): string;
|
|
28
|
+
// convenient for deconstructor
|
|
27
29
|
_toRaw(): {
|
|
28
30
|
protocol: string;
|
|
29
31
|
port: string;
|
|
@@ -36,9 +38,8 @@ declare class TaroURL {
|
|
|
36
38
|
href: string;
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export declare function parseUrl(url?: string): {
|
|
41
|
+
declare const TaroURLProvider: typeof TaroURL;
|
|
42
|
+
declare function parseUrl(url?: string): {
|
|
42
43
|
href: string;
|
|
43
44
|
origin: string;
|
|
44
45
|
protocol: string;
|
|
@@ -49,3 +50,5 @@ export declare function parseUrl(url?: string): {
|
|
|
49
50
|
search: string;
|
|
50
51
|
hash: string;
|
|
51
52
|
};
|
|
53
|
+
export type { TaroURL };
|
|
54
|
+
export { TaroURLProvider, parseUrl };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const URLSearchParams: any;
|
|
2
|
+
export { URLSearchParams };
|
package/dist/bom/document.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { TaroDocument } from
|
|
2
|
-
|
|
1
|
+
import { TaroDocument } from "../dom/document.js";
|
|
2
|
+
declare const taroDocumentProvider: TaroDocument;
|
|
3
|
+
export { taroDocumentProvider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { TaroElement } from "../dom/element.js";
|
|
2
|
+
import { Style } from "../dom/style.js";
|
|
3
|
+
type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
|
|
4
|
+
declare const taroGetComputedStyleProvider: TGetComputedStyle;
|
|
5
|
+
export { TGetComputedStyle, taroGetComputedStyleProvider };
|
package/dist/bom/history.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Events } from
|
|
2
|
-
import { RuntimeCache } from
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { Events } from "../emitter/emitter.js";
|
|
2
|
+
import { RuntimeCache } from "../utils/cache.js";
|
|
3
|
+
import { TaroLocation } from "./location.js";
|
|
4
|
+
interface HistoryState {
|
|
5
5
|
state: Record<string, any> | null;
|
|
6
6
|
title: string;
|
|
7
7
|
url: string;
|
|
@@ -19,6 +19,7 @@ declare class TaroHistory extends Events {
|
|
|
19
19
|
constructor(location: TaroLocation, options: Options);
|
|
20
20
|
get length(): number;
|
|
21
21
|
get state(): Record<string, any> | null;
|
|
22
|
+
/* public method */
|
|
22
23
|
go(delta: number): void;
|
|
23
24
|
back(): void;
|
|
24
25
|
forward(): void;
|
|
@@ -26,5 +27,6 @@ declare class TaroHistory extends Events {
|
|
|
26
27
|
replaceState(state: any, title: string, url: string): void;
|
|
27
28
|
get cache(): RuntimeCache<HistoryContext>;
|
|
28
29
|
}
|
|
30
|
+
declare const History: typeof TaroHistory;
|
|
31
|
+
export { HistoryState, History };
|
|
29
32
|
export type { TaroHistory };
|
|
30
|
-
export declare const History: typeof TaroHistory;
|
package/dist/bom/location.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Events } from
|
|
2
|
-
import { RuntimeCache } from
|
|
1
|
+
import { Events } from "../emitter/emitter.js";
|
|
2
|
+
import { RuntimeCache } from "../utils/cache.js";
|
|
3
3
|
type Options = {
|
|
4
4
|
window: any;
|
|
5
5
|
};
|
|
@@ -27,11 +27,13 @@ declare class TaroLocation extends Events {
|
|
|
27
27
|
set href(val: string);
|
|
28
28
|
get origin(): string;
|
|
29
29
|
set origin(val: string);
|
|
30
|
+
/* public method */
|
|
30
31
|
assign(): void;
|
|
31
32
|
reload(): void;
|
|
32
33
|
replace(url: string): void;
|
|
33
34
|
toString(): string;
|
|
34
35
|
get cache(): RuntimeCache<LocationContext>;
|
|
35
36
|
}
|
|
37
|
+
declare const Location: typeof TaroLocation;
|
|
36
38
|
export type { TaroLocation };
|
|
37
|
-
export
|
|
39
|
+
export { Location };
|
package/dist/bom/navigator.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare const nav: typeof window.navigator;
|
|
2
|
+
export { nav };
|
package/dist/bom/raf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
2
|
+
declare let now: () => number;
|
|
3
3
|
declare const _raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
4
4
|
declare const _caf: typeof cancelAnimationFrame;
|
|
5
|
-
export { _caf as caf, _raf as raf };
|
|
5
|
+
export { now, _caf as caf, _raf as raf };
|
package/dist/bom/window.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Events } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { Events } from "../emitter/emitter.js";
|
|
3
|
+
import { TaroHistory } from "./history.js";
|
|
4
|
+
import { TaroLocation } from "./location.js";
|
|
5
5
|
declare class TaroWindow extends Events {
|
|
6
6
|
navigator: Navigator;
|
|
7
7
|
requestAnimationFrame: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
8
8
|
cancelAnimationFrame: typeof cancelAnimationFrame;
|
|
9
|
-
getComputedStyle: import("./getComputedStyle").TGetComputedStyle;
|
|
9
|
+
getComputedStyle: import("./getComputedStyle.js").TGetComputedStyle;
|
|
10
10
|
Date: DateConstructor;
|
|
11
11
|
location: TaroLocation;
|
|
12
12
|
history: TaroHistory;
|
|
13
13
|
XMLHttpRequest?: Partial<XMLHttpRequest>;
|
|
14
14
|
constructor();
|
|
15
15
|
initEvent(): void;
|
|
16
|
-
get document(): import("../dom/document").TaroDocument;
|
|
16
|
+
get document(): import("../dom/document.js").TaroDocument;
|
|
17
17
|
addEventListener(event: string, callback: (arg: any) => void): void;
|
|
18
18
|
removeEventListener(event: string, callback: (arg: any) => void): void;
|
|
19
19
|
setTimeout(...args: Parameters<typeof setTimeout>): NodeJS.Timeout;
|
|
20
20
|
clearTimeout(...args: Parameters<typeof clearTimeout>): void;
|
|
21
21
|
}
|
|
22
|
+
declare const taroWindowProvider: TaroWindow;
|
|
23
|
+
declare const taroLocationProvider: TaroLocation;
|
|
24
|
+
declare const taroHistoryProvider: TaroHistory;
|
|
22
25
|
export type { TaroWindow };
|
|
23
|
-
export
|
|
24
|
-
export declare const taroLocationProvider: TaroLocation;
|
|
25
|
-
export declare const taroHistoryProvider: TaroHistory;
|
|
26
|
+
export { taroWindowProvider, taroLocationProvider, taroHistoryProvider };
|
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
declare const PROPERTY_THRESHOLD = 2046;
|
|
2
|
+
declare const TARO_RUNTIME = "Taro runtime";
|
|
3
|
+
declare const HOOKS_APP_ID = "taro-app";
|
|
4
|
+
declare const SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
|
|
5
|
+
declare const PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
|
|
6
|
+
declare const ROOT_STR = "root";
|
|
7
|
+
declare const HTML = "html";
|
|
8
|
+
declare const HEAD = "head";
|
|
9
|
+
declare const BODY = "body";
|
|
10
|
+
declare const APP = "app";
|
|
11
|
+
declare const CONTAINER = "container";
|
|
12
|
+
declare const DOCUMENT_ELEMENT_NAME = "#document";
|
|
13
|
+
declare const DOCUMENT_FRAGMENT = "document-fragment";
|
|
14
|
+
declare const ID = "id";
|
|
15
|
+
declare const UID = "uid";
|
|
16
|
+
declare const CLASS = "class";
|
|
17
|
+
declare const STYLE = "style";
|
|
18
|
+
declare const FOCUS = "focus";
|
|
19
|
+
declare const VIEW = "view";
|
|
20
|
+
declare const STATIC_VIEW = "static-view";
|
|
21
|
+
declare const PURE_VIEW = "pure-view";
|
|
22
|
+
declare const CLICK_VIEW = "click-view";
|
|
23
|
+
declare const PROPS = "props";
|
|
24
|
+
declare const DATASET = "dataset";
|
|
25
|
+
declare const OBJECT = "object";
|
|
26
|
+
declare const VALUE = "value";
|
|
27
|
+
declare const INPUT = "input";
|
|
28
|
+
declare const CHANGE = "change";
|
|
29
|
+
declare const CUSTOM_WRAPPER = "custom-wrapper";
|
|
30
|
+
declare const TARGET = "target";
|
|
31
|
+
declare const CURRENT_TARGET = "currentTarget";
|
|
32
|
+
declare const TYPE = "type";
|
|
33
|
+
declare const CONFIRM = "confirm";
|
|
34
|
+
declare const TIME_STAMP = "timeStamp";
|
|
35
|
+
declare const KEY_CODE = "keyCode";
|
|
36
|
+
declare const TOUCHMOVE = "touchmove";
|
|
37
|
+
declare const DATE = "Date";
|
|
38
|
+
declare const SET_TIMEOUT = "setTimeout";
|
|
39
|
+
declare const COMPILE_MODE = "compileMode";
|
|
40
|
+
declare const CATCHMOVE = "catchMove";
|
|
41
|
+
declare const CATCH_VIEW = "catch-view";
|
|
42
|
+
declare const COMMENT = "comment";
|
|
43
|
+
declare const ON_LOAD = "onLoad";
|
|
44
|
+
declare const ON_READY = "onReady";
|
|
45
|
+
declare const ON_SHOW = "onShow";
|
|
46
|
+
declare const ON_HIDE = "onHide";
|
|
47
|
+
declare const OPTIONS = "options";
|
|
48
|
+
declare const EXTERNAL_CLASSES = "externalClasses";
|
|
49
|
+
declare const EVENT_CALLBACK_RESULT = "e_result";
|
|
50
|
+
declare const BEHAVIORS = "behaviors";
|
|
51
|
+
declare const A = "a";
|
|
52
52
|
/**
|
|
53
53
|
* 页面上下文切换时的行为
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
declare enum CONTEXT_ACTIONS {
|
|
56
56
|
INIT = "0",
|
|
57
57
|
RESTORE = "1",
|
|
58
58
|
RECOVER = "2",
|
|
59
59
|
DESTORY = "3"
|
|
60
60
|
}
|
|
61
|
+
export { PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, CLICK_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, COMPILE_MODE, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS };
|
package/dist/current.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppInstance, PageInstance } from
|
|
2
|
-
|
|
1
|
+
import { AppInstance, PageInstance } from "./instance-530729bd.js";
|
|
2
|
+
interface Router {
|
|
3
3
|
params: Record<string, unknown>;
|
|
4
4
|
path: string;
|
|
5
5
|
$taroPath: string;
|
|
@@ -14,6 +14,6 @@ interface Current {
|
|
|
14
14
|
page: PageInstance | null;
|
|
15
15
|
preloadData?: any;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export {};
|
|
17
|
+
declare const Current: Current;
|
|
18
|
+
declare const getCurrentInstance: () => Current;
|
|
19
|
+
export { Router, Current, getCurrentInstance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
declare class AnchorElement extends TaroElement {
|
|
3
3
|
get href(): string;
|
|
4
4
|
set href(val: string);
|
|
5
5
|
get protocol(): any;
|
|
@@ -11,3 +11,4 @@ export declare class AnchorElement extends TaroElement {
|
|
|
11
11
|
get pathname(): any;
|
|
12
12
|
setAttribute(qualifiedName: string, value: any): void;
|
|
13
13
|
}
|
|
14
|
+
export { AnchorElement };
|
package/dist/dom/class-list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
declare class ClassList {
|
|
3
3
|
private el;
|
|
4
4
|
private tokenList;
|
|
5
5
|
constructor(className: string, el: TaroElement);
|
|
@@ -14,3 +14,4 @@ export declare class ClassList {
|
|
|
14
14
|
private checkTokenIsValid;
|
|
15
15
|
private _update;
|
|
16
16
|
}
|
|
17
|
+
export { ClassList };
|
package/dist/dom/document.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import { createEvent } from
|
|
3
|
-
import { FormElement } from
|
|
4
|
-
import { TaroRootElement } from
|
|
5
|
-
import { TaroText } from
|
|
6
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
import { createEvent } from "./event.js";
|
|
3
|
+
import { FormElement } from "./form.js";
|
|
4
|
+
import { TaroRootElement } from "./root.js";
|
|
5
|
+
import { TaroText } from "./text.js";
|
|
6
|
+
declare class TaroDocument extends TaroElement {
|
|
7
7
|
documentElement: TaroElement;
|
|
8
8
|
head: TaroElement;
|
|
9
9
|
body: TaroElement;
|
|
@@ -11,11 +11,15 @@ export declare class TaroDocument extends TaroElement {
|
|
|
11
11
|
cookie?: string;
|
|
12
12
|
constructor();
|
|
13
13
|
createElement(type: string): TaroElement | TaroRootElement | FormElement;
|
|
14
|
+
// an ugly fake createElementNS to deal with @vue/runtime-dom's
|
|
15
|
+
// support mounting app to svg container since vue@3.0.8
|
|
14
16
|
createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
|
|
15
17
|
createTextNode(text: string): TaroText;
|
|
16
18
|
getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
|
|
17
19
|
querySelector<T extends TaroElement>(query: string): T | null;
|
|
18
20
|
querySelectorAll(): never[];
|
|
21
|
+
// @TODO: @PERF: 在 hydrate 移除掉空的 node
|
|
19
22
|
createComment(): TaroText;
|
|
20
23
|
get defaultView(): any;
|
|
21
24
|
}
|
|
25
|
+
export { TaroDocument };
|
package/dist/dom/element.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ClassList } from
|
|
2
|
-
import { TaroNode } from
|
|
3
|
-
import { Style } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { ClassList } from "./class-list.js";
|
|
2
|
+
import { TaroNode } from "./node.js";
|
|
3
|
+
import { Style } from "./style.js";
|
|
4
|
+
import { Attributes, TFunc } from "../index-26658829.js";
|
|
5
|
+
import { TaroEvent } from "./event.js";
|
|
6
|
+
declare class TaroElement extends TaroNode {
|
|
7
7
|
ctx?: any;
|
|
8
8
|
tagName: string;
|
|
9
9
|
props: Record<string, any>;
|
|
@@ -37,3 +37,4 @@ export declare class TaroElement extends TaroNode {
|
|
|
37
37
|
removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
|
|
38
38
|
static extend(methodName: string, options: TFunc | Record<string, any>): void;
|
|
39
39
|
}
|
|
40
|
+
export { TaroElement };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TaroNode } from "./node.js";
|
|
2
2
|
interface IEventSource extends Map<string | undefined | null, TaroNode> {
|
|
3
3
|
removeNode(child: TaroNode): void;
|
|
4
4
|
removeNodeTree(child: TaroNode): void;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
export {};
|
|
6
|
+
declare const eventSource: IEventSource;
|
|
7
|
+
export { eventSource };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { AddEventListenerOptions, EventHandler } from "../index-26658829.js";
|
|
2
|
+
declare class TaroEventTarget {
|
|
3
3
|
__handlers: Record<string, EventHandler[]>;
|
|
4
4
|
addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
|
|
5
5
|
removeEventListener(type: string, handler: EventHandler): void;
|
|
6
6
|
isAnyEventBinded(): boolean;
|
|
7
7
|
isOnlyClickBinded(): boolean;
|
|
8
8
|
}
|
|
9
|
+
export { TaroEventTarget };
|
package/dist/dom/event.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { EventOptions, MpEvent } from "../index-26658829.js";
|
|
2
|
+
import { TaroElement } from "./element.js";
|
|
3
|
+
declare class TaroEvent {
|
|
4
4
|
private cacheTarget;
|
|
5
5
|
private cacheCurrentTarget;
|
|
6
6
|
type: string;
|
|
@@ -19,5 +19,6 @@ export declare class TaroEvent {
|
|
|
19
19
|
get target(): any;
|
|
20
20
|
get currentTarget(): any;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
23
|
+
declare function eventHandler(event: MpEvent): any;
|
|
24
|
+
export { TaroEvent, createEvent, eventHandler };
|
package/dist/dom/form.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
import { TaroEvent } from "./event.js";
|
|
3
|
+
declare class FormElement extends TaroElement {
|
|
4
4
|
get type(): string;
|
|
5
5
|
set type(val: string);
|
|
6
6
|
get value(): string | boolean | number | any[];
|
|
7
7
|
set value(val: string | boolean | number | any[]);
|
|
8
8
|
dispatchEvent(event: TaroEvent): boolean;
|
|
9
9
|
}
|
|
10
|
+
export { FormElement };
|
package/dist/dom/node.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { TaroEventTarget } from
|
|
2
|
-
import { NodeType } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { TaroEventTarget } from "./event-target.js";
|
|
2
|
+
import { NodeType } from "../node_types-9ac5b4dd.js";
|
|
3
|
+
import { TFunc, UpdatePayload } from "../index-26658829.js";
|
|
4
|
+
import { TaroDocument } from "./document.js";
|
|
5
|
+
import { TaroElement } from "./element.js";
|
|
6
|
+
import { TaroRootElement } from "./root.js";
|
|
7
7
|
interface RemoveChildOptions {
|
|
8
8
|
cleanRef?: boolean;
|
|
9
9
|
doUpdate?: boolean;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
declare class TaroNode extends TaroEventTarget {
|
|
12
12
|
uid: string;
|
|
13
13
|
sid: string;
|
|
14
14
|
nodeType: NodeType;
|
|
@@ -32,6 +32,14 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
32
32
|
* @TODO 等待完整 innerHTML 实现
|
|
33
33
|
*/
|
|
34
34
|
set textContent(text: string);
|
|
35
|
+
/**
|
|
36
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
|
|
37
|
+
* @scenario
|
|
38
|
+
* [A,B,C]
|
|
39
|
+
* 1. insert D before C, D has no parent
|
|
40
|
+
* 2. insert D before C, D has the same parent of C
|
|
41
|
+
* 3. insert D before C, D has the different parent of C
|
|
42
|
+
*/
|
|
35
43
|
/**
|
|
36
44
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
|
|
37
45
|
* @scenario
|
|
@@ -41,6 +49,14 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
41
49
|
* 3. insert D before C, D has the different parent of C
|
|
42
50
|
*/
|
|
43
51
|
insertBefore<T extends TaroNode>(newChild: T, refChild?: TaroNode | null, isReplace?: boolean): T;
|
|
52
|
+
/**
|
|
53
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
|
|
54
|
+
* @scenario
|
|
55
|
+
* [A,B,C]
|
|
56
|
+
* 1. append C, C has no parent
|
|
57
|
+
* 2. append C, C has the same parent of B
|
|
58
|
+
* 3. append C, C has the different parent of B
|
|
59
|
+
*/
|
|
44
60
|
/**
|
|
45
61
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
|
|
46
62
|
* @scenario
|
|
@@ -50,6 +66,14 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
50
66
|
* 3. append C, C has the different parent of B
|
|
51
67
|
*/
|
|
52
68
|
appendChild(newChild: TaroNode): TaroNode;
|
|
69
|
+
/**
|
|
70
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
|
|
71
|
+
* @scenario
|
|
72
|
+
* [A,B,C]
|
|
73
|
+
* 1. replace B with C, C has no parent
|
|
74
|
+
* 2. replace B with C, C has no parent, C has the same parent of B
|
|
75
|
+
* 3. replace B with C, C has no parent, C has the different parent of B
|
|
76
|
+
*/
|
|
53
77
|
/**
|
|
54
78
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
|
|
55
79
|
* @scenario
|
|
@@ -59,6 +83,13 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
59
83
|
* 3. replace B with C, C has no parent, C has the different parent of B
|
|
60
84
|
*/
|
|
61
85
|
replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
|
|
88
|
+
* @scenario
|
|
89
|
+
* [A,B,C]
|
|
90
|
+
* 1. remove A or B
|
|
91
|
+
* 2. remove C
|
|
92
|
+
*/
|
|
62
93
|
/**
|
|
63
94
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
|
|
64
95
|
* @scenario
|
|
@@ -73,4 +104,4 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
73
104
|
get ownerDocument(): TaroDocument;
|
|
74
105
|
static extend(methodName: string, options: TFunc | Record<string, any>): void;
|
|
75
106
|
}
|
|
76
|
-
export {};
|
|
107
|
+
export { TaroNode };
|
package/dist/dom/root.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
import { MpInstance, TFunc, UpdatePayload } from "../index-26658829.js";
|
|
3
|
+
declare class TaroRootElement extends TaroElement {
|
|
4
4
|
private updatePayloads;
|
|
5
5
|
private updateCallbacks;
|
|
6
6
|
pendingUpdate: boolean;
|
|
@@ -14,3 +14,4 @@ export declare class TaroRootElement extends TaroElement {
|
|
|
14
14
|
enqueueUpdateCallback(cb: TFunc, ctx?: Record<string, any>): void;
|
|
15
15
|
flushUpdateCallback(): void;
|
|
16
16
|
}
|
|
17
|
+
export { TaroRootElement };
|
package/dist/dom/style.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
declare class Style {
|
|
3
3
|
_pending: boolean;
|
|
4
4
|
_usedStyleProp: Set<string>;
|
|
5
5
|
_value: Partial<CSSStyleDeclaration>;
|
|
@@ -12,3 +12,4 @@ export declare class Style {
|
|
|
12
12
|
removeProperty(propertyName: string): string;
|
|
13
13
|
getPropertyValue(propertyName: string): any;
|
|
14
14
|
}
|
|
15
|
+
export { Style };
|
package/dist/dom/svg.d.ts
CHANGED
package/dist/dom/text.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TaroNode } from
|
|
2
|
-
import { NodeType } from
|
|
3
|
-
|
|
1
|
+
import { TaroNode } from "./node.js";
|
|
2
|
+
import { NodeType } from "../node_types-9ac5b4dd.js";
|
|
3
|
+
declare class TaroText extends TaroNode {
|
|
4
4
|
_value: string;
|
|
5
5
|
nodeType: NodeType;
|
|
6
6
|
nodeName: string;
|
|
@@ -12,3 +12,4 @@ export declare class TaroText extends TaroNode {
|
|
|
12
12
|
set data(text: string);
|
|
13
13
|
get data(): string;
|
|
14
14
|
}
|
|
15
|
+
export { TaroText };
|
package/dist/dom/transfer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
|
+
declare class TransferElement extends TaroElement {
|
|
3
3
|
dataName: string;
|
|
4
4
|
isTransferElement: boolean;
|
|
5
5
|
constructor(dataName: string);
|
|
6
6
|
get _path(): string;
|
|
7
7
|
}
|
|
8
|
+
export { TransferElement };
|
package/dist/dom/tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TaroElement } from "./element.js";
|
|
2
2
|
type Filter = (element: TaroElement) => boolean;
|
|
3
|
-
|
|
4
|
-
export {};
|
|
3
|
+
declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
|
|
4
|
+
export { treeToArray };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { TaroElement } from "../dom/element.js";
|
|
2
|
+
declare function getBoundingClientRectImpl(this: TaroElement): Promise<null>;
|
|
3
|
+
declare function getTemplateContent(ctx: TaroElement): TaroElement | undefined;
|
|
4
|
+
export { getBoundingClientRectImpl, getTemplateContent };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TaroNode } from "../../dom/node.js";
|
|
2
|
+
declare function setInnerHTML(element: TaroNode, html: string): void;
|
|
3
|
+
export { setInnerHTML };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TaroDocument } from "../../dom/document.js";
|
|
2
|
+
import { TaroElement } from "../../dom/element.js";
|
|
3
3
|
interface Node {
|
|
4
4
|
type: string;
|
|
5
5
|
}
|
|
@@ -7,19 +7,19 @@ interface Comment extends Node {
|
|
|
7
7
|
type: 'comment';
|
|
8
8
|
content: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface Text extends Node {
|
|
11
11
|
type: 'text';
|
|
12
12
|
content: string;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
interface Element extends Node {
|
|
15
15
|
type: 'element';
|
|
16
16
|
tagName: string;
|
|
17
17
|
children: ChildNode[];
|
|
18
18
|
attributes: string[];
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
interface ParsedTaroElement extends TaroElement {
|
|
21
21
|
h5tagName?: string;
|
|
22
22
|
}
|
|
23
23
|
type ChildNode = Comment | Text | Element;
|
|
24
|
-
|
|
25
|
-
export {};
|
|
24
|
+
declare function parser(html: string, document: TaroDocument): (import("../../index.js").TaroText | TaroElement)[];
|
|
25
|
+
export { Text, Element, ParsedTaroElement, parser };
|