@tarojs/runtime 4.0.12 → 4.0.13-alpha.1
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 +3 -6
- package/dist/bom/URLSearchParams.d.ts +1 -2
- package/dist/bom/document.d.ts +2 -3
- package/dist/bom/getComputedStyle.d.ts +4 -5
- package/dist/bom/history.d.ts +5 -7
- package/dist/bom/location.d.ts +3 -5
- package/dist/bom/navigator.d.ts +1 -2
- package/dist/bom/raf.d.ts +2 -2
- package/dist/bom/window.d.ts +8 -9
- package/dist/constants/index.d.ts +52 -53
- package/dist/current.d.ts +5 -5
- package/dist/dom/anchor-element.d.ts +2 -3
- package/dist/dom/class-list.d.ts +2 -3
- package/dist/dom/document.d.ts +6 -10
- package/dist/dom/element.d.ts +6 -7
- package/dist/dom/event-source.d.ts +3 -3
- package/dist/dom/event-target.d.ts +2 -3
- package/dist/dom/event.d.ts +5 -6
- package/dist/dom/form.d.ts +3 -4
- package/dist/dom/node.d.ts +8 -39
- package/dist/{node_types-9ac5b4dd.d.ts → dom/node_types.d.ts} +1 -2
- package/dist/dom/root.d.ts +3 -4
- package/dist/dom/style.d.ts +2 -3
- package/dist/dom/style_properties.js +1 -0
- package/dist/dom/style_properties.js.map +1 -1
- package/dist/dom/svg.d.ts +2 -3
- package/dist/dom/text.d.ts +3 -4
- package/dist/dom/transfer.d.ts +2 -3
- package/dist/dom/tree.d.ts +3 -3
- package/dist/dom-external/element.d.ts +3 -4
- package/dist/dom-external/inner-html/html.d.ts +2 -3
- 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 +5 -6
- package/dist/dom-external/inner-html/utils.d.ts +1 -2
- package/dist/dom-external/mutation-observer/implements.d.ts +6 -25
- package/dist/dom-external/mutation-observer/index.d.ts +6 -5
- package/dist/{record-32b054d8.d.ts → dom-external/mutation-observer/record.d.ts} +3 -4
- package/dist/dom-external/node.d.ts +5 -6
- package/dist/dsl/common.d.ts +14 -15
- package/dist/{instance-530729bd.d.ts → dsl/instance.d.ts} +13 -14
- package/dist/emitter/emitter.d.ts +2 -2
- package/dist/env.d.ts +2 -2
- package/dist/hydrate.d.ts +4 -5
- package/dist/index.cjs.js +5 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +33 -32
- package/dist/interface/element.d.ts +4 -0
- package/dist/interface/event-target.d.ts +11 -0
- package/dist/interface/event.d.ts +15 -0
- package/dist/interface/hydrate.d.ts +29 -0
- package/dist/interface/index.d.ts +7 -0
- package/dist/interface/node.d.ts +7 -0
- package/dist/{options-530729bd.d.ts → interface/options.d.ts} +4 -5
- package/dist/interface/utils.d.ts +2 -0
- package/dist/next-tick.d.ts +2 -3
- package/dist/options.d.ts +2 -3
- package/dist/perf.d.ts +2 -2
- package/dist/polyfill/array.d.ts +2 -3
- package/dist/polyfill/intersection-observer.d.ts +1 -2
- package/dist/polyfill/object.d.ts +3 -4
- package/dist/runtime.esm.js +1 -0
- package/dist/runtime.esm.js.map +1 -1
- package/dist/utils/cache.d.ts +1 -2
- package/dist/utils/index.d.ts +17 -18
- package/dist/utils/lodash.d.ts +2 -3
- package/dist/utils/router.d.ts +7 -8
- package/package.json +7 -5
- package/dist/index-26658829.d.ts +0 -23
- package/dist/index.cjs.d.ts +0 -813
- package/dist/runtime.esm.d.ts +0 -813
package/dist/bom/URL.d.ts
CHANGED
|
@@ -22,10 +22,8 @@ declare class TaroURL {
|
|
|
22
22
|
get origin(): string;
|
|
23
23
|
set origin(val: string);
|
|
24
24
|
get searchParams(): URLSearchParams;
|
|
25
|
-
// public method
|
|
26
25
|
toString(): string;
|
|
27
26
|
toJSON(): string;
|
|
28
|
-
// convenient for deconstructor
|
|
29
27
|
_toRaw(): {
|
|
30
28
|
protocol: string;
|
|
31
29
|
port: string;
|
|
@@ -38,8 +36,9 @@ declare class TaroURL {
|
|
|
38
36
|
href: string;
|
|
39
37
|
};
|
|
40
38
|
}
|
|
41
|
-
|
|
42
|
-
declare
|
|
39
|
+
export type { TaroURL };
|
|
40
|
+
export declare const TaroURLProvider: typeof TaroURL;
|
|
41
|
+
export declare function parseUrl(url?: string): {
|
|
43
42
|
href: string;
|
|
44
43
|
origin: string;
|
|
45
44
|
protocol: string;
|
|
@@ -50,5 +49,3 @@ declare function parseUrl(url?: string): {
|
|
|
50
49
|
search: string;
|
|
51
50
|
hash: string;
|
|
52
51
|
};
|
|
53
|
-
export type { TaroURL };
|
|
54
|
-
export { TaroURLProvider, parseUrl };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const URLSearchParams: any;
|
|
2
|
-
export { URLSearchParams };
|
|
1
|
+
export declare const URLSearchParams: any;
|
package/dist/bom/document.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { TaroDocument } from
|
|
2
|
-
declare const taroDocumentProvider: TaroDocument;
|
|
3
|
-
export { taroDocumentProvider };
|
|
1
|
+
import { TaroDocument } from '../dom/document';
|
|
2
|
+
export declare const taroDocumentProvider: TaroDocument;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import { Style } from
|
|
3
|
-
type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
|
|
4
|
-
declare const taroGetComputedStyleProvider: TGetComputedStyle;
|
|
5
|
-
export { TGetComputedStyle, taroGetComputedStyleProvider };
|
|
1
|
+
import type { TaroElement } from '../dom/element';
|
|
2
|
+
import type { Style } from '../dom/style';
|
|
3
|
+
export type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
|
|
4
|
+
export declare const taroGetComputedStyleProvider: TGetComputedStyle;
|
package/dist/bom/history.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Events } from
|
|
2
|
-
import { RuntimeCache } from
|
|
3
|
-
import { TaroLocation } from
|
|
4
|
-
interface HistoryState {
|
|
1
|
+
import { Events } from '../emitter/emitter';
|
|
2
|
+
import { RuntimeCache } from '../utils/cache';
|
|
3
|
+
import type { TaroLocation } from './location';
|
|
4
|
+
export interface HistoryState {
|
|
5
5
|
state: Record<string, any> | null;
|
|
6
6
|
title: string;
|
|
7
7
|
url: string;
|
|
@@ -19,7 +19,6 @@ 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 */
|
|
23
22
|
go(delta: number): void;
|
|
24
23
|
back(): void;
|
|
25
24
|
forward(): void;
|
|
@@ -27,6 +26,5 @@ declare class TaroHistory extends Events {
|
|
|
27
26
|
replaceState(state: any, title: string, url: string): void;
|
|
28
27
|
get cache(): RuntimeCache<HistoryContext>;
|
|
29
28
|
}
|
|
30
|
-
declare const History: typeof TaroHistory;
|
|
31
|
-
export { HistoryState, History };
|
|
32
29
|
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';
|
|
2
|
+
import { RuntimeCache } from '../utils/cache';
|
|
3
3
|
type Options = {
|
|
4
4
|
window: any;
|
|
5
5
|
};
|
|
@@ -27,13 +27,11 @@ 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 */
|
|
31
30
|
assign(): void;
|
|
32
31
|
reload(): void;
|
|
33
32
|
replace(url: string): void;
|
|
34
33
|
toString(): string;
|
|
35
34
|
get cache(): RuntimeCache<LocationContext>;
|
|
36
35
|
}
|
|
37
|
-
declare const Location: typeof TaroLocation;
|
|
38
36
|
export type { TaroLocation };
|
|
39
|
-
export
|
|
37
|
+
export declare const Location: typeof TaroLocation;
|
package/dist/bom/navigator.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
declare const nav: typeof window.navigator;
|
|
2
|
-
export { nav };
|
|
1
|
+
export declare const nav: typeof window.navigator;
|
package/dist/bom/raf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
declare let now: () => number;
|
|
2
|
+
export declare let now: () => number;
|
|
3
3
|
declare const _raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
4
4
|
declare const _caf: typeof cancelAnimationFrame;
|
|
5
|
-
export {
|
|
5
|
+
export { _caf as caf, _raf as raf };
|
package/dist/bom/window.d.ts
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Events } from
|
|
3
|
-
import { TaroHistory } from
|
|
4
|
-
import { TaroLocation } from
|
|
2
|
+
import { Events } from '../emitter/emitter';
|
|
3
|
+
import type { TaroHistory } from './history';
|
|
4
|
+
import type { TaroLocation } from './location';
|
|
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
|
|
9
|
+
getComputedStyle: import("./getComputedStyle").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
|
|
16
|
+
get document(): import("../dom/document").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;
|
|
25
22
|
export type { TaroWindow };
|
|
26
|
-
export
|
|
23
|
+
export declare const taroWindowProvider: TaroWindow;
|
|
24
|
+
export declare const taroLocationProvider: TaroLocation;
|
|
25
|
+
export declare const taroHistoryProvider: TaroHistory;
|
|
@@ -1,61 +1,60 @@
|
|
|
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";
|
|
1
|
+
export declare const PROPERTY_THRESHOLD = 2046;
|
|
2
|
+
export declare const TARO_RUNTIME = "Taro runtime";
|
|
3
|
+
export declare const HOOKS_APP_ID = "taro-app";
|
|
4
|
+
export declare const SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
|
|
5
|
+
export declare const PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
|
|
6
|
+
export declare const ROOT_STR = "root";
|
|
7
|
+
export declare const HTML = "html";
|
|
8
|
+
export declare const HEAD = "head";
|
|
9
|
+
export declare const BODY = "body";
|
|
10
|
+
export declare const APP = "app";
|
|
11
|
+
export declare const CONTAINER = "container";
|
|
12
|
+
export declare const DOCUMENT_ELEMENT_NAME = "#document";
|
|
13
|
+
export declare const DOCUMENT_FRAGMENT = "document-fragment";
|
|
14
|
+
export declare const ID = "id";
|
|
15
|
+
export declare const UID = "uid";
|
|
16
|
+
export declare const CLASS = "class";
|
|
17
|
+
export declare const STYLE = "style";
|
|
18
|
+
export declare const FOCUS = "focus";
|
|
19
|
+
export declare const VIEW = "view";
|
|
20
|
+
export declare const STATIC_VIEW = "static-view";
|
|
21
|
+
export declare const PURE_VIEW = "pure-view";
|
|
22
|
+
export declare const CLICK_VIEW = "click-view";
|
|
23
|
+
export declare const PROPS = "props";
|
|
24
|
+
export declare const DATASET = "dataset";
|
|
25
|
+
export declare const OBJECT = "object";
|
|
26
|
+
export declare const VALUE = "value";
|
|
27
|
+
export declare const INPUT = "input";
|
|
28
|
+
export declare const CHANGE = "change";
|
|
29
|
+
export declare const CUSTOM_WRAPPER = "custom-wrapper";
|
|
30
|
+
export declare const TARGET = "target";
|
|
31
|
+
export declare const CURRENT_TARGET = "currentTarget";
|
|
32
|
+
export declare const TYPE = "type";
|
|
33
|
+
export declare const CONFIRM = "confirm";
|
|
34
|
+
export declare const TIME_STAMP = "timeStamp";
|
|
35
|
+
export declare const KEY_CODE = "keyCode";
|
|
36
|
+
export declare const TOUCHMOVE = "touchmove";
|
|
37
|
+
export declare const DATE = "Date";
|
|
38
|
+
export declare const SET_TIMEOUT = "setTimeout";
|
|
39
|
+
export declare const COMPILE_MODE = "compileMode";
|
|
40
|
+
export declare const CATCHMOVE = "catchMove";
|
|
41
|
+
export declare const CATCH_VIEW = "catch-view";
|
|
42
|
+
export declare const COMMENT = "comment";
|
|
43
|
+
export declare const ON_LOAD = "onLoad";
|
|
44
|
+
export declare const ON_READY = "onReady";
|
|
45
|
+
export declare const ON_SHOW = "onShow";
|
|
46
|
+
export declare const ON_HIDE = "onHide";
|
|
47
|
+
export declare const OPTIONS = "options";
|
|
48
|
+
export declare const EXTERNAL_CLASSES = "externalClasses";
|
|
49
|
+
export declare const EVENT_CALLBACK_RESULT = "e_result";
|
|
50
|
+
export declare const BEHAVIORS = "behaviors";
|
|
51
|
+
export declare const A = "a";
|
|
52
52
|
/**
|
|
53
53
|
* 页面上下文切换时的行为
|
|
54
54
|
*/
|
|
55
|
-
declare enum CONTEXT_ACTIONS {
|
|
55
|
+
export 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
|
-
interface Router {
|
|
1
|
+
import { AppInstance, PageInstance } from './dsl/instance';
|
|
2
|
+
export 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
|
-
declare const Current: Current;
|
|
18
|
-
declare const getCurrentInstance: () => Current;
|
|
19
|
-
export {
|
|
17
|
+
export declare const Current: Current;
|
|
18
|
+
export declare const getCurrentInstance: () => Current;
|
|
19
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
declare class AnchorElement extends TaroElement {
|
|
1
|
+
import { TaroElement } from './element';
|
|
2
|
+
export declare class AnchorElement extends TaroElement {
|
|
3
3
|
get href(): string;
|
|
4
4
|
set href(val: string);
|
|
5
5
|
get protocol(): any;
|
|
@@ -11,4 +11,3 @@ 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 { TaroElement } from
|
|
2
|
-
declare class ClassList {
|
|
1
|
+
import type { TaroElement } from './element';
|
|
2
|
+
export declare class ClassList {
|
|
3
3
|
private el;
|
|
4
4
|
private tokenList;
|
|
5
5
|
constructor(className: string, el: TaroElement);
|
|
@@ -14,4 +14,3 @@ 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
|
-
declare class TaroDocument extends TaroElement {
|
|
1
|
+
import { TaroElement } from '../dom/element';
|
|
2
|
+
import { createEvent } from '../dom/event';
|
|
3
|
+
import { FormElement } from '../dom/form';
|
|
4
|
+
import { TaroRootElement } from '../dom/root';
|
|
5
|
+
import { TaroText } from '../dom/text';
|
|
6
|
+
export declare class TaroDocument extends TaroElement {
|
|
7
7
|
documentElement: TaroElement;
|
|
8
8
|
head: TaroElement;
|
|
9
9
|
body: TaroElement;
|
|
@@ -11,15 +11,11 @@ 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
|
|
16
14
|
createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
|
|
17
15
|
createTextNode(text: string): TaroText;
|
|
18
16
|
getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
|
|
19
17
|
querySelector<T extends TaroElement>(query: string): T | null;
|
|
20
18
|
querySelectorAll(): never[];
|
|
21
|
-
// @TODO: @PERF: 在 hydrate 移除掉空的 node
|
|
22
19
|
createComment(): TaroText;
|
|
23
20
|
get defaultView(): any;
|
|
24
21
|
}
|
|
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 { Attributes, TFunc } from
|
|
5
|
-
import { TaroEvent } from
|
|
6
|
-
declare class TaroElement extends TaroNode {
|
|
1
|
+
import { ClassList } from './class-list';
|
|
2
|
+
import { TaroNode } from './node';
|
|
3
|
+
import { Style } from './style';
|
|
4
|
+
import type { Attributes, TFunc } from '../interface';
|
|
5
|
+
import type { TaroEvent } from './event';
|
|
6
|
+
export declare class TaroElement extends TaroNode {
|
|
7
7
|
ctx?: any;
|
|
8
8
|
tagName: string;
|
|
9
9
|
props: Record<string, any>;
|
|
@@ -37,4 +37,3 @@ 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 { TaroNode } from
|
|
1
|
+
import type { TaroNode } from './node';
|
|
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
|
-
declare const eventSource: IEventSource;
|
|
7
|
-
export {
|
|
6
|
+
export declare const eventSource: IEventSource;
|
|
7
|
+
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { AddEventListenerOptions, EventHandler } from
|
|
2
|
-
declare class TaroEventTarget {
|
|
1
|
+
import type { AddEventListenerOptions, EventHandler } from '../interface';
|
|
2
|
+
export 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 { EventOptions, MpEvent } from
|
|
2
|
-
import { TaroElement } from
|
|
3
|
-
declare class TaroEvent {
|
|
1
|
+
import type { EventOptions, MpEvent } from '../interface';
|
|
2
|
+
import type { TaroElement } from './element';
|
|
3
|
+
export declare class TaroEvent {
|
|
4
4
|
private cacheTarget;
|
|
5
5
|
private cacheCurrentTarget;
|
|
6
6
|
type: string;
|
|
@@ -19,6 +19,5 @@ declare class TaroEvent {
|
|
|
19
19
|
get target(): any;
|
|
20
20
|
get currentTarget(): any;
|
|
21
21
|
}
|
|
22
|
-
declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
23
|
-
declare function eventHandler(event: MpEvent): any;
|
|
24
|
-
export { TaroEvent, createEvent, eventHandler };
|
|
22
|
+
export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
23
|
+
export declare function eventHandler(event: MpEvent): any;
|
package/dist/dom/form.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import { TaroEvent } from
|
|
3
|
-
declare class FormElement extends TaroElement {
|
|
1
|
+
import { TaroElement } from './element';
|
|
2
|
+
import type { TaroEvent } from './event';
|
|
3
|
+
export 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 { TFunc, UpdatePayload } from
|
|
4
|
-
import { TaroDocument } from
|
|
5
|
-
import { TaroElement } from
|
|
6
|
-
import { TaroRootElement } from
|
|
1
|
+
import { TaroEventTarget } from './event-target';
|
|
2
|
+
import { NodeType } from './node_types';
|
|
3
|
+
import type { TFunc, UpdatePayload } from '../interface';
|
|
4
|
+
import type { TaroDocument } from './document';
|
|
5
|
+
import type { TaroElement } from './element';
|
|
6
|
+
import type { TaroRootElement } from './root';
|
|
7
7
|
interface RemoveChildOptions {
|
|
8
8
|
cleanRef?: boolean;
|
|
9
9
|
doUpdate?: boolean;
|
|
10
10
|
}
|
|
11
|
-
declare class TaroNode extends TaroEventTarget {
|
|
11
|
+
export declare class TaroNode extends TaroEventTarget {
|
|
12
12
|
uid: string;
|
|
13
13
|
sid: string;
|
|
14
14
|
nodeType: NodeType;
|
|
@@ -32,14 +32,6 @@ 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
|
-
*/
|
|
43
35
|
/**
|
|
44
36
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
|
|
45
37
|
* @scenario
|
|
@@ -49,14 +41,6 @@ declare class TaroNode extends TaroEventTarget {
|
|
|
49
41
|
* 3. insert D before C, D has the different parent of C
|
|
50
42
|
*/
|
|
51
43
|
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
|
-
*/
|
|
60
44
|
/**
|
|
61
45
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
|
|
62
46
|
* @scenario
|
|
@@ -66,14 +50,6 @@ declare class TaroNode extends TaroEventTarget {
|
|
|
66
50
|
* 3. append C, C has the different parent of B
|
|
67
51
|
*/
|
|
68
52
|
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
|
-
*/
|
|
77
53
|
/**
|
|
78
54
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
|
|
79
55
|
* @scenario
|
|
@@ -83,13 +59,6 @@ declare class TaroNode extends TaroEventTarget {
|
|
|
83
59
|
* 3. replace B with C, C has no parent, C has the different parent of B
|
|
84
60
|
*/
|
|
85
61
|
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
|
-
*/
|
|
93
62
|
/**
|
|
94
63
|
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
|
|
95
64
|
* @scenario
|
|
@@ -104,4 +73,4 @@ declare class TaroNode extends TaroEventTarget {
|
|
|
104
73
|
get ownerDocument(): TaroDocument;
|
|
105
74
|
static extend(methodName: string, options: TFunc | Record<string, any>): void;
|
|
106
75
|
}
|
|
107
|
-
export {
|
|
76
|
+
export {};
|
package/dist/dom/root.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TaroElement } from
|
|
2
|
-
import { MpInstance, TFunc, UpdatePayload } from
|
|
3
|
-
declare class TaroRootElement extends TaroElement {
|
|
1
|
+
import { TaroElement } from './element';
|
|
2
|
+
import type { MpInstance, TFunc, UpdatePayload } from '../interface';
|
|
3
|
+
export declare class TaroRootElement extends TaroElement {
|
|
4
4
|
private updatePayloads;
|
|
5
5
|
private updateCallbacks;
|
|
6
6
|
pendingUpdate: boolean;
|
|
@@ -14,4 +14,3 @@ 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
|
-
declare class Style {
|
|
1
|
+
import { TaroElement } from './element';
|
|
2
|
+
export declare class Style {
|
|
3
3
|
_pending: boolean;
|
|
4
4
|
_usedStyleProp: Set<string>;
|
|
5
5
|
_value: Partial<CSSStyleDeclaration>;
|
|
@@ -12,4 +12,3 @@ declare class Style {
|
|
|
12
12
|
removeProperty(propertyName: string): string;
|
|
13
13
|
getPropertyValue(propertyName: string): any;
|
|
14
14
|
}
|
|
15
|
-
export { Style };
|