@tarojs/runtime 3.5.0-alpha.8 → 3.5.0-beta.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/document.d.ts +2 -3
- package/dist/bom/navigator.d.ts +1 -15
- package/dist/bom/raf.d.ts +2 -2
- package/dist/bom/window.d.ts +2 -1
- package/dist/current.d.ts +1 -0
- package/dist/dom/document.d.ts +10 -7
- package/dist/dom/element.d.ts +4 -3
- package/dist/dom/event-target.d.ts +1 -3
- package/dist/dom/event.d.ts +1 -1
- package/dist/dom/node.d.ts +5 -5
- package/dist/dom/root.d.ts +1 -1
- package/dist/dom/text.d.ts +1 -0
- package/dist/dom-external/element.d.ts +1 -2
- package/dist/dom-external/index.d.ts +1 -0
- package/dist/dom-external/inner-html/html.d.ts +1 -2
- package/dist/dom-external/mutation-observer/index.d.ts +4 -3
- package/dist/dom-external/node.d.ts +2 -3
- package/dist/dsl/instance.d.ts +3 -0
- package/dist/emitter/emitter.d.ts +3 -28
- package/dist/env.d.ts +7 -2
- package/dist/hydrate.d.ts +1 -1
- package/dist/index.d.ts +19 -22
- package/dist/interface/index.d.ts +3 -6
- package/dist/runtime.esm.js +1214 -2869
- package/dist/runtime.esm.js.map +1 -1
- package/dist/utils/index.d.ts +7 -1
- package/package.json +4 -9
- package/dist/constants/events.d.ts +0 -5
- package/dist/constants/identifiers.d.ts +0 -61
- package/dist/container/default-hooks.d.ts +0 -4
- package/dist/container/index.d.ts +0 -3
- package/dist/container/plugin-hooks.d.ts +0 -2
- package/dist/container/store.d.ts +0 -15
- package/dist/dom-external/element-impl.d.ts +0 -4
- package/dist/dom-external/node-impl.d.ts +0 -8
- package/dist/hooks.d.ts +0 -32
- package/dist/interface/container.d.ts +0 -12
- package/dist/interface/document.d.ts +0 -14
- package/dist/interface/hooks.d.ts +0 -162
package/dist/bom/document.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const document: TaroDocumentInstance;
|
|
1
|
+
declare let document: any;
|
|
2
|
+
export { document };
|
package/dist/bom/navigator.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
export declare const navigator:
|
|
2
|
-
appCodeName: string;
|
|
3
|
-
appName: string;
|
|
4
|
-
appVersion: string;
|
|
5
|
-
cookieEnabled: boolean;
|
|
6
|
-
mimeTypes: never[];
|
|
7
|
-
onLine: boolean;
|
|
8
|
-
platform: string;
|
|
9
|
-
plugins: never[];
|
|
10
|
-
product: string;
|
|
11
|
-
productSub: string;
|
|
12
|
-
userAgent: string;
|
|
13
|
-
vendor: string;
|
|
14
|
-
vendorSub: string;
|
|
15
|
-
};
|
|
1
|
+
export declare const navigator: any;
|
package/dist/bom/raf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export declare let now:
|
|
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, raf };
|
package/dist/bom/window.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare let window: any;
|
|
2
|
+
export { window };
|
package/dist/current.d.ts
CHANGED
package/dist/dom/document.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { TaroElement } from '../dom/element';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
6
|
export declare class TaroDocument extends TaroElement {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
documentElement: TaroElement;
|
|
8
|
+
head: TaroElement;
|
|
9
|
+
body: TaroElement;
|
|
10
|
+
createEvent: typeof createEvent;
|
|
11
|
+
constructor();
|
|
10
12
|
createElement(type: string): TaroElement | TaroRootElement | FormElement;
|
|
11
13
|
createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
|
|
12
14
|
createTextNode(text: string): TaroText;
|
|
@@ -14,4 +16,5 @@ export declare class TaroDocument extends TaroElement {
|
|
|
14
16
|
querySelector<T extends TaroElement>(query: string): T | null;
|
|
15
17
|
querySelectorAll(): never[];
|
|
16
18
|
createComment(): TaroText;
|
|
19
|
+
get defaultView(): any;
|
|
17
20
|
}
|
package/dist/dom/element.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Style } from './style';
|
|
1
|
+
import type { Attributes, Func } from '../interface';
|
|
3
2
|
import { ClassList } from './class-list';
|
|
4
3
|
import type { TaroEvent } from './event';
|
|
5
|
-
import
|
|
4
|
+
import { TaroNode } from './node';
|
|
5
|
+
import { Style } from './style';
|
|
6
6
|
export declare class TaroElement extends TaroNode {
|
|
7
7
|
tagName: string;
|
|
8
8
|
props: Record<string, any>;
|
|
@@ -34,4 +34,5 @@ export declare class TaroElement extends TaroNode {
|
|
|
34
34
|
dispatchEvent(event: TaroEvent): boolean;
|
|
35
35
|
addEventListener(type: any, handler: any, options: any): void;
|
|
36
36
|
removeEventListener(type: any, handler: any): void;
|
|
37
|
+
static extend(methodName: string, options: Func | Record<string, any>): void;
|
|
37
38
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AddEventListenerOptions, EventHandler } from '../interface';
|
|
2
2
|
export declare class TaroEventTarget {
|
|
3
3
|
__handlers: Record<string, EventHandler[]>;
|
|
4
|
-
hooks: IHooks;
|
|
5
|
-
constructor();
|
|
6
4
|
addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
|
|
7
5
|
removeEventListener(type: string, handler: EventHandler): void;
|
|
8
6
|
isAnyEventBinded(): boolean;
|
package/dist/dom/event.d.ts
CHANGED
package/dist/dom/node.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TaroEventTarget } from './event-target';
|
|
3
|
-
import type { UpdatePayload } from '../interface';
|
|
1
|
+
import type { Func, UpdatePayload } from '../interface';
|
|
4
2
|
import type { TaroDocument } from './document';
|
|
5
|
-
import type { TaroRootElement } from './root';
|
|
6
3
|
import type { TaroElement } from './element';
|
|
4
|
+
import { TaroEventTarget } from './event-target';
|
|
5
|
+
import { NodeType } from './node_types';
|
|
6
|
+
import type { TaroRootElement } from './root';
|
|
7
7
|
interface RemoveChildOptions {
|
|
8
8
|
cleanRef?: boolean;
|
|
9
9
|
doUpdate?: boolean;
|
|
@@ -15,7 +15,6 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
15
15
|
nodeName: string;
|
|
16
16
|
parentNode: TaroNode | null;
|
|
17
17
|
childNodes: TaroNode[];
|
|
18
|
-
protected _getElement: import("../interface").InstanceNamedFactory;
|
|
19
18
|
constructor();
|
|
20
19
|
private hydrate;
|
|
21
20
|
/**
|
|
@@ -75,5 +74,6 @@ export declare class TaroNode extends TaroEventTarget {
|
|
|
75
74
|
hasChildNodes(): boolean;
|
|
76
75
|
enqueueUpdate(payload: UpdatePayload): void;
|
|
77
76
|
get ownerDocument(): TaroDocument;
|
|
77
|
+
static extend(methodName: string, options: Func | Record<string, any>): void;
|
|
78
78
|
}
|
|
79
79
|
export {};
|
package/dist/dom/root.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Func, MpInstance, UpdatePayload } from '../interface';
|
|
1
2
|
import { TaroElement } from './element';
|
|
2
|
-
import type { Func, UpdatePayload, MpInstance } from '../interface';
|
|
3
3
|
export declare class TaroRootElement extends TaroElement {
|
|
4
4
|
private updatePayloads;
|
|
5
5
|
private updateCallbacks;
|
package/dist/dom/text.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Ctx } from '../interface';
|
|
2
1
|
import type { TaroElement } from 'src/dom/element';
|
|
3
2
|
export declare function getBoundingClientRectImpl(this: TaroElement): Promise<null>;
|
|
4
|
-
export declare function getTemplateContent(ctx:
|
|
3
|
+
export declare function getTemplateContent(ctx: TaroElement): TaroElement | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { TaroNode } from '../../dom/node';
|
|
2
|
-
|
|
3
|
-
export declare function setInnerHTML(element: TaroNode, html: string, getDoc: () => TaroDocument): void;
|
|
2
|
+
export declare function setInnerHTML(element: TaroNode, html: string): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MutationObserverImpl } from './implements';
|
|
2
|
-
import { MutationRecord } from './record';
|
|
3
|
-
import type { MutationCallback, MutationObserverInit } from './implements';
|
|
4
1
|
import type { TaroNode } from '../../dom/node';
|
|
2
|
+
import type { MutationCallback, MutationObserverInit } from './implements';
|
|
3
|
+
import { MutationObserverImpl } from './implements';
|
|
4
|
+
import { MutationRecord, MutationRecordType } from './record';
|
|
5
5
|
export declare class MutationObserver {
|
|
6
6
|
core: Pick<MutationObserverImpl, 'observe' | 'disconnect' | 'takeRecords'>;
|
|
7
7
|
constructor(callback: MutationCallback);
|
|
@@ -10,3 +10,4 @@ export declare class MutationObserver {
|
|
|
10
10
|
takeRecords(): MutationRecord[];
|
|
11
11
|
static record(record: MutationRecord): void;
|
|
12
12
|
}
|
|
13
|
+
export { MutationRecordType };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { GetDoc } from '../interface';
|
|
2
1
|
import type { TaroNode } from 'src/dom/node';
|
|
3
2
|
export declare type IPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
|
|
4
3
|
/**
|
|
5
4
|
* An implementation of `Element.insertAdjacentHTML()`
|
|
6
5
|
* to support Vue 3 with a version of or greater than `vue@3.1.2`
|
|
7
6
|
*/
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function cloneNode(this: TaroNode,
|
|
7
|
+
export declare function insertAdjacentHTML(this: TaroNode, position: IPosition, html: string): void;
|
|
8
|
+
export declare function cloneNode(this: TaroNode, isDeep?: boolean): any;
|
|
10
9
|
export declare function contains(this: TaroNode, node: TaroNode & {
|
|
11
10
|
id?: string;
|
|
12
11
|
}): boolean;
|
package/dist/dsl/instance.d.ts
CHANGED
|
@@ -58,8 +58,11 @@ export interface PageLifeCycle extends Show {
|
|
|
58
58
|
onUnload?(): void;
|
|
59
59
|
}
|
|
60
60
|
export interface PageInstance extends PageLifeCycle {
|
|
61
|
+
/** 页面的初始数据 */
|
|
61
62
|
data?: Record<string, unknown>;
|
|
63
|
+
/** 页面路径 */
|
|
62
64
|
path?: string;
|
|
65
|
+
/** 页面的组件选项 */
|
|
63
66
|
options?: Record<string, unknown>;
|
|
64
67
|
}
|
|
65
68
|
interface Show {
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
declare type Callback2<T1, T2> = (arg1: T1, arg2: T2) => any;
|
|
3
|
-
declare type Callback3<T1, T2, T3> = (arg1: T1, arg2: T2, arg3: T3) => any;
|
|
4
|
-
declare type Callback4<T1, T2, T3, T4> = (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => any;
|
|
5
|
-
declare type Callback5<T1, T2, T3, T4, T5> = (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => any;
|
|
6
|
-
declare type Callback6Rest<T1, T2, T3, T4, T5, T6> = (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, ...rest: any[]) => any;
|
|
7
|
-
export declare class Events {
|
|
8
|
-
private callbacks?;
|
|
9
|
-
static eventSplitter: RegExp;
|
|
10
|
-
constructor(opts?: any);
|
|
11
|
-
on<T>(event: string, callback: Callback1<T>, context: any): this;
|
|
12
|
-
on<T1, T2>(event: string, callback: Callback2<T1, T2>, context: any): this;
|
|
13
|
-
on<T1, T2, T3>(event: string, callback: Callback3<T1, T2, T3>, context: any): this;
|
|
14
|
-
on<T1, T2, T3, T4>(event: string, callback: Callback4<T1, T2, T3, T4>, comtext: any): this;
|
|
15
|
-
on<T1, T2, T3, T4, T5>(event: string, callback: Callback5<T1, T2, T3, T4, T5>, context: any): this;
|
|
16
|
-
on<T1, T2, T3, T4, T5, T6>(event: string, callback: Callback6Rest<T1, T2, T3, T4, T5, T6>, context: any): this;
|
|
17
|
-
once(events: any, callback: any, context: any): this;
|
|
18
|
-
off(events: any, callback: any, context: any): this;
|
|
19
|
-
trigger(event: string): any;
|
|
20
|
-
trigger<T1>(event: string, arg: T1): any;
|
|
21
|
-
trigger<T1, T2>(event: string, arg1: T1, arg2: T2): any;
|
|
22
|
-
trigger<T1, T2, T3>(event: string, arg1: T1, arg2: T2, arg3: T3): any;
|
|
23
|
-
trigger<T1, T2, T3, T4>(event: string, arg1: T1, arg2: T2, arg3: T3, arg4: T4): any;
|
|
24
|
-
trigger<T1, T2, T3, T4, T5>(event: string, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5): any;
|
|
25
|
-
trigger<T1, T2, T3, T4, T5, T6>(event: string, arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, ...rest: any[]): any;
|
|
26
|
-
}
|
|
27
|
-
export declare type EventsType = typeof Events;
|
|
1
|
+
import { Events } from '@tarojs/shared';
|
|
28
2
|
declare const eventCenter: Events;
|
|
29
|
-
export
|
|
3
|
+
export declare type EventsType = typeof Events;
|
|
4
|
+
export { eventCenter, Events };
|
package/dist/env.d.ts
CHANGED
package/dist/hydrate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { MiniData } from './interface';
|
|
2
1
|
import type { TaroElement } from './dom/element';
|
|
3
2
|
import type { TaroText } from './dom/text';
|
|
3
|
+
import type { MiniData } from './interface';
|
|
4
4
|
/**
|
|
5
5
|
* React also has a fancy function's name for this: `hydrate()`.
|
|
6
6
|
* You may have been heard `hydrate` as a SSR-related function,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import './
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
import './dom-external';
|
|
2
|
+
export { hooks } from '@tarojs/shared';
|
|
3
|
+
export { document } from './bom/document';
|
|
4
|
+
export { getComputedStyle } from './bom/getComputedStyle';
|
|
5
|
+
export { navigator } from './bom/navigator';
|
|
6
|
+
export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from './bom/raf';
|
|
7
|
+
export { window } from './bom/window';
|
|
4
8
|
export { TaroElement } from './dom/element';
|
|
5
|
-
export {
|
|
9
|
+
export { createEvent, eventHandler, TaroEvent } from './dom/event';
|
|
6
10
|
export { FormElement } from './dom/form';
|
|
11
|
+
export { TaroNode } from './dom/node';
|
|
12
|
+
export { TaroRootElement } from './dom/root';
|
|
13
|
+
export { Style } from './dom/style';
|
|
7
14
|
export { SVGElement } from './dom/svg';
|
|
15
|
+
export { TaroText } from './dom/text';
|
|
8
16
|
export { MutationObserver } from './dom-external/mutation-observer';
|
|
9
|
-
export { TaroEvent, createEvent, eventHandler } from './dom/event';
|
|
10
|
-
export { createDocument, document } from './bom/document';
|
|
11
|
-
export { window } from './bom/window';
|
|
12
|
-
export { navigator } from './bom/navigator';
|
|
13
|
-
export { default as container } from './container';
|
|
14
|
-
export { default as processPluginHooks } from './container/plugin-hooks';
|
|
15
|
-
export { default as SERVICE_IDENTIFIER } from './constants/identifiers';
|
|
16
|
-
export { addLeadingSlash, safeExecute } from './dsl/common';
|
|
17
|
-
export * from './dsl/instance';
|
|
18
|
-
export { createPageConfig, injectPageInstance, createComponentConfig, createRecursiveComponentConfig, stringify, getPageInstance } from './dsl/common';
|
|
19
17
|
export { Current, getCurrentInstance } from './current';
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export { nextTick } from './next-tick';
|
|
23
|
-
export { hydrate } from './hydrate';
|
|
18
|
+
export { eventSource } from './dom/event-source';
|
|
19
|
+
export { addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getPageInstance, injectPageInstance, safeExecute, stringify } from './dsl/common';
|
|
24
20
|
export * from './emitter/emitter';
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export
|
|
21
|
+
export { hydrate } from './hydrate';
|
|
22
|
+
export { nextTick } from './next-tick';
|
|
23
|
+
export { options } from './options';
|
|
28
24
|
export { incrementId } from './utils';
|
|
29
|
-
export
|
|
25
|
+
export * from './dsl/instance';
|
|
26
|
+
export * from './interface';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export * from './event-target';
|
|
2
|
-
export * from './node';
|
|
3
1
|
export * from './element';
|
|
4
|
-
export * from './document';
|
|
5
|
-
export * from './hydrate';
|
|
6
|
-
export * from './container';
|
|
7
2
|
export * from './event';
|
|
3
|
+
export * from './event-target';
|
|
4
|
+
export * from './hydrate';
|
|
5
|
+
export * from './node';
|
|
8
6
|
export * from './options';
|
|
9
7
|
export * from './utils';
|
|
10
|
-
export * from './hooks';
|