@tarojs/runtime 3.5.0-canary.1 → 3.5.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/document.d.ts +2 -3
- package/dist/bom/getComputedStyle.d.ts +3 -3
- package/dist/bom/navigator.d.ts +1 -15
- package/dist/bom/raf.d.ts +5 -4
- package/dist/bom/window.d.ts +2 -1
- package/dist/constants/index.d.ts +47 -47
- package/dist/current.d.ts +19 -17
- package/dist/dom/class-list.d.ts +14 -14
- package/dist/dom/document.d.ts +20 -17
- package/dist/dom/element.d.ts +38 -37
- package/dist/dom/event-source.d.ts +7 -7
- package/dist/dom/event-target.d.ts +7 -9
- package/dist/dom/event.d.ts +22 -26
- package/dist/dom/form.d.ts +7 -7
- package/dist/dom/node.d.ts +75 -79
- package/dist/dom/node_types.d.ts +10 -10
- package/dist/dom/root.d.ts +15 -15
- package/dist/dom/style.d.ts +14 -13
- package/dist/dom/style_properties.d.ts +3 -3
- package/dist/dom/svg.d.ts +3 -3
- package/dist/dom/text.d.ts +14 -13
- package/dist/dom/tree.d.ts +4 -4
- package/dist/dom-external/element.d.ts +3 -4
- package/dist/dom-external/index.d.ts +1 -0
- package/dist/dom-external/inner-html/html.d.ts +2 -3
- package/dist/dom-external/inner-html/parser.d.ts +25 -25
- package/dist/dom-external/inner-html/scaner.d.ts +30 -30
- package/dist/dom-external/inner-html/style.d.ts +27 -27
- package/dist/dom-external/inner-html/tags.d.ts +8 -8
- package/dist/dom-external/inner-html/utils.d.ts +1 -1
- package/dist/dom-external/mutation-observer/implements.d.ts +52 -52
- package/dist/dom-external/mutation-observer/index.d.ts +13 -12
- package/dist/dom-external/mutation-observer/record.d.ts +24 -24
- package/dist/dom-external/node.d.ts +11 -12
- package/dist/dsl/common.d.ts +15 -15
- package/dist/dsl/instance.d.ts +85 -82
- package/dist/emitter/emitter.d.ts +4 -29
- package/dist/env.d.ts +7 -2
- package/dist/hydrate.d.ts +10 -10
- package/dist/index.d.ts +26 -29
- package/dist/interface/element.d.ts +4 -4
- package/dist/interface/event-target.d.ts +10 -10
- package/dist/interface/event.d.ts +15 -15
- package/dist/interface/hydrate.d.ts +30 -29
- package/dist/interface/index.d.ts +7 -10
- package/dist/interface/node.d.ts +7 -7
- package/dist/interface/options.d.ts +16 -16
- package/dist/interface/utils.d.ts +2 -2
- package/dist/next-tick.d.ts +2 -2
- package/dist/options.d.ts +2 -2
- package/dist/perf.d.ts +7 -7
- package/dist/runtime.esm.d.ts +537 -0
- package/dist/runtime.esm.js +3146 -4650
- package/dist/runtime.esm.js.map +1 -1
- package/dist/utils/index.d.ts +23 -16
- package/package.json +10 -16
- 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 };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TaroElement } from '../dom/element';
|
|
2
|
-
import type { Style } from '../dom/style';
|
|
3
|
-
export declare function getComputedStyle(element: TaroElement): Style;
|
|
1
|
+
import type { TaroElement } from '../dom/element';
|
|
2
|
+
import type { Style } from '../dom/style';
|
|
3
|
+
export declare function getComputedStyle(element: TaroElement): Style;
|
package/dist/bom/navigator.d.ts
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
export declare const
|
|
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 nav: any;
|
package/dist/bom/raf.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
declare const
|
|
4
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare let now: () => number;
|
|
3
|
+
declare const _raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
4
|
+
declare const _caf: typeof cancelAnimationFrame;
|
|
5
|
+
export { _caf as caf, _raf as raf };
|
package/dist/bom/window.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare let window: any;
|
|
2
|
+
export { window };
|
|
@@ -1,47 +1,47 @@
|
|
|
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 PROPS = "props";
|
|
23
|
-
export declare const DATASET = "dataset";
|
|
24
|
-
export declare const OBJECT = "object";
|
|
25
|
-
export declare const VALUE = "value";
|
|
26
|
-
export declare const INPUT = "input";
|
|
27
|
-
export declare const CHANGE = "change";
|
|
28
|
-
export declare const CUSTOM_WRAPPER = "custom-wrapper";
|
|
29
|
-
export declare const TARGET = "target";
|
|
30
|
-
export declare const CURRENT_TARGET = "currentTarget";
|
|
31
|
-
export declare const TYPE = "type";
|
|
32
|
-
export declare const CONFIRM = "confirm";
|
|
33
|
-
export declare const TIME_STAMP = "timeStamp";
|
|
34
|
-
export declare const KEY_CODE = "keyCode";
|
|
35
|
-
export declare const TOUCHMOVE = "touchmove";
|
|
36
|
-
export declare const DATE = "Date";
|
|
37
|
-
export declare const SET_TIMEOUT = "setTimeout";
|
|
38
|
-
export declare const CATCHMOVE = "catchMove";
|
|
39
|
-
export declare const CATCH_VIEW = "catch-view";
|
|
40
|
-
export declare const COMMENT = "comment";
|
|
41
|
-
export declare const ON_LOAD = "onLoad";
|
|
42
|
-
export declare const ON_READY = "onReady";
|
|
43
|
-
export declare const ON_SHOW = "onShow";
|
|
44
|
-
export declare const ON_HIDE = "onHide";
|
|
45
|
-
export declare const OPTIONS = "options";
|
|
46
|
-
export declare const EXTERNAL_CLASSES = "externalClasses";
|
|
47
|
-
export declare const BEHAVIORS = "behaviors";
|
|
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 PROPS = "props";
|
|
23
|
+
export declare const DATASET = "dataset";
|
|
24
|
+
export declare const OBJECT = "object";
|
|
25
|
+
export declare const VALUE = "value";
|
|
26
|
+
export declare const INPUT = "input";
|
|
27
|
+
export declare const CHANGE = "change";
|
|
28
|
+
export declare const CUSTOM_WRAPPER = "custom-wrapper";
|
|
29
|
+
export declare const TARGET = "target";
|
|
30
|
+
export declare const CURRENT_TARGET = "currentTarget";
|
|
31
|
+
export declare const TYPE = "type";
|
|
32
|
+
export declare const CONFIRM = "confirm";
|
|
33
|
+
export declare const TIME_STAMP = "timeStamp";
|
|
34
|
+
export declare const KEY_CODE = "keyCode";
|
|
35
|
+
export declare const TOUCHMOVE = "touchmove";
|
|
36
|
+
export declare const DATE = "Date";
|
|
37
|
+
export declare const SET_TIMEOUT = "setTimeout";
|
|
38
|
+
export declare const CATCHMOVE = "catchMove";
|
|
39
|
+
export declare const CATCH_VIEW = "catch-view";
|
|
40
|
+
export declare const COMMENT = "comment";
|
|
41
|
+
export declare const ON_LOAD = "onLoad";
|
|
42
|
+
export declare const ON_READY = "onReady";
|
|
43
|
+
export declare const ON_SHOW = "onShow";
|
|
44
|
+
export declare const ON_HIDE = "onHide";
|
|
45
|
+
export declare const OPTIONS = "options";
|
|
46
|
+
export declare const EXTERNAL_CLASSES = "externalClasses";
|
|
47
|
+
export declare const BEHAVIORS = "behaviors";
|
package/dist/current.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { AppInstance, PageInstance } from './dsl/instance';
|
|
2
|
-
export interface Router {
|
|
3
|
-
params: Record<string, unknown>;
|
|
4
|
-
path: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export
|
|
1
|
+
import { AppInstance, PageInstance } from './dsl/instance';
|
|
2
|
+
export interface Router {
|
|
3
|
+
params: Record<string, unknown>;
|
|
4
|
+
path: string;
|
|
5
|
+
$taroPath: string;
|
|
6
|
+
onReady: string;
|
|
7
|
+
onHide: string;
|
|
8
|
+
onShow: string;
|
|
9
|
+
exitState?: any;
|
|
10
|
+
}
|
|
11
|
+
interface Current {
|
|
12
|
+
app: AppInstance | null;
|
|
13
|
+
router: Router | null;
|
|
14
|
+
page: PageInstance | null;
|
|
15
|
+
preloadData?: any;
|
|
16
|
+
}
|
|
17
|
+
export declare const Current: Current;
|
|
18
|
+
export declare const getCurrentInstance: () => Current;
|
|
19
|
+
export {};
|
package/dist/dom/class-list.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { TaroElement } from './element';
|
|
2
|
-
export declare class ClassList extends Set<string> {
|
|
3
|
-
private el;
|
|
4
|
-
constructor(className: string, el: TaroElement);
|
|
5
|
-
get value(): string;
|
|
6
|
-
add(s: string): this;
|
|
7
|
-
get length(): number;
|
|
8
|
-
remove(s: string): void;
|
|
9
|
-
toggle(s: string): void;
|
|
10
|
-
replace(s1: string, s2: string): void;
|
|
11
|
-
contains(s: string): boolean;
|
|
12
|
-
toString(): string;
|
|
13
|
-
private _update;
|
|
14
|
-
}
|
|
1
|
+
import type { TaroElement } from './element';
|
|
2
|
+
export declare class ClassList extends Set<string> {
|
|
3
|
+
private el;
|
|
4
|
+
constructor(className: string, el: TaroElement);
|
|
5
|
+
get value(): string;
|
|
6
|
+
add(s: string): this;
|
|
7
|
+
get length(): number;
|
|
8
|
+
remove(s: string): void;
|
|
9
|
+
toggle(s: string): void;
|
|
10
|
+
replace(s1: string, s2: string): void;
|
|
11
|
+
contains(s: string): boolean;
|
|
12
|
+
toString(): string;
|
|
13
|
+
private _update;
|
|
14
|
+
}
|
package/dist/dom/document.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { TaroElement } from '../dom/element';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
export declare class TaroDocument extends TaroElement {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
documentElement: TaroElement;
|
|
8
|
+
head: TaroElement;
|
|
9
|
+
body: TaroElement;
|
|
10
|
+
createEvent: typeof createEvent;
|
|
11
|
+
constructor();
|
|
12
|
+
createElement(type: string): TaroElement | TaroRootElement | FormElement;
|
|
13
|
+
createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
|
|
14
|
+
createTextNode(text: string): TaroText;
|
|
15
|
+
getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
|
|
16
|
+
querySelector<T extends TaroElement>(query: string): T | null;
|
|
17
|
+
querySelectorAll(): never[];
|
|
18
|
+
createComment(): TaroText;
|
|
19
|
+
get defaultView(): any;
|
|
20
|
+
}
|
package/dist/dom/element.d.ts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
export declare class TaroElement extends TaroNode {
|
|
7
|
-
tagName: string;
|
|
8
|
-
props: Record<string, any>;
|
|
9
|
-
style: Style;
|
|
10
|
-
dataset: Record<string, unknown>;
|
|
11
|
-
innerHTML: string;
|
|
12
|
-
constructor();
|
|
13
|
-
private _stopPropagation;
|
|
14
|
-
get id(): string;
|
|
15
|
-
set id(val: string);
|
|
16
|
-
get className(): string;
|
|
17
|
-
set className(val: string);
|
|
18
|
-
get cssText(): string;
|
|
19
|
-
get classList(): ClassList;
|
|
20
|
-
get children(): TaroElement[];
|
|
21
|
-
get attributes(): Attributes[];
|
|
22
|
-
get textContent(): string;
|
|
23
|
-
set textContent(text: string);
|
|
24
|
-
hasAttribute(qualifiedName: string): boolean;
|
|
25
|
-
hasAttributes(): boolean;
|
|
26
|
-
get focus(): () => void;
|
|
27
|
-
set focus(value: () => void);
|
|
28
|
-
blur(): void;
|
|
29
|
-
setAttribute(qualifiedName: string, value: any): void;
|
|
30
|
-
removeAttribute(qualifiedName: string): void;
|
|
31
|
-
getAttribute(qualifiedName: string): string;
|
|
32
|
-
getElementsByTagName(tagName: string): TaroElement[];
|
|
33
|
-
getElementsByClassName(className: string): TaroElement[];
|
|
34
|
-
dispatchEvent(event: TaroEvent): boolean;
|
|
35
|
-
addEventListener(type: any, handler: any, options: any): void;
|
|
36
|
-
removeEventListener(type: any, handler: any): void;
|
|
37
|
-
|
|
1
|
+
import type { Attributes, Func } from '../interface';
|
|
2
|
+
import { ClassList } from './class-list';
|
|
3
|
+
import type { TaroEvent } from './event';
|
|
4
|
+
import { TaroNode } from './node';
|
|
5
|
+
import { Style } from './style';
|
|
6
|
+
export declare class TaroElement extends TaroNode {
|
|
7
|
+
tagName: string;
|
|
8
|
+
props: Record<string, any>;
|
|
9
|
+
style: Style;
|
|
10
|
+
dataset: Record<string, unknown>;
|
|
11
|
+
innerHTML: string;
|
|
12
|
+
constructor();
|
|
13
|
+
private _stopPropagation;
|
|
14
|
+
get id(): string;
|
|
15
|
+
set id(val: string);
|
|
16
|
+
get className(): string;
|
|
17
|
+
set className(val: string);
|
|
18
|
+
get cssText(): string;
|
|
19
|
+
get classList(): ClassList;
|
|
20
|
+
get children(): TaroElement[];
|
|
21
|
+
get attributes(): Attributes[];
|
|
22
|
+
get textContent(): string;
|
|
23
|
+
set textContent(text: string);
|
|
24
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
25
|
+
hasAttributes(): boolean;
|
|
26
|
+
get focus(): () => void;
|
|
27
|
+
set focus(value: () => void);
|
|
28
|
+
blur(): void;
|
|
29
|
+
setAttribute(qualifiedName: string, value: any): void;
|
|
30
|
+
removeAttribute(qualifiedName: string): void;
|
|
31
|
+
getAttribute(qualifiedName: string): string;
|
|
32
|
+
getElementsByTagName(tagName: string): TaroElement[];
|
|
33
|
+
getElementsByClassName(className: string): TaroElement[];
|
|
34
|
+
dispatchEvent(event: TaroEvent): boolean;
|
|
35
|
+
addEventListener(type: any, handler: any, options: any): void;
|
|
36
|
+
removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
|
|
37
|
+
static extend(methodName: string, options: Func | Record<string, any>): void;
|
|
38
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TaroNode } from './node';
|
|
2
|
-
interface IEventSource extends Map<string | undefined | null, TaroNode> {
|
|
3
|
-
removeNode(child: TaroNode): void;
|
|
4
|
-
removeNodeTree(child: TaroNode): void;
|
|
5
|
-
}
|
|
6
|
-
export declare const eventSource: IEventSource;
|
|
7
|
-
export {};
|
|
1
|
+
import type { TaroNode } from './node';
|
|
2
|
+
interface IEventSource extends Map<string | undefined | null, TaroNode> {
|
|
3
|
+
removeNode(child: TaroNode): void;
|
|
4
|
+
removeNodeTree(child: TaroNode): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const eventSource: IEventSource;
|
|
7
|
+
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare class TaroEventTarget {
|
|
3
|
-
__handlers: Record<string, EventHandler[]>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
isAnyEventBinded(): boolean;
|
|
9
|
-
}
|
|
1
|
+
import type { AddEventListenerOptions, EventHandler } from '../interface';
|
|
2
|
+
export declare class TaroEventTarget {
|
|
3
|
+
__handlers: Record<string, EventHandler[]>;
|
|
4
|
+
addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
|
|
5
|
+
removeEventListener(type: string, handler: EventHandler): void;
|
|
6
|
+
isAnyEventBinded(): boolean;
|
|
7
|
+
}
|
package/dist/dom/event.d.ts
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare class TaroEvent {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
26
|
-
export declare function eventHandler(event: MpEvent): void;
|
|
1
|
+
import type { EventOptions, MpEvent } from '../interface';
|
|
2
|
+
import type { TaroElement } from './element';
|
|
3
|
+
export declare class TaroEvent {
|
|
4
|
+
private cacheTarget;
|
|
5
|
+
private cacheCurrentTarget;
|
|
6
|
+
type: string;
|
|
7
|
+
bubbles: boolean;
|
|
8
|
+
cancelable: boolean;
|
|
9
|
+
_stop: boolean;
|
|
10
|
+
_end: boolean;
|
|
11
|
+
defaultPrevented: boolean;
|
|
12
|
+
timeStamp: number;
|
|
13
|
+
mpEvent: MpEvent | undefined;
|
|
14
|
+
constructor(type: string, opts: EventOptions, event?: MpEvent);
|
|
15
|
+
stopPropagation(): void;
|
|
16
|
+
stopImmediatePropagation(): void;
|
|
17
|
+
preventDefault(): void;
|
|
18
|
+
get target(): any;
|
|
19
|
+
get currentTarget(): any;
|
|
20
|
+
}
|
|
21
|
+
export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
|
|
22
|
+
export declare function eventHandler(event: MpEvent): void;
|
package/dist/dom/form.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TaroElement } from './element';
|
|
2
|
-
import type { TaroEvent } from './event';
|
|
3
|
-
export declare class FormElement extends TaroElement {
|
|
4
|
-
get value(): string | boolean | number | any[];
|
|
5
|
-
set value(val: string | boolean | number | any[]);
|
|
6
|
-
dispatchEvent(event: TaroEvent): boolean;
|
|
7
|
-
}
|
|
1
|
+
import { TaroElement } from './element';
|
|
2
|
+
import type { TaroEvent } from './event';
|
|
3
|
+
export declare class FormElement extends TaroElement {
|
|
4
|
+
get value(): string | boolean | number | any[];
|
|
5
|
+
set value(val: string | boolean | number | any[]);
|
|
6
|
+
dispatchEvent(event: TaroEvent): boolean;
|
|
7
|
+
}
|
package/dist/dom/node.d.ts
CHANGED
|
@@ -1,79 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
7
|
-
interface RemoveChildOptions {
|
|
8
|
-
cleanRef?: boolean;
|
|
9
|
-
doUpdate?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare class TaroNode extends TaroEventTarget {
|
|
12
|
-
uid: string;
|
|
13
|
-
sid: string;
|
|
14
|
-
nodeType: NodeType;
|
|
15
|
-
nodeName: string;
|
|
16
|
-
parentNode: TaroNode | null;
|
|
17
|
-
childNodes: TaroNode[];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
get
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @
|
|
36
|
-
* @
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
enqueueUpdate(payload: UpdatePayload): void;
|
|
77
|
-
get ownerDocument(): TaroDocument;
|
|
78
|
-
}
|
|
79
|
-
export {};
|
|
1
|
+
import type { Func, UpdatePayload } from '../interface';
|
|
2
|
+
import type { TaroDocument } from './document';
|
|
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
|
+
interface RemoveChildOptions {
|
|
8
|
+
cleanRef?: boolean;
|
|
9
|
+
doUpdate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class TaroNode extends TaroEventTarget {
|
|
12
|
+
uid: string;
|
|
13
|
+
sid: string;
|
|
14
|
+
nodeType: NodeType;
|
|
15
|
+
nodeName: string;
|
|
16
|
+
parentNode: TaroNode | null;
|
|
17
|
+
childNodes: TaroNode[];
|
|
18
|
+
constructor();
|
|
19
|
+
private hydrate;
|
|
20
|
+
private updateChildNodes;
|
|
21
|
+
get _root(): TaroRootElement | null;
|
|
22
|
+
protected findIndex(refChild: TaroNode): number;
|
|
23
|
+
get _path(): string;
|
|
24
|
+
get nextSibling(): TaroNode | null;
|
|
25
|
+
get previousSibling(): TaroNode | null;
|
|
26
|
+
get parentElement(): TaroElement | null;
|
|
27
|
+
get firstChild(): TaroNode | null;
|
|
28
|
+
get lastChild(): TaroNode | null;
|
|
29
|
+
/**
|
|
30
|
+
* @textContent 目前只能置空子元素
|
|
31
|
+
* @TODO 等待完整 innerHTML 实现
|
|
32
|
+
*/
|
|
33
|
+
set textContent(text: string);
|
|
34
|
+
/**
|
|
35
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
|
|
36
|
+
* @scenario
|
|
37
|
+
* [A,B,C]
|
|
38
|
+
* 1. insert D before C, D has no parent
|
|
39
|
+
* 2. insert D before C, D has the same parent of C
|
|
40
|
+
* 3. insert D before C, D has the different parent of C
|
|
41
|
+
*/
|
|
42
|
+
insertBefore<T extends TaroNode>(newChild: T, refChild?: TaroNode | null, isReplace?: boolean): T;
|
|
43
|
+
/**
|
|
44
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
|
|
45
|
+
* @scenario
|
|
46
|
+
* [A,B,C]
|
|
47
|
+
* 1. append C, C has no parent
|
|
48
|
+
* 2. append C, C has the same parent of B
|
|
49
|
+
* 3. append C, C has the different parent of B
|
|
50
|
+
*/
|
|
51
|
+
appendChild(newChild: TaroNode): TaroNode;
|
|
52
|
+
/**
|
|
53
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
|
|
54
|
+
* @scenario
|
|
55
|
+
* [A,B,C]
|
|
56
|
+
* 1. replace B with C, C has no parent
|
|
57
|
+
* 2. replace B with C, C has no parent, C has the same parent of B
|
|
58
|
+
* 3. replace B with C, C has no parent, C has the different parent of B
|
|
59
|
+
*/
|
|
60
|
+
replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
|
|
63
|
+
* @scenario
|
|
64
|
+
* [A,B,C]
|
|
65
|
+
* 1. remove A or B
|
|
66
|
+
* 2. remove C
|
|
67
|
+
*/
|
|
68
|
+
removeChild<T extends TaroNode>(child: T, options?: RemoveChildOptions): T;
|
|
69
|
+
remove(options?: RemoveChildOptions): void;
|
|
70
|
+
hasChildNodes(): boolean;
|
|
71
|
+
enqueueUpdate(payload: UpdatePayload): void;
|
|
72
|
+
get ownerDocument(): TaroDocument;
|
|
73
|
+
static extend(methodName: string, options: Func | Record<string, any>): void;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
package/dist/dom/node_types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const enum NodeType {
|
|
2
|
-
ELEMENT_NODE = 1,
|
|
3
|
-
ATTRIBUTE_NODE = 2,
|
|
4
|
-
TEXT_NODE = 3,
|
|
5
|
-
CDATA_SECTION_NODE = 4,
|
|
6
|
-
ENTITY_REFERENCE_NODE = 5,
|
|
7
|
-
COMMENT_NODE = 6,
|
|
8
|
-
PROCESSING_INSTRUCTION_NODE = 7,
|
|
9
|
-
DOCUMENT_NODE = 9
|
|
10
|
-
}
|
|
1
|
+
export declare const enum NodeType {
|
|
2
|
+
ELEMENT_NODE = 1,
|
|
3
|
+
ATTRIBUTE_NODE = 2,
|
|
4
|
+
TEXT_NODE = 3,
|
|
5
|
+
CDATA_SECTION_NODE = 4,
|
|
6
|
+
ENTITY_REFERENCE_NODE = 5,
|
|
7
|
+
COMMENT_NODE = 6,
|
|
8
|
+
PROCESSING_INSTRUCTION_NODE = 7,
|
|
9
|
+
DOCUMENT_NODE = 9
|
|
10
|
+
}
|
package/dist/dom/root.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export declare class TaroRootElement extends TaroElement {
|
|
4
|
-
private updatePayloads;
|
|
5
|
-
private updateCallbacks;
|
|
6
|
-
pendingUpdate: boolean;
|
|
7
|
-
ctx: null | MpInstance;
|
|
8
|
-
constructor();
|
|
9
|
-
get _path(): string;
|
|
10
|
-
|
|
11
|
-
enqueueUpdate(payload: UpdatePayload): void;
|
|
12
|
-
performUpdate(initRender?: boolean, prerender?: Func): void;
|
|
13
|
-
enqueueUpdateCallback(cb: Func, ctx?: Record<string, any>): void;
|
|
14
|
-
flushUpdateCallback(): void;
|
|
15
|
-
}
|
|
1
|
+
import type { Func, MpInstance, UpdatePayload } from '../interface';
|
|
2
|
+
import { TaroElement } from './element';
|
|
3
|
+
export declare class TaroRootElement extends TaroElement {
|
|
4
|
+
private updatePayloads;
|
|
5
|
+
private updateCallbacks;
|
|
6
|
+
pendingUpdate: boolean;
|
|
7
|
+
ctx: null | MpInstance;
|
|
8
|
+
constructor();
|
|
9
|
+
get _path(): string;
|
|
10
|
+
get _root(): TaroRootElement;
|
|
11
|
+
enqueueUpdate(payload: UpdatePayload): void;
|
|
12
|
+
performUpdate(initRender?: boolean, prerender?: Func): void;
|
|
13
|
+
enqueueUpdateCallback(cb: Func, ctx?: Record<string, any>): void;
|
|
14
|
+
flushUpdateCallback(): void;
|
|
15
|
+
}
|