@tarojs/runtime 3.7.0-canary.1 → 3.8.0-canary.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.
Files changed (66) hide show
  1. package/dist/bom/URL.d.ts +61 -0
  2. package/dist/bom/URLSearchParams.d.ts +14 -0
  3. package/dist/bom/document.d.ts +2 -0
  4. package/dist/bom/getComputedStyle.d.ts +3 -0
  5. package/dist/bom/history.d.ts +29 -0
  6. package/dist/bom/location.d.ts +36 -0
  7. package/dist/bom/navigator.d.ts +1 -0
  8. package/dist/bom/raf.d.ts +5 -0
  9. package/dist/bom/window.d.ts +4 -0
  10. package/dist/constants/index.d.ts +59 -0
  11. package/dist/current.d.ts +19 -0
  12. package/dist/dom/anchor-element.d.ts +13 -0
  13. package/dist/dom/class-list.d.ts +16 -0
  14. package/dist/dom/document.d.ts +20 -0
  15. package/dist/dom/element.d.ts +39 -0
  16. package/dist/dom/event-source.d.ts +7 -0
  17. package/dist/dom/event-target.d.ts +7 -0
  18. package/dist/dom/event.d.ts +23 -0
  19. package/dist/dom/form.d.ts +9 -0
  20. package/dist/dom/node.d.ts +76 -0
  21. package/dist/dom/node_types.d.ts +10 -0
  22. package/dist/dom/root.d.ts +15 -0
  23. package/dist/dom/style.d.ts +14 -0
  24. package/dist/dom/style_properties.d.ts +3 -0
  25. package/dist/dom/svg.d.ts +3 -0
  26. package/dist/dom/text.d.ts +14 -0
  27. package/dist/dom/tree.d.ts +4 -0
  28. package/dist/dom-external/element.d.ts +3 -0
  29. package/dist/dom-external/index.d.ts +1 -0
  30. package/dist/dom-external/inner-html/html.d.ts +2 -0
  31. package/dist/dom-external/inner-html/parser.d.ts +25 -0
  32. package/dist/dom-external/inner-html/scaner.d.ts +30 -0
  33. package/dist/dom-external/inner-html/style.d.ts +27 -0
  34. package/dist/dom-external/inner-html/tags.d.ts +8 -0
  35. package/dist/dom-external/inner-html/utils.d.ts +1 -0
  36. package/dist/dom-external/mutation-observer/implements.d.ts +52 -0
  37. package/dist/dom-external/mutation-observer/index.d.ts +13 -0
  38. package/dist/dom-external/mutation-observer/record.d.ts +24 -0
  39. package/dist/dom-external/node.d.ts +11 -0
  40. package/dist/dsl/common.d.ts +16 -0
  41. package/dist/dsl/instance.d.ts +91 -0
  42. package/dist/emitter/emitter.d.ts +4 -0
  43. package/dist/env.d.ts +7 -0
  44. package/dist/hydrate.d.ts +10 -0
  45. package/dist/index.d.ts +33 -0
  46. package/dist/interface/element.d.ts +4 -0
  47. package/dist/interface/event-target.d.ts +10 -0
  48. package/dist/interface/event.d.ts +15 -0
  49. package/dist/interface/hydrate.d.ts +29 -0
  50. package/dist/interface/index.d.ts +7 -0
  51. package/dist/interface/node.d.ts +7 -0
  52. package/dist/interface/options.d.ts +16 -0
  53. package/dist/interface/utils.d.ts +2 -0
  54. package/dist/next-tick.d.ts +2 -0
  55. package/dist/options.d.ts +2 -0
  56. package/dist/perf.d.ts +7 -0
  57. package/dist/runtime.esm.d.ts +136 -66
  58. package/dist/runtime.esm.js +85 -60
  59. package/dist/runtime.esm.js.map +1 -1
  60. package/dist/utils/cache.d.ts +12 -0
  61. package/dist/utils/index.d.ts +23 -0
  62. package/package.json +6 -11
  63. package/dist/runtime.cjs.d.ts +0 -711
  64. package/dist/runtime.cjs.js +0 -4525
  65. package/dist/runtime.h5.d.ts +0 -711
  66. package/dist/runtime.h5.js +0 -3281
@@ -0,0 +1,61 @@
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
+ };
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,2 @@
1
+ declare let document: any;
2
+ export { document };
@@ -0,0 +1,3 @@
1
+ import type { TaroElement } from '../dom/element';
2
+ import type { Style } from '../dom/style';
3
+ export declare function getComputedStyle(element: TaroElement): Style;
@@ -0,0 +1,29 @@
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
+ type Options = {
10
+ window: any;
11
+ };
12
+ 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(): Record<string, any> | null;
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 {};
@@ -0,0 +1,36 @@
1
+ import { Events } from '../emitter/emitter';
2
+ import { RuntimeCache } from '../utils/cache';
3
+ type Options = {
4
+ window: any;
5
+ };
6
+ 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 {};
@@ -0,0 +1 @@
1
+ export declare const nav: any;
@@ -0,0 +1,5 @@
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 };
@@ -0,0 +1,4 @@
1
+ declare let window: any;
2
+ export declare const location: any;
3
+ export declare const history: any;
4
+ export { window };
@@ -0,0 +1,59 @@
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 COMPILE_MODE = "compileMode";
39
+ export declare const CATCHMOVE = "catchMove";
40
+ export declare const CATCH_VIEW = "catch-view";
41
+ export declare const COMMENT = "comment";
42
+ export declare const ON_LOAD = "onLoad";
43
+ export declare const ON_READY = "onReady";
44
+ export declare const ON_SHOW = "onShow";
45
+ export declare const ON_HIDE = "onHide";
46
+ export declare const OPTIONS = "options";
47
+ export declare const EXTERNAL_CLASSES = "externalClasses";
48
+ export declare const EVENT_CALLBACK_RESULT = "e_result";
49
+ export declare const BEHAVIORS = "behaviors";
50
+ export declare const A = "a";
51
+ /**
52
+ * 页面上下文切换时的行为
53
+ */
54
+ export declare enum CONTEXT_ACTIONS {
55
+ INIT = "0",
56
+ RESTORE = "1",
57
+ RECOVER = "2",
58
+ DESTORY = "3"
59
+ }
@@ -0,0 +1,19 @@
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 {};
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,16 @@
1
+ import type { TaroElement } from './element';
2
+ export declare class ClassList {
3
+ private el;
4
+ private tokenList;
5
+ constructor(className: string, el: TaroElement);
6
+ get value(): string;
7
+ get length(): number;
8
+ add(): void;
9
+ remove(): void;
10
+ contains(token: string): boolean;
11
+ toggle(token: string, force: boolean): boolean;
12
+ replace(token: string, replacement_token: string): void;
13
+ toString(): string;
14
+ private checkTokenIsValid;
15
+ private _update;
16
+ }
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,39 @@
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
+ ctx?: any;
8
+ tagName: string;
9
+ props: Record<string, any>;
10
+ style: Style;
11
+ dataset: Record<string, unknown>;
12
+ innerHTML: string;
13
+ constructor();
14
+ private _stopPropagation;
15
+ get id(): string;
16
+ set id(val: string);
17
+ get className(): string;
18
+ set className(val: string);
19
+ get cssText(): string;
20
+ get classList(): ClassList;
21
+ get children(): TaroElement[];
22
+ get attributes(): Attributes[];
23
+ get textContent(): string;
24
+ set textContent(text: string);
25
+ hasAttribute(qualifiedName: string): boolean;
26
+ hasAttributes(): boolean;
27
+ get focus(): () => void;
28
+ set focus(value: () => void);
29
+ blur(): void;
30
+ setAttribute(qualifiedName: string, value: any): void;
31
+ removeAttribute(qualifiedName: string): void;
32
+ getAttribute(qualifiedName: string): string;
33
+ getElementsByTagName(tagName: string): TaroElement[];
34
+ getElementsByClassName(className: string): TaroElement[];
35
+ dispatchEvent(event: TaroEvent): boolean;
36
+ addEventListener(type: any, handler: any, options: any): void;
37
+ removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
38
+ static extend(methodName: string, options: Func | Record<string, any>): void;
39
+ }
@@ -0,0 +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 {};
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,23 @@
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;
@@ -0,0 +1,9 @@
1
+ import { TaroElement } from './element';
2
+ import type { TaroEvent } from './event';
3
+ export declare class FormElement extends TaroElement {
4
+ get type(): string;
5
+ set type(val: string);
6
+ get value(): string | boolean | number | any[];
7
+ set value(val: string | boolean | number | any[]);
8
+ dispatchEvent(event: TaroEvent): boolean;
9
+ }
@@ -0,0 +1,76 @@
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
+ private updateSingleChild;
22
+ get _root(): TaroRootElement | null;
23
+ protected findIndex(refChild: TaroNode): number;
24
+ get _path(): string;
25
+ get nextSibling(): TaroNode | null;
26
+ get previousSibling(): TaroNode | null;
27
+ get parentElement(): TaroElement | null;
28
+ get firstChild(): TaroNode | null;
29
+ get lastChild(): TaroNode | null;
30
+ /**
31
+ * @textContent 目前只能置空子元素
32
+ * @TODO 等待完整 innerHTML 实现
33
+ */
34
+ set textContent(text: string);
35
+ /**
36
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
37
+ * @scenario
38
+ * [A,B,C]
39
+ * 1. insert D before C, D has no parent
40
+ * 2. insert D before C, D has the same parent of C
41
+ * 3. insert D before C, D has the different parent of C
42
+ */
43
+ insertBefore<T extends TaroNode>(newChild: T, refChild?: TaroNode | null, isReplace?: boolean): T;
44
+ /**
45
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
46
+ * @scenario
47
+ * [A,B,C]
48
+ * 1. append C, C has no parent
49
+ * 2. append C, C has the same parent of B
50
+ * 3. append C, C has the different parent of B
51
+ */
52
+ appendChild(newChild: TaroNode): TaroNode;
53
+ /**
54
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
55
+ * @scenario
56
+ * [A,B,C]
57
+ * 1. replace B with C, C has no parent
58
+ * 2. replace B with C, C has no parent, C has the same parent of B
59
+ * 3. replace B with C, C has no parent, C has the different parent of B
60
+ */
61
+ replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode | undefined;
62
+ /**
63
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
64
+ * @scenario
65
+ * [A,B,C]
66
+ * 1. remove A or B
67
+ * 2. remove C
68
+ */
69
+ removeChild<T extends TaroNode>(child: T, options?: RemoveChildOptions): T;
70
+ remove(options?: RemoveChildOptions): void;
71
+ hasChildNodes(): boolean;
72
+ enqueueUpdate(payload: UpdatePayload): void;
73
+ get ownerDocument(): TaroDocument;
74
+ static extend(methodName: string, options: Func | Record<string, any>): void;
75
+ }
76
+ export {};
@@ -0,0 +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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ declare const styleProperties: string[];
2
+ /** 非常用 style */
3
+ export { styleProperties };
@@ -0,0 +1,3 @@
1
+ import { TaroElement } from './element';
2
+ export declare class SVGElement extends TaroElement {
3
+ }
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ import type { TaroElement } from './element';
2
+ type Filter = (element: TaroElement) => boolean;
3
+ export declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
4
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TaroElement } from '../dom/element';
2
+ export declare function getBoundingClientRectImpl(this: TaroElement): Promise<null>;
3
+ export declare function getTemplateContent(ctx: TaroElement): TaroElement | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TaroNode } from '../../dom/node';
2
+ export declare function setInnerHTML(element: TaroNode, html: string): void;
@@ -0,0 +1,25 @@
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
+ type ChildNode = Comment | Text | Element;
24
+ export declare function parser(html: string, document: TaroDocument): (import("../..").TaroText | TaroElement)[];
25
+ export {};
@@ -0,0 +1,30 @@
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 {};
@@ -0,0 +1,27 @@
1
+ import type { ParsedTaroElement } from './parser';
2
+ interface ISelector {
3
+ isChild: boolean;
4
+ isGeneralSibling: boolean;
5
+ isAdjacentSibling: boolean;
6
+ tag: string | null;
7
+ id: string | null;
8
+ class: string[];
9
+ attrs: {
10
+ all: boolean;
11
+ key: string;
12
+ value?: string | null;
13
+ }[];
14
+ }
15
+ interface IStyle {
16
+ content: string;
17
+ selectorList: ISelector[];
18
+ }
19
+ export default class StyleTagParser {
20
+ styles: IStyle[];
21
+ extractStyle(src: string): string;
22
+ stringToSelector(style: string): void;
23
+ parseSelector(src: string): ISelector[];
24
+ matchStyle(tagName: string, el: ParsedTaroElement, list: number[]): string;
25
+ matchCurrent(tagName: string, el: ParsedTaroElement, selector: ISelector): boolean;
26
+ }
27
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
2
+ export declare const specialMiniElements: {
3
+ img: string;
4
+ iframe: string;
5
+ };
6
+ export declare const isMiniElements: (key: string) => boolean;
7
+ export declare const isInlineElements: (key: string) => boolean;
8
+ export declare const isBlockElements: (key: string) => boolean;
@@ -0,0 +1 @@
1
+ export declare function unquote(str: string): string;