@tarojs/runtime 3.7.0-alpha.2 → 3.7.0-alpha.3
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/runtime.cjs.d.ts +710 -0
- package/dist/runtime.cjs.js +4491 -0
- package/dist/runtime.esm.d.ts +20 -13
- package/dist/runtime.esm.js +133 -53
- package/dist/runtime.esm.js.map +1 -1
- package/dist/runtime.h5.d.ts +710 -0
- package/dist/runtime.h5.js +3249 -0
- package/package.json +11 -6
- package/dist/bom/URL.d.ts +0 -61
- package/dist/bom/URLSearchParams.d.ts +0 -14
- package/dist/bom/document.d.ts +0 -2
- package/dist/bom/getComputedStyle.d.ts +0 -3
- package/dist/bom/history.d.ts +0 -29
- package/dist/bom/location.d.ts +0 -36
- package/dist/bom/navigator.d.ts +0 -1
- package/dist/bom/raf.d.ts +0 -5
- package/dist/bom/window.d.ts +0 -4
- package/dist/constants/index.d.ts +0 -58
- package/dist/current.d.ts +0 -19
- package/dist/dom/anchor-element.d.ts +0 -13
- package/dist/dom/class-list.d.ts +0 -14
- package/dist/dom/custom-wrapper.d.ts +0 -4
- package/dist/dom/document.d.ts +0 -20
- package/dist/dom/element.d.ts +0 -38
- package/dist/dom/event-source.d.ts +0 -7
- package/dist/dom/event-target.d.ts +0 -7
- package/dist/dom/event.d.ts +0 -23
- package/dist/dom/form.d.ts +0 -7
- package/dist/dom/node.d.ts +0 -75
- package/dist/dom/node_types.d.ts +0 -10
- package/dist/dom/root.d.ts +0 -15
- package/dist/dom/style.d.ts +0 -14
- package/dist/dom/style_properties.d.ts +0 -3
- package/dist/dom/svg.d.ts +0 -3
- package/dist/dom/text.d.ts +0 -14
- package/dist/dom/tree.d.ts +0 -4
- package/dist/dom-external/element.d.ts +0 -3
- package/dist/dom-external/index.d.ts +0 -1
- package/dist/dom-external/inner-html/html.d.ts +0 -2
- package/dist/dom-external/inner-html/parser.d.ts +0 -25
- package/dist/dom-external/inner-html/scaner.d.ts +0 -30
- package/dist/dom-external/inner-html/style.d.ts +0 -27
- package/dist/dom-external/inner-html/tags.d.ts +0 -8
- package/dist/dom-external/inner-html/utils.d.ts +0 -1
- package/dist/dom-external/mutation-observer/implements.d.ts +0 -52
- package/dist/dom-external/mutation-observer/index.d.ts +0 -13
- package/dist/dom-external/mutation-observer/record.d.ts +0 -24
- package/dist/dom-external/node.d.ts +0 -11
- package/dist/dsl/common.d.ts +0 -16
- package/dist/dsl/instance.d.ts +0 -87
- package/dist/emitter/emitter.d.ts +0 -4
- package/dist/env.d.ts +0 -7
- package/dist/hydrate.d.ts +0 -10
- package/dist/index.d.ts +0 -30
- package/dist/interface/element.d.ts +0 -4
- package/dist/interface/event-target.d.ts +0 -10
- package/dist/interface/event.d.ts +0 -15
- package/dist/interface/hydrate.d.ts +0 -30
- package/dist/interface/index.d.ts +0 -7
- package/dist/interface/node.d.ts +0 -7
- package/dist/interface/options.d.ts +0 -16
- package/dist/interface/utils.d.ts +0 -2
- package/dist/next-tick.d.ts +0 -2
- package/dist/options.d.ts +0 -2
- package/dist/perf.d.ts +0 -7
- package/dist/utils/cache.d.ts +0 -12
- package/dist/utils/index.d.ts +0 -23
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/runtime",
|
|
3
|
-
"version": "3.7.0-alpha.
|
|
3
|
+
"version": "3.7.0-alpha.3",
|
|
4
4
|
"description": "taro runtime for mini apps.",
|
|
5
|
+
"main:h5": "dist/runtime.h5.js",
|
|
5
6
|
"main": "dist/runtime.esm.js",
|
|
6
7
|
"module": "dist/runtime.esm.js",
|
|
7
|
-
"types": "./dist/
|
|
8
|
+
"types": "./dist/runtime.esm.d.ts",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist"
|
|
10
11
|
],
|
|
@@ -19,23 +20,27 @@
|
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"lodash-es": "4.17.21",
|
|
22
|
-
"@tarojs/shared": "3.7.0-alpha.
|
|
23
|
+
"@tarojs/shared": "3.7.0-alpha.3"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@rollup/plugin-buble": "^0.21.3",
|
|
27
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
28
|
+
"@rollup/plugin-typescript": "^11.1.0",
|
|
26
29
|
"@vue/runtime-core": "3.2.41",
|
|
27
30
|
"jest": "^29.3.1",
|
|
28
31
|
"jest-cli": "^29.3.1",
|
|
29
32
|
"jest-environment-node": "^29.5.0",
|
|
30
|
-
"rollup": "^
|
|
33
|
+
"rollup": "^3.8.1",
|
|
31
34
|
"rollup-plugin-ts": "^3.0.2",
|
|
32
35
|
"ts-jest": "^29.0.5",
|
|
33
36
|
"tslib": "^2.5.0",
|
|
34
37
|
"typescript": "^4.7.4"
|
|
35
38
|
},
|
|
36
39
|
"scripts": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
40
|
+
"prebuild": "rimraf ./dist",
|
|
41
|
+
"build": "pnpm run rollup",
|
|
42
|
+
"dev": "pnpm run rollup --environment TARGET:esm -w",
|
|
43
|
+
"rollup": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
|
|
39
44
|
"test": "jest",
|
|
40
45
|
"test:ci": "jest --ci -i --coverage false"
|
|
41
46
|
}
|
package/dist/bom/URL.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { URLSearchParams } from './URLSearchParams';
|
|
2
|
-
export declare class URL {
|
|
3
|
-
#private;
|
|
4
|
-
static createObjectURL(): void;
|
|
5
|
-
static revokeObjectURL(): void;
|
|
6
|
-
constructor(url: string, base?: string);
|
|
7
|
-
get protocol(): string;
|
|
8
|
-
set protocol(val: string);
|
|
9
|
-
get host(): string;
|
|
10
|
-
set host(val: string);
|
|
11
|
-
get hostname(): string;
|
|
12
|
-
set hostname(val: string);
|
|
13
|
-
get port(): string;
|
|
14
|
-
set port(val: string);
|
|
15
|
-
get pathname(): string;
|
|
16
|
-
set pathname(val: string);
|
|
17
|
-
get search(): string;
|
|
18
|
-
set search(val: string);
|
|
19
|
-
get hash(): string;
|
|
20
|
-
set hash(val: string);
|
|
21
|
-
get href(): string;
|
|
22
|
-
set href(val: string);
|
|
23
|
-
get origin(): string;
|
|
24
|
-
set origin(val: string);
|
|
25
|
-
get searchParams(): URLSearchParams;
|
|
26
|
-
toString(): string;
|
|
27
|
-
toJSON(): string;
|
|
28
|
-
_toRaw(): {
|
|
29
|
-
protocol: string;
|
|
30
|
-
port: string;
|
|
31
|
-
host: string;
|
|
32
|
-
hostname: string;
|
|
33
|
-
pathname: string;
|
|
34
|
-
hash: string;
|
|
35
|
-
search: string;
|
|
36
|
-
origin: string;
|
|
37
|
-
href: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export declare function parseUrl(url?: string): {
|
|
41
|
-
href: string;
|
|
42
|
-
origin: string;
|
|
43
|
-
protocol: string;
|
|
44
|
-
hostname: string;
|
|
45
|
-
host: string;
|
|
46
|
-
port: string;
|
|
47
|
-
pathname: string;
|
|
48
|
-
search: string;
|
|
49
|
-
hash: string;
|
|
50
|
-
};
|
|
51
|
-
export declare function parseUrlBase(url: string, base?: string): {
|
|
52
|
-
href: string;
|
|
53
|
-
origin: string;
|
|
54
|
-
protocol: string;
|
|
55
|
-
hostname: string;
|
|
56
|
-
host: string;
|
|
57
|
-
port: string;
|
|
58
|
-
pathname: string;
|
|
59
|
-
search: string;
|
|
60
|
-
hash: string;
|
|
61
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class URLSearchParams {
|
|
2
|
-
#private;
|
|
3
|
-
constructor(query: any);
|
|
4
|
-
append(name: string, value: string): void;
|
|
5
|
-
delete(name: string): void;
|
|
6
|
-
get(name: string): any;
|
|
7
|
-
getAll(name: string): any;
|
|
8
|
-
has(name: string): boolean;
|
|
9
|
-
keys(): string[];
|
|
10
|
-
set(name: string, value: string): void;
|
|
11
|
-
forEach(callback: any, thisArg: any): void;
|
|
12
|
-
toJSON(): {};
|
|
13
|
-
toString(): string;
|
|
14
|
-
}
|
package/dist/bom/document.d.ts
DELETED
package/dist/bom/history.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Events } from '../emitter/emitter';
|
|
2
|
-
import { RuntimeCache } from '../utils/cache';
|
|
3
|
-
import type * as LocationType from './location';
|
|
4
|
-
export interface HistoryState {
|
|
5
|
-
state: Record<string, any> | null;
|
|
6
|
-
title: string;
|
|
7
|
-
url: string;
|
|
8
|
-
}
|
|
9
|
-
declare type Options = {
|
|
10
|
-
window: any;
|
|
11
|
-
};
|
|
12
|
-
declare type HistoryContext = {
|
|
13
|
-
location: LocationType.Location;
|
|
14
|
-
stack: HistoryState[];
|
|
15
|
-
cur: number;
|
|
16
|
-
};
|
|
17
|
-
export declare class History extends Events {
|
|
18
|
-
#private;
|
|
19
|
-
constructor(location: LocationType.Location, options: Options);
|
|
20
|
-
get length(): number;
|
|
21
|
-
get state(): HistoryState;
|
|
22
|
-
go(delta: number): void;
|
|
23
|
-
back(): void;
|
|
24
|
-
forward(): void;
|
|
25
|
-
pushState(state: any, title: string, url: string): void;
|
|
26
|
-
replaceState(state: any, title: string, url: string): void;
|
|
27
|
-
get cache(): RuntimeCache<HistoryContext>;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
package/dist/bom/location.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Events } from '../emitter/emitter';
|
|
2
|
-
import { RuntimeCache } from '../utils/cache';
|
|
3
|
-
declare type Options = {
|
|
4
|
-
window: any;
|
|
5
|
-
};
|
|
6
|
-
declare type LocationContext = {
|
|
7
|
-
lastHref: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class Location extends Events {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(options: Options);
|
|
12
|
-
get protocol(): string;
|
|
13
|
-
set protocol(val: string);
|
|
14
|
-
get host(): string;
|
|
15
|
-
set host(val: string);
|
|
16
|
-
get hostname(): string;
|
|
17
|
-
set hostname(val: string);
|
|
18
|
-
get port(): string;
|
|
19
|
-
set port(val: string);
|
|
20
|
-
get pathname(): string;
|
|
21
|
-
set pathname(val: string);
|
|
22
|
-
get search(): string;
|
|
23
|
-
set search(val: string);
|
|
24
|
-
get hash(): string;
|
|
25
|
-
set hash(val: string);
|
|
26
|
-
get href(): string;
|
|
27
|
-
set href(val: string);
|
|
28
|
-
get origin(): string;
|
|
29
|
-
set origin(val: string);
|
|
30
|
-
assign(): void;
|
|
31
|
-
reload(): void;
|
|
32
|
-
replace(url: string): void;
|
|
33
|
-
toString(): string;
|
|
34
|
-
get cache(): RuntimeCache<LocationContext>;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
package/dist/bom/navigator.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const nav: any;
|
package/dist/bom/raf.d.ts
DELETED
package/dist/bom/window.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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 EVENT_CALLBACK_RESULT = "e_result";
|
|
48
|
-
export declare const BEHAVIORS = "behaviors";
|
|
49
|
-
export declare const A = "a";
|
|
50
|
-
/**
|
|
51
|
-
* 页面上下文切换时的行为
|
|
52
|
-
*/
|
|
53
|
-
export declare enum CONTEXT_ACTIONS {
|
|
54
|
-
INIT = "0",
|
|
55
|
-
RESTORE = "1",
|
|
56
|
-
RECOVER = "2",
|
|
57
|
-
DESTORY = "3"
|
|
58
|
-
}
|
package/dist/current.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TaroElement } from './element';
|
|
2
|
-
export declare class AnchorElement extends TaroElement {
|
|
3
|
-
get href(): string;
|
|
4
|
-
set href(val: string);
|
|
5
|
-
get protocol(): any;
|
|
6
|
-
get host(): any;
|
|
7
|
-
get search(): any;
|
|
8
|
-
get hash(): any;
|
|
9
|
-
get hostname(): any;
|
|
10
|
-
get port(): any;
|
|
11
|
-
get pathname(): any;
|
|
12
|
-
setAttribute(qualifiedName: string, value: any): void;
|
|
13
|
-
}
|
package/dist/dom/class-list.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ClassList } from './class-list';
|
|
2
|
-
import { TaroNode } from './node';
|
|
3
|
-
import { Style } from './style';
|
|
4
|
-
import type { Attributes, Func } from '../interface';
|
|
5
|
-
import type { TaroEvent } from './event';
|
|
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 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
button: number;
|
|
13
|
-
timeStamp: number;
|
|
14
|
-
mpEvent: MpEvent | undefined;
|
|
15
|
-
constructor(type: string, opts: EventOptions, event?: MpEvent);
|
|
16
|
-
stopPropagation(): void;
|
|
17
|
-
stopImmediatePropagation(): void;
|
|
18
|
-
preventDefault(): void;
|
|
19
|
-
get target(): any;
|
|
20
|
-
get currentTarget(): any;
|
|
21
|
-
}
|
|
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
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { TaroEventTarget } from './event-target';
|
|
2
|
-
import { NodeType } from './node_types';
|
|
3
|
-
import type { Func, UpdatePayload } from '../interface';
|
|
4
|
-
import type { TaroDocument } from './document';
|
|
5
|
-
import type { TaroElement } from './element';
|
|
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
DELETED
package/dist/dom/root.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TaroElement } from './element';
|
|
2
|
-
import type { Func, MpInstance, UpdatePayload } from '../interface';
|
|
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
|
-
}
|
package/dist/dom/style.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TaroElement } from './element';
|
|
2
|
-
export declare class Style {
|
|
3
|
-
_pending: boolean;
|
|
4
|
-
_usedStyleProp: Set<string>;
|
|
5
|
-
_value: Partial<CSSStyleDeclaration>;
|
|
6
|
-
_element: TaroElement;
|
|
7
|
-
constructor(element: TaroElement);
|
|
8
|
-
private setCssVariables;
|
|
9
|
-
get cssText(): string;
|
|
10
|
-
set cssText(str: string);
|
|
11
|
-
setProperty(propertyName: string, value?: string | null): void;
|
|
12
|
-
removeProperty(propertyName: string): string;
|
|
13
|
-
getPropertyValue(propertyName: string): any;
|
|
14
|
-
}
|
package/dist/dom/svg.d.ts
DELETED
package/dist/dom/text.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TaroNode } from './node';
|
|
2
|
-
import { NodeType } from './node_types';
|
|
3
|
-
export declare class TaroText extends TaroNode {
|
|
4
|
-
_value: string;
|
|
5
|
-
nodeType: NodeType;
|
|
6
|
-
nodeName: string;
|
|
7
|
-
constructor(value: any);
|
|
8
|
-
set textContent(text: string);
|
|
9
|
-
get textContent(): string;
|
|
10
|
-
set nodeValue(text: string);
|
|
11
|
-
get nodeValue(): string;
|
|
12
|
-
set data(text: string);
|
|
13
|
-
get data(): string;
|
|
14
|
-
}
|
package/dist/dom/tree.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { TaroDocument } from '../../dom/document';
|
|
2
|
-
import type { TaroElement } from '../../dom/element';
|
|
3
|
-
interface Node {
|
|
4
|
-
type: string;
|
|
5
|
-
}
|
|
6
|
-
interface Comment extends Node {
|
|
7
|
-
type: 'comment';
|
|
8
|
-
content: string;
|
|
9
|
-
}
|
|
10
|
-
export interface Text extends Node {
|
|
11
|
-
type: 'text';
|
|
12
|
-
content: string;
|
|
13
|
-
}
|
|
14
|
-
export interface Element extends Node {
|
|
15
|
-
type: 'element';
|
|
16
|
-
tagName: string;
|
|
17
|
-
children: ChildNode[];
|
|
18
|
-
attributes: string[];
|
|
19
|
-
}
|
|
20
|
-
export interface ParsedTaroElement extends TaroElement {
|
|
21
|
-
h5tagName?: string;
|
|
22
|
-
}
|
|
23
|
-
declare type ChildNode = Comment | Text | Element;
|
|
24
|
-
export declare function parser(html: string, document: TaroDocument): (import("../..").TaroText | TaroElement)[];
|
|
25
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
interface Position {
|
|
2
|
-
index: number;
|
|
3
|
-
column: number;
|
|
4
|
-
line: number;
|
|
5
|
-
}
|
|
6
|
-
export interface Token {
|
|
7
|
-
type: string;
|
|
8
|
-
content?: string;
|
|
9
|
-
position?: {
|
|
10
|
-
start?: Position;
|
|
11
|
-
end?: Position;
|
|
12
|
-
};
|
|
13
|
-
close?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare class Scaner {
|
|
16
|
-
private tokens;
|
|
17
|
-
private position;
|
|
18
|
-
private html;
|
|
19
|
-
constructor(html: string);
|
|
20
|
-
scan(): Token[];
|
|
21
|
-
private scanText;
|
|
22
|
-
private scanComment;
|
|
23
|
-
private scanTag;
|
|
24
|
-
private scanTagStart;
|
|
25
|
-
private scanTagEnd;
|
|
26
|
-
private scanTagName;
|
|
27
|
-
private scanAttrs;
|
|
28
|
-
private scanSkipTag;
|
|
29
|
-
}
|
|
30
|
-
export {};
|