@tarojs/runtime 4.1.0-alpha.3 → 4.1.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/index.cjs.js
CHANGED
|
@@ -5091,12 +5091,12 @@ if (process.env.SUPPORT_TARO_POLYFILL !== 'disabled' && process.env.TARO_PLATFOR
|
|
|
5091
5091
|
}
|
|
5092
5092
|
|
|
5093
5093
|
Object.defineProperty(exports, "Events", {
|
|
5094
|
-
|
|
5095
|
-
|
|
5094
|
+
enumerable: true,
|
|
5095
|
+
get: function () { return shared.Events; }
|
|
5096
5096
|
});
|
|
5097
5097
|
Object.defineProperty(exports, "hooks", {
|
|
5098
|
-
|
|
5099
|
-
|
|
5098
|
+
enumerable: true,
|
|
5099
|
+
get: function () { return shared.hooks; }
|
|
5100
5100
|
});
|
|
5101
5101
|
exports.A = A;
|
|
5102
5102
|
exports.APP = APP;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import env from './env';
|
|
1
|
+
import env from "./env.js";
|
|
3
2
|
export { hooks } from '@tarojs/shared';
|
|
4
|
-
export { taroDocumentProvider as document } from
|
|
5
|
-
export { taroGetComputedStyleProvider as getComputedStyle } from
|
|
6
|
-
export { History } from
|
|
7
|
-
export { Location } from
|
|
8
|
-
export { nav as navigator } from
|
|
9
|
-
export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from
|
|
10
|
-
export { parseUrl, TaroURLProvider as URL } from
|
|
11
|
-
export { URLSearchParams } from
|
|
12
|
-
export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from
|
|
13
|
-
export { TaroElement } from
|
|
14
|
-
export { createEvent, eventHandler, TaroEvent } from
|
|
15
|
-
export { FormElement } from
|
|
16
|
-
export { TaroNode } from
|
|
17
|
-
export { TaroRootElement } from
|
|
18
|
-
export { Style } from
|
|
19
|
-
export { SVGElement } from
|
|
20
|
-
export { TaroText } from
|
|
21
|
-
export { MutationObserver } from
|
|
3
|
+
export { taroDocumentProvider as document } from "./bom/document.js";
|
|
4
|
+
export { taroGetComputedStyleProvider as getComputedStyle } from "./bom/getComputedStyle.js";
|
|
5
|
+
export { History } from "./bom/history.js";
|
|
6
|
+
export { Location } from "./bom/location.js";
|
|
7
|
+
export { nav as navigator } from "./bom/navigator.js";
|
|
8
|
+
export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from "./bom/raf.js";
|
|
9
|
+
export { parseUrl, TaroURLProvider as URL } from "./bom/URL.js";
|
|
10
|
+
export { URLSearchParams } from "./bom/URLSearchParams.js";
|
|
11
|
+
export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from "./bom/window.js";
|
|
12
|
+
export { TaroElement } from "./dom/element.js";
|
|
13
|
+
export { createEvent, eventHandler, TaroEvent } from "./dom/event.js";
|
|
14
|
+
export { FormElement } from "./dom/form.js";
|
|
15
|
+
export { TaroNode } from "./dom/node.js";
|
|
16
|
+
export { TaroRootElement } from "./dom/root.js";
|
|
17
|
+
export { Style } from "./dom/style.js";
|
|
18
|
+
export { SVGElement } from "./dom/svg.js";
|
|
19
|
+
export { TaroText } from "./dom/text.js";
|
|
20
|
+
export { MutationObserver } from "./dom-external/mutation-observer/index.js";
|
|
22
21
|
export { env };
|
|
23
|
-
export * from
|
|
24
|
-
export { Current, getCurrentInstance } from
|
|
25
|
-
export { eventSource } from
|
|
26
|
-
export { createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify } from
|
|
27
|
-
export * from
|
|
28
|
-
export { hydrate } from
|
|
29
|
-
export { nextTick } from
|
|
30
|
-
export { options } from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
22
|
+
export * from "./constants/index.js";
|
|
23
|
+
export { Current, getCurrentInstance } from "./current.js";
|
|
24
|
+
export { eventSource } from "./dom/event-source.js";
|
|
25
|
+
export { createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify } from "./dsl/common.js";
|
|
26
|
+
export * from "./emitter/emitter.js";
|
|
27
|
+
export { hydrate } from "./hydrate.js";
|
|
28
|
+
export { nextTick } from "./next-tick.js";
|
|
29
|
+
export { options } from "./options.js";
|
|
30
|
+
export * from "./perf.js";
|
|
31
|
+
export * from "./utils/index.js";
|
|
32
|
+
export * from "./instance-530729bd.js";
|
|
33
|
+
export * from "./index-26658829.js";
|
|
34
|
+
export * from "./polyfill/index.js";
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Component as Vue3Component } from '@vue/runtime-core';
|
|
3
|
+
import { Component, ComponentClass } from 'react';
|
|
4
|
+
import { TaroElement } from "./dom/element.js";
|
|
5
|
+
import { MpEvent, TFunc } from "./index-26658829.js";
|
|
6
|
+
interface Instance<T = Record<string, any>> extends Component<T>, Show, PageInstance {
|
|
6
7
|
tid?: string;
|
|
7
8
|
node?: TaroElement;
|
|
8
9
|
$forceUpdate?(): void;
|
|
9
10
|
$nextTick?(cb: () => void): void;
|
|
10
11
|
$options: Instance;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
interface PageProps {
|
|
13
14
|
tid?: string;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
|
|
18
19
|
componentDidShow?(): void;
|
|
19
20
|
componentDidHide?(): void;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
interface PageLifeCycle extends Show {
|
|
24
25
|
eh?(event: MpEvent): void;
|
|
25
26
|
onAddToFavorites?(): void;
|
|
26
27
|
onLoad?(options: Record<string, unknown>, cb?: TFunc): void;
|
|
@@ -49,7 +50,7 @@ export interface PageLifeCycle extends Show {
|
|
|
49
50
|
onTitleClick?(): void;
|
|
50
51
|
onUnload?(): void;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
interface PageInstance extends PageLifeCycle {
|
|
53
54
|
/** 页面的初始数据 */
|
|
54
55
|
data?: Record<string, unknown>;
|
|
55
56
|
/** 页面路径 */
|
|
@@ -67,7 +68,7 @@ interface Show {
|
|
|
67
68
|
onShow?(): void;
|
|
68
69
|
onHide?(): void;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
interface AppInstance extends Show {
|
|
71
72
|
componentDidShow?(options?: Record<string, unknown>): void;
|
|
72
73
|
mount?(component: React.ComponentClass | Vue3Component, id: string, cb: (...args: any[]) => void): void;
|
|
73
74
|
mount?(component: React.ComponentClass | Vue3Component, id: string, getCtx: (...args: any[]) => void, cb: (...args: any[]) => void): void;
|
|
@@ -81,4 +82,4 @@ export interface AppInstance extends Show {
|
|
|
81
82
|
taroGlobalData?: Record<any, any>;
|
|
82
83
|
config?: Record<any, any>;
|
|
83
84
|
}
|
|
84
|
-
export {};
|
|
85
|
+
export { Instance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance };
|
package/dist/next-tick.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TFunc } from "./index-26658829.js";
|
|
2
|
+
declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
|
|
3
|
+
export { nextTick };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
declare const enum NodeType {
|
|
2
2
|
ELEMENT_NODE = 1,
|
|
3
3
|
ATTRIBUTE_NODE = 2,
|
|
4
4
|
TEXT_NODE = 3,
|
|
@@ -8,3 +8,4 @@ export declare const enum NodeType {
|
|
|
8
8
|
PROCESSING_INSTRUCTION_NODE = 7,
|
|
9
9
|
DOCUMENT_NODE = 9
|
|
10
10
|
}
|
|
11
|
+
export { NodeType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { TaroElement } from "./dom/element.js";
|
|
2
|
+
import { TaroText } from "./dom/text.js";
|
|
3
|
+
import { Element, Text } from "./dom-external/inner-html/parser.js";
|
|
4
|
+
interface Options {
|
|
5
5
|
prerender: boolean;
|
|
6
6
|
debug: boolean;
|
|
7
7
|
html?: {
|
|
@@ -14,3 +14,4 @@ export interface Options {
|
|
|
14
14
|
};
|
|
15
15
|
miniGlobal?: any;
|
|
16
16
|
}
|
|
17
|
+
export { Options };
|
package/dist/options.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Options } from "./index-26658829.js";
|
|
2
|
+
declare const options: Options;
|
|
3
|
+
export { options };
|
package/dist/perf.d.ts
CHANGED
package/dist/polyfill/array.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function handleArrayFindPolyfill(): void;
|
|
2
|
+
declare function handleArrayIncludesPolyfill(): void;
|
|
3
|
+
export { handleArrayFindPolyfill, handleArrayIncludesPolyfill };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function handleIntersectionObserverPolyfill(): void;
|
|
2
|
+
export { handleIntersectionObserverPolyfill };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare function handleObjectAssignPolyfill(): void;
|
|
2
|
+
declare function handleObjectEntriesPolyfill(): void;
|
|
3
|
+
declare function handleObjectDefinePropertyPolyfill(): void;
|
|
4
|
+
export { handleObjectAssignPolyfill, handleObjectEntriesPolyfill, handleObjectDefinePropertyPolyfill };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TaroNode } from "./dom/node.js";
|
|
2
2
|
/**
|
|
3
3
|
* A MutationRecord represents an individual DOM mutation.
|
|
4
4
|
* It is the object that is passed to MutationObserver's callback.
|
|
5
5
|
* @see https://dom.spec.whatwg.org/#interface-mutationrecord
|
|
6
6
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
interface MutationRecord {
|
|
9
9
|
readonly target: TaroNode;
|
|
10
10
|
readonly addedNodes?: TaroNode[];
|
|
11
11
|
readonly removedNodes?: TaroNode[];
|
|
@@ -17,8 +17,9 @@ export interface MutationRecord {
|
|
|
17
17
|
readonly type: MutationRecordType;
|
|
18
18
|
readonly value?: string | null;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
declare const enum MutationRecordType {
|
|
21
21
|
ATTRIBUTES = "attributes",
|
|
22
22
|
CHARACTER_DATA = "characterData",
|
|
23
23
|
CHILD_LIST = "childList"
|
|
24
24
|
}
|
|
25
|
+
export { MutationRecord, MutationRecordType };
|