@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/utils/cache.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 一个小型缓存池,用于在切换页面时,存储一些上下文信息
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
declare class RuntimeCache<T> {
|
|
5
5
|
name: string;
|
|
6
6
|
cache: Map<string, T>;
|
|
7
7
|
constructor(name: string);
|
|
@@ -10,3 +10,4 @@ export declare class RuntimeCache<T> {
|
|
|
10
10
|
get(identifier: string): T | undefined;
|
|
11
11
|
delete(identifier: string): void;
|
|
12
12
|
}
|
|
13
|
+
export { RuntimeCache };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { TaroElement } from "../dom/element.js";
|
|
2
|
+
import { TaroNode } from "../dom/node.js";
|
|
3
|
+
import { TaroText } from "../dom/text.js";
|
|
4
|
+
import { TFunc } from "../index-26658829.js";
|
|
5
|
+
declare const incrementId: () => () => string;
|
|
6
|
+
declare function isElement(node: TaroNode): node is TaroElement;
|
|
7
|
+
declare function isText(node: TaroNode): node is TaroText;
|
|
8
|
+
declare function isComment(node: TaroNode): boolean;
|
|
9
|
+
declare function isHasExtractProp(el: TaroElement): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
|
|
12
12
|
* @param node 当前组件
|
|
13
13
|
* @param type 事件类型
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
declare function isParentBinded(node: TaroElement | null, type: string): boolean;
|
|
16
|
+
declare function shortcutAttr(key: string): string;
|
|
17
|
+
declare const customWrapperCache: Map<string, Record<string, any>>;
|
|
18
18
|
interface Ctor {
|
|
19
19
|
new (...args: any[]): any;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
export * from
|
|
21
|
+
declare function extend(ctor: Ctor, methodName: string, options: TFunc | Record<string, any>): void;
|
|
22
|
+
declare function getComponentsAlias(): any;
|
|
23
|
+
declare function convertNumber2PX(value: number): string;
|
|
24
|
+
export { incrementId, isElement, isText, isComment, isHasExtractProp, isParentBinded, shortcutAttr, customWrapperCache, extend, getComponentsAlias, convertNumber2PX };
|
|
25
|
+
export * from "./lodash.js";
|
|
26
|
+
export * from "./router.js";
|
package/dist/utils/lodash.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
|
|
2
|
+
declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
|
|
3
|
+
export { throttle, debounce };
|
package/dist/utils/router.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
declare const addLeadingSlash: (url?: string) => string;
|
|
2
|
+
declare const hasBasename: (path?: string, prefix?: string) => boolean;
|
|
3
|
+
declare const stripBasename: (path?: string, prefix?: string) => string;
|
|
4
|
+
declare const stripTrailing: (str?: string) => string;
|
|
5
|
+
declare const stripSuffix: (path?: string, suffix?: string) => string;
|
|
6
|
+
declare const getHomePage: (path?: string, basename?: string, customRoutes?: Record<string, string | string[]>, entryPagePath?: string) => string;
|
|
7
|
+
declare const getCurrentPage: (routerMode?: string, basename?: string) => string;
|
|
8
|
+
export { addLeadingSlash, hasBasename, stripBasename, stripTrailing, stripSuffix, getHomePage, getCurrentPage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runtime",
|
|
3
|
-
"version": "4.1.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "taro runtime for mini apps.",
|
|
5
5
|
"author": "O2Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"tslib": "^2.6.2",
|
|
27
|
-
"@tarojs/shared": "4.1.0
|
|
27
|
+
"@tarojs/shared": "4.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
30
31
|
"@types/react": "^18.2.79",
|
|
31
32
|
"@vue/runtime-core": "^3.4.23",
|
|
32
33
|
"lodash": "^4.17.21",
|
|
33
34
|
"react": "^18.2.0",
|
|
34
35
|
"rollup": "^4.37.0",
|
|
35
|
-
"
|
|
36
|
+
"rollup-plugin-ts": "^3.4.5"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"prod": "pnpm run build",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface EventListenerOptions {
|
|
2
|
-
capture?: boolean;
|
|
3
|
-
}
|
|
4
|
-
export interface AddEventListenerOptions extends EventListenerOptions {
|
|
5
|
-
once?: boolean;
|
|
6
|
-
passive?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface EventHandler<T = any, R = void> {
|
|
9
|
-
(...args: T[]): R;
|
|
10
|
-
_stop?: boolean;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface EventOptions {
|
|
2
|
-
bubbles: boolean;
|
|
3
|
-
cancelable: boolean;
|
|
4
|
-
}
|
|
5
|
-
type Target = Record<string, unknown> & {
|
|
6
|
-
dataset: Record<string, unknown>;
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
export interface MpEvent {
|
|
10
|
-
type: string;
|
|
11
|
-
detail: Record<string, unknown>;
|
|
12
|
-
target: Target;
|
|
13
|
-
currentTarget: Target;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Shortcuts } from '@tarojs/shared';
|
|
2
|
-
import type { PageConfig } from './utils';
|
|
3
|
-
export interface MpInstance {
|
|
4
|
-
config: PageConfig;
|
|
5
|
-
setData: (data: unknown, cb: () => void) => void;
|
|
6
|
-
route?: string;
|
|
7
|
-
__route__: string;
|
|
8
|
-
$taroParams?: Record<string, unknown>;
|
|
9
|
-
$taroPath: string;
|
|
10
|
-
__data__: any;
|
|
11
|
-
data: any;
|
|
12
|
-
exitState?: any;
|
|
13
|
-
selectComponent: (selector: string) => any;
|
|
14
|
-
}
|
|
15
|
-
export interface MiniElementData {
|
|
16
|
-
[Shortcuts.Childnodes]?: MiniData[];
|
|
17
|
-
[Shortcuts.NodeName]: string;
|
|
18
|
-
[Shortcuts.Class]?: string;
|
|
19
|
-
[Shortcuts.Style]?: string;
|
|
20
|
-
uid?: string;
|
|
21
|
-
sid: string;
|
|
22
|
-
[key: string]: unknown;
|
|
23
|
-
}
|
|
24
|
-
export interface MiniTextData {
|
|
25
|
-
[Shortcuts.Text]: string;
|
|
26
|
-
[Shortcuts.NodeName]: string;
|
|
27
|
-
}
|
|
28
|
-
export type MiniData = MiniElementData | MiniTextData;
|
|
29
|
-
export type HydratedData = () => MiniData | MiniData[];
|
package/dist/interface/node.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HydratedData } from './index';
|
|
2
|
-
export type UpdatePayloadValue = string | boolean | HydratedData;
|
|
3
|
-
export type DataTree = Record<string, UpdatePayloadValue | ReturnType<HydratedData>>;
|
|
4
|
-
export interface UpdatePayload {
|
|
5
|
-
path: string;
|
|
6
|
-
value: UpdatePayloadValue;
|
|
7
|
-
}
|