@tarojs/runtime 4.1.0-alpha.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/bom/URL.d.ts +6 -3
  2. package/dist/bom/URLSearchParams.d.ts +2 -1
  3. package/dist/bom/document.d.ts +3 -2
  4. package/dist/bom/getComputedStyle.d.ts +5 -4
  5. package/dist/bom/history.d.ts +7 -5
  6. package/dist/bom/location.d.ts +5 -3
  7. package/dist/bom/navigator.d.ts +2 -1
  8. package/dist/bom/raf.d.ts +2 -2
  9. package/dist/bom/window.d.ts +9 -8
  10. package/dist/constants/index.d.ts +53 -52
  11. package/dist/current.d.ts +5 -5
  12. package/dist/dom/anchor-element.d.ts +3 -2
  13. package/dist/dom/class-list.d.ts +3 -2
  14. package/dist/dom/document.d.ts +10 -6
  15. package/dist/dom/element.d.ts +7 -6
  16. package/dist/dom/event-source.d.ts +3 -3
  17. package/dist/dom/event-target.d.ts +3 -2
  18. package/dist/dom/event.d.ts +6 -5
  19. package/dist/dom/form.d.ts +4 -3
  20. package/dist/dom/node.d.ts +39 -8
  21. package/dist/dom/root.d.ts +4 -3
  22. package/dist/dom/style.d.ts +3 -2
  23. package/dist/dom/svg.d.ts +3 -2
  24. package/dist/dom/text.d.ts +4 -3
  25. package/dist/dom/transfer.d.ts +3 -2
  26. package/dist/dom/tree.d.ts +3 -3
  27. package/dist/dom-external/element.d.ts +4 -3
  28. package/dist/dom-external/inner-html/html.d.ts +3 -2
  29. package/dist/dom-external/inner-html/parser.d.ts +7 -7
  30. package/dist/dom-external/inner-html/scaner.d.ts +3 -3
  31. package/dist/dom-external/inner-html/style.d.ts +3 -3
  32. package/dist/dom-external/inner-html/tags.d.ts +6 -5
  33. package/dist/dom-external/inner-html/utils.d.ts +2 -1
  34. package/dist/dom-external/mutation-observer/implements.d.ts +25 -6
  35. package/dist/dom-external/mutation-observer/index.d.ts +5 -6
  36. package/dist/dom-external/node.d.ts +6 -5
  37. package/dist/dsl/common.d.ts +15 -14
  38. package/dist/emitter/emitter.d.ts +2 -2
  39. package/dist/env.d.ts +2 -2
  40. package/dist/hydrate.d.ts +5 -4
  41. package/dist/index-26658829.d.ts +23 -0
  42. package/dist/index.cjs.d.ts +813 -0
  43. package/dist/index.cjs.js +4 -4
  44. package/dist/index.d.ts +32 -33
  45. package/dist/{dsl/instance.d.ts → instance-530729bd.d.ts} +14 -13
  46. package/dist/next-tick.d.ts +3 -2
  47. package/dist/{dom/node_types.d.ts → node_types-9ac5b4dd.d.ts} +2 -1
  48. package/dist/{interface/options.d.ts → options-530729bd.d.ts} +5 -4
  49. package/dist/options.d.ts +3 -2
  50. package/dist/perf.d.ts +2 -2
  51. package/dist/polyfill/array.d.ts +3 -2
  52. package/dist/polyfill/intersection-observer.d.ts +2 -1
  53. package/dist/polyfill/object.d.ts +4 -3
  54. package/dist/{dom-external/mutation-observer/record.d.ts → record-32b054d8.d.ts} +4 -3
  55. package/dist/runtime.esm.d.ts +813 -0
  56. package/dist/utils/cache.d.ts +2 -1
  57. package/dist/utils/index.d.ts +18 -17
  58. package/dist/utils/lodash.d.ts +3 -2
  59. package/dist/utils/router.d.ts +8 -7
  60. package/package.json +4 -3
  61. package/dist/interface/element.d.ts +0 -4
  62. package/dist/interface/event-target.d.ts +0 -11
  63. package/dist/interface/event.d.ts +0 -15
  64. package/dist/interface/hydrate.d.ts +0 -29
  65. package/dist/interface/index.d.ts +0 -7
  66. package/dist/interface/node.d.ts +0 -7
  67. package/dist/interface/utils.d.ts +0 -2
package/dist/bom/URL.d.ts CHANGED
@@ -22,8 +22,10 @@ declare class TaroURL {
22
22
  get origin(): string;
23
23
  set origin(val: string);
24
24
  get searchParams(): URLSearchParams;
25
+ // public method
25
26
  toString(): string;
26
27
  toJSON(): string;
28
+ // convenient for deconstructor
27
29
  _toRaw(): {
28
30
  protocol: string;
29
31
  port: string;
@@ -36,9 +38,8 @@ declare class TaroURL {
36
38
  href: string;
37
39
  };
38
40
  }
39
- export type { TaroURL };
40
- export declare const TaroURLProvider: typeof TaroURL;
41
- export declare function parseUrl(url?: string): {
41
+ declare const TaroURLProvider: typeof TaroURL;
42
+ declare function parseUrl(url?: string): {
42
43
  href: string;
43
44
  origin: string;
44
45
  protocol: string;
@@ -49,3 +50,5 @@ export declare function parseUrl(url?: string): {
49
50
  search: string;
50
51
  hash: string;
51
52
  };
53
+ export type { TaroURL };
54
+ export { TaroURLProvider, parseUrl };
@@ -1 +1,2 @@
1
- export declare const URLSearchParams: any;
1
+ declare const URLSearchParams: any;
2
+ export { URLSearchParams };
@@ -1,2 +1,3 @@
1
- import { TaroDocument } from '../dom/document';
2
- export declare const taroDocumentProvider: TaroDocument;
1
+ import { TaroDocument } from "../dom/document.js";
2
+ declare const taroDocumentProvider: TaroDocument;
3
+ export { taroDocumentProvider };
@@ -1,4 +1,5 @@
1
- import type { TaroElement } from '../dom/element';
2
- import type { Style } from '../dom/style';
3
- export type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
4
- export declare const taroGetComputedStyleProvider: TGetComputedStyle;
1
+ import { TaroElement } from "../dom/element.js";
2
+ import { Style } from "../dom/style.js";
3
+ type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
4
+ declare const taroGetComputedStyleProvider: TGetComputedStyle;
5
+ export { TGetComputedStyle, taroGetComputedStyleProvider };
@@ -1,7 +1,7 @@
1
- import { Events } from '../emitter/emitter';
2
- import { RuntimeCache } from '../utils/cache';
3
- import type { TaroLocation } from './location';
4
- export interface HistoryState {
1
+ import { Events } from "../emitter/emitter.js";
2
+ import { RuntimeCache } from "../utils/cache.js";
3
+ import { TaroLocation } from "./location.js";
4
+ interface HistoryState {
5
5
  state: Record<string, any> | null;
6
6
  title: string;
7
7
  url: string;
@@ -19,6 +19,7 @@ declare class TaroHistory extends Events {
19
19
  constructor(location: TaroLocation, options: Options);
20
20
  get length(): number;
21
21
  get state(): Record<string, any> | null;
22
+ /* public method */
22
23
  go(delta: number): void;
23
24
  back(): void;
24
25
  forward(): void;
@@ -26,5 +27,6 @@ declare class TaroHistory extends Events {
26
27
  replaceState(state: any, title: string, url: string): void;
27
28
  get cache(): RuntimeCache<HistoryContext>;
28
29
  }
30
+ declare const History: typeof TaroHistory;
31
+ export { HistoryState, History };
29
32
  export type { TaroHistory };
30
- export declare const History: typeof TaroHistory;
@@ -1,5 +1,5 @@
1
- import { Events } from '../emitter/emitter';
2
- import { RuntimeCache } from '../utils/cache';
1
+ import { Events } from "../emitter/emitter.js";
2
+ import { RuntimeCache } from "../utils/cache.js";
3
3
  type Options = {
4
4
  window: any;
5
5
  };
@@ -27,11 +27,13 @@ declare class TaroLocation extends Events {
27
27
  set href(val: string);
28
28
  get origin(): string;
29
29
  set origin(val: string);
30
+ /* public method */
30
31
  assign(): void;
31
32
  reload(): void;
32
33
  replace(url: string): void;
33
34
  toString(): string;
34
35
  get cache(): RuntimeCache<LocationContext>;
35
36
  }
37
+ declare const Location: typeof TaroLocation;
36
38
  export type { TaroLocation };
37
- export declare const Location: typeof TaroLocation;
39
+ export { Location };
@@ -1 +1,2 @@
1
- export declare const nav: typeof window.navigator;
1
+ declare const nav: typeof window.navigator;
2
+ export { nav };
package/dist/bom/raf.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- export declare let now: () => number;
2
+ declare let now: () => number;
3
3
  declare const _raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
4
4
  declare const _caf: typeof cancelAnimationFrame;
5
- export { _caf as caf, _raf as raf };
5
+ export { now, _caf as caf, _raf as raf };
@@ -1,25 +1,26 @@
1
1
  /// <reference types="node" />
2
- import { Events } from '../emitter/emitter';
3
- import type { TaroHistory } from './history';
4
- import type { TaroLocation } from './location';
2
+ import { Events } from "../emitter/emitter.js";
3
+ import { TaroHistory } from "./history.js";
4
+ import { TaroLocation } from "./location.js";
5
5
  declare class TaroWindow extends Events {
6
6
  navigator: Navigator;
7
7
  requestAnimationFrame: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
8
8
  cancelAnimationFrame: typeof cancelAnimationFrame;
9
- getComputedStyle: import("./getComputedStyle").TGetComputedStyle;
9
+ getComputedStyle: import("./getComputedStyle.js").TGetComputedStyle;
10
10
  Date: DateConstructor;
11
11
  location: TaroLocation;
12
12
  history: TaroHistory;
13
13
  XMLHttpRequest?: Partial<XMLHttpRequest>;
14
14
  constructor();
15
15
  initEvent(): void;
16
- get document(): import("../dom/document").TaroDocument;
16
+ get document(): import("../dom/document.js").TaroDocument;
17
17
  addEventListener(event: string, callback: (arg: any) => void): void;
18
18
  removeEventListener(event: string, callback: (arg: any) => void): void;
19
19
  setTimeout(...args: Parameters<typeof setTimeout>): NodeJS.Timeout;
20
20
  clearTimeout(...args: Parameters<typeof clearTimeout>): void;
21
21
  }
22
+ declare const taroWindowProvider: TaroWindow;
23
+ declare const taroLocationProvider: TaroLocation;
24
+ declare const taroHistoryProvider: TaroHistory;
22
25
  export type { TaroWindow };
23
- export declare const taroWindowProvider: TaroWindow;
24
- export declare const taroLocationProvider: TaroLocation;
25
- export declare const taroHistoryProvider: TaroHistory;
26
+ export { taroWindowProvider, taroLocationProvider, taroHistoryProvider };
@@ -1,60 +1,61 @@
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 CLICK_VIEW = "click-view";
23
- export declare const PROPS = "props";
24
- export declare const DATASET = "dataset";
25
- export declare const OBJECT = "object";
26
- export declare const VALUE = "value";
27
- export declare const INPUT = "input";
28
- export declare const CHANGE = "change";
29
- export declare const CUSTOM_WRAPPER = "custom-wrapper";
30
- export declare const TARGET = "target";
31
- export declare const CURRENT_TARGET = "currentTarget";
32
- export declare const TYPE = "type";
33
- export declare const CONFIRM = "confirm";
34
- export declare const TIME_STAMP = "timeStamp";
35
- export declare const KEY_CODE = "keyCode";
36
- export declare const TOUCHMOVE = "touchmove";
37
- export declare const DATE = "Date";
38
- export declare const SET_TIMEOUT = "setTimeout";
39
- export declare const COMPILE_MODE = "compileMode";
40
- export declare const CATCHMOVE = "catchMove";
41
- export declare const CATCH_VIEW = "catch-view";
42
- export declare const COMMENT = "comment";
43
- export declare const ON_LOAD = "onLoad";
44
- export declare const ON_READY = "onReady";
45
- export declare const ON_SHOW = "onShow";
46
- export declare const ON_HIDE = "onHide";
47
- export declare const OPTIONS = "options";
48
- export declare const EXTERNAL_CLASSES = "externalClasses";
49
- export declare const EVENT_CALLBACK_RESULT = "e_result";
50
- export declare const BEHAVIORS = "behaviors";
51
- export declare const A = "a";
1
+ declare const PROPERTY_THRESHOLD = 2046;
2
+ declare const TARO_RUNTIME = "Taro runtime";
3
+ declare const HOOKS_APP_ID = "taro-app";
4
+ declare const SET_DATA = "\u5C0F\u7A0B\u5E8F setData";
5
+ declare const PAGE_INIT = "\u9875\u9762\u521D\u59CB\u5316";
6
+ declare const ROOT_STR = "root";
7
+ declare const HTML = "html";
8
+ declare const HEAD = "head";
9
+ declare const BODY = "body";
10
+ declare const APP = "app";
11
+ declare const CONTAINER = "container";
12
+ declare const DOCUMENT_ELEMENT_NAME = "#document";
13
+ declare const DOCUMENT_FRAGMENT = "document-fragment";
14
+ declare const ID = "id";
15
+ declare const UID = "uid";
16
+ declare const CLASS = "class";
17
+ declare const STYLE = "style";
18
+ declare const FOCUS = "focus";
19
+ declare const VIEW = "view";
20
+ declare const STATIC_VIEW = "static-view";
21
+ declare const PURE_VIEW = "pure-view";
22
+ declare const CLICK_VIEW = "click-view";
23
+ declare const PROPS = "props";
24
+ declare const DATASET = "dataset";
25
+ declare const OBJECT = "object";
26
+ declare const VALUE = "value";
27
+ declare const INPUT = "input";
28
+ declare const CHANGE = "change";
29
+ declare const CUSTOM_WRAPPER = "custom-wrapper";
30
+ declare const TARGET = "target";
31
+ declare const CURRENT_TARGET = "currentTarget";
32
+ declare const TYPE = "type";
33
+ declare const CONFIRM = "confirm";
34
+ declare const TIME_STAMP = "timeStamp";
35
+ declare const KEY_CODE = "keyCode";
36
+ declare const TOUCHMOVE = "touchmove";
37
+ declare const DATE = "Date";
38
+ declare const SET_TIMEOUT = "setTimeout";
39
+ declare const COMPILE_MODE = "compileMode";
40
+ declare const CATCHMOVE = "catchMove";
41
+ declare const CATCH_VIEW = "catch-view";
42
+ declare const COMMENT = "comment";
43
+ declare const ON_LOAD = "onLoad";
44
+ declare const ON_READY = "onReady";
45
+ declare const ON_SHOW = "onShow";
46
+ declare const ON_HIDE = "onHide";
47
+ declare const OPTIONS = "options";
48
+ declare const EXTERNAL_CLASSES = "externalClasses";
49
+ declare const EVENT_CALLBACK_RESULT = "e_result";
50
+ declare const BEHAVIORS = "behaviors";
51
+ declare const A = "a";
52
52
  /**
53
53
  * 页面上下文切换时的行为
54
54
  */
55
- export declare enum CONTEXT_ACTIONS {
55
+ declare enum CONTEXT_ACTIONS {
56
56
  INIT = "0",
57
57
  RESTORE = "1",
58
58
  RECOVER = "2",
59
59
  DESTORY = "3"
60
60
  }
61
+ export { PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, CLICK_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, COMPILE_MODE, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS };
package/dist/current.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AppInstance, PageInstance } from './dsl/instance';
2
- export interface Router {
1
+ import { AppInstance, PageInstance } from "./instance-530729bd.js";
2
+ interface Router {
3
3
  params: Record<string, unknown>;
4
4
  path: string;
5
5
  $taroPath: string;
@@ -14,6 +14,6 @@ interface Current {
14
14
  page: PageInstance | null;
15
15
  preloadData?: any;
16
16
  }
17
- export declare const Current: Current;
18
- export declare const getCurrentInstance: () => Current;
19
- export {};
17
+ declare const Current: Current;
18
+ declare const getCurrentInstance: () => Current;
19
+ export { Router, Current, getCurrentInstance };
@@ -1,5 +1,5 @@
1
- import { TaroElement } from './element';
2
- export declare class AnchorElement extends TaroElement {
1
+ import { TaroElement } from "./element.js";
2
+ declare class AnchorElement extends TaroElement {
3
3
  get href(): string;
4
4
  set href(val: string);
5
5
  get protocol(): any;
@@ -11,3 +11,4 @@ export declare class AnchorElement extends TaroElement {
11
11
  get pathname(): any;
12
12
  setAttribute(qualifiedName: string, value: any): void;
13
13
  }
14
+ export { AnchorElement };
@@ -1,5 +1,5 @@
1
- import type { TaroElement } from './element';
2
- export declare class ClassList {
1
+ import { TaroElement } from "./element.js";
2
+ declare class ClassList {
3
3
  private el;
4
4
  private tokenList;
5
5
  constructor(className: string, el: TaroElement);
@@ -14,3 +14,4 @@ export declare class ClassList {
14
14
  private checkTokenIsValid;
15
15
  private _update;
16
16
  }
17
+ export { ClassList };
@@ -1,9 +1,9 @@
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 {
1
+ import { TaroElement } from "./element.js";
2
+ import { createEvent } from "./event.js";
3
+ import { FormElement } from "./form.js";
4
+ import { TaroRootElement } from "./root.js";
5
+ import { TaroText } from "./text.js";
6
+ declare class TaroDocument extends TaroElement {
7
7
  documentElement: TaroElement;
8
8
  head: TaroElement;
9
9
  body: TaroElement;
@@ -11,11 +11,15 @@ export declare class TaroDocument extends TaroElement {
11
11
  cookie?: string;
12
12
  constructor();
13
13
  createElement(type: string): TaroElement | TaroRootElement | FormElement;
14
+ // an ugly fake createElementNS to deal with @vue/runtime-dom's
15
+ // support mounting app to svg container since vue@3.0.8
14
16
  createElementNS(_svgNS: string, type: string): TaroElement | TaroRootElement | FormElement;
15
17
  createTextNode(text: string): TaroText;
16
18
  getElementById<T extends TaroElement>(id: string | undefined | null): T | null;
17
19
  querySelector<T extends TaroElement>(query: string): T | null;
18
20
  querySelectorAll(): never[];
21
+ // @TODO: @PERF: 在 hydrate 移除掉空的 node
19
22
  createComment(): TaroText;
20
23
  get defaultView(): any;
21
24
  }
25
+ export { TaroDocument };
@@ -1,9 +1,9 @@
1
- import { ClassList } from './class-list';
2
- import { TaroNode } from './node';
3
- import { Style } from './style';
4
- import type { Attributes, TFunc } from '../interface';
5
- import type { TaroEvent } from './event';
6
- export declare class TaroElement extends TaroNode {
1
+ import { ClassList } from "./class-list.js";
2
+ import { TaroNode } from "./node.js";
3
+ import { Style } from "./style.js";
4
+ import { Attributes, TFunc } from "../index-26658829.js";
5
+ import { TaroEvent } from "./event.js";
6
+ declare class TaroElement extends TaroNode {
7
7
  ctx?: any;
8
8
  tagName: string;
9
9
  props: Record<string, any>;
@@ -37,3 +37,4 @@ export declare class TaroElement extends TaroNode {
37
37
  removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
38
38
  static extend(methodName: string, options: TFunc | Record<string, any>): void;
39
39
  }
40
+ export { TaroElement };
@@ -1,7 +1,7 @@
1
- import type { TaroNode } from './node';
1
+ import { TaroNode } from "./node.js";
2
2
  interface IEventSource extends Map<string | undefined | null, TaroNode> {
3
3
  removeNode(child: TaroNode): void;
4
4
  removeNodeTree(child: TaroNode): void;
5
5
  }
6
- export declare const eventSource: IEventSource;
7
- export {};
6
+ declare const eventSource: IEventSource;
7
+ export { eventSource };
@@ -1,8 +1,9 @@
1
- import type { AddEventListenerOptions, EventHandler } from '../interface';
2
- export declare class TaroEventTarget {
1
+ import { AddEventListenerOptions, EventHandler } from "../index-26658829.js";
2
+ declare class TaroEventTarget {
3
3
  __handlers: Record<string, EventHandler[]>;
4
4
  addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
5
5
  removeEventListener(type: string, handler: EventHandler): void;
6
6
  isAnyEventBinded(): boolean;
7
7
  isOnlyClickBinded(): boolean;
8
8
  }
9
+ export { TaroEventTarget };
@@ -1,6 +1,6 @@
1
- import type { EventOptions, MpEvent } from '../interface';
2
- import type { TaroElement } from './element';
3
- export declare class TaroEvent {
1
+ import { EventOptions, MpEvent } from "../index-26658829.js";
2
+ import { TaroElement } from "./element.js";
3
+ declare class TaroEvent {
4
4
  private cacheTarget;
5
5
  private cacheCurrentTarget;
6
6
  type: string;
@@ -19,5 +19,6 @@ export declare class TaroEvent {
19
19
  get target(): any;
20
20
  get currentTarget(): any;
21
21
  }
22
- export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
23
- export declare function eventHandler(event: MpEvent): any;
22
+ declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
23
+ declare function eventHandler(event: MpEvent): any;
24
+ export { TaroEvent, createEvent, eventHandler };
@@ -1,9 +1,10 @@
1
- import { TaroElement } from './element';
2
- import type { TaroEvent } from './event';
3
- export declare class FormElement extends TaroElement {
1
+ import { TaroElement } from "./element.js";
2
+ import { TaroEvent } from "./event.js";
3
+ declare class FormElement extends TaroElement {
4
4
  get type(): string;
5
5
  set type(val: string);
6
6
  get value(): string | boolean | number | any[];
7
7
  set value(val: string | boolean | number | any[]);
8
8
  dispatchEvent(event: TaroEvent): boolean;
9
9
  }
10
+ export { FormElement };
@@ -1,14 +1,14 @@
1
- import { TaroEventTarget } from './event-target';
2
- import { NodeType } from './node_types';
3
- import type { TFunc, UpdatePayload } from '../interface';
4
- import type { TaroDocument } from './document';
5
- import type { TaroElement } from './element';
6
- import type { TaroRootElement } from './root';
1
+ import { TaroEventTarget } from "./event-target.js";
2
+ import { NodeType } from "../node_types-9ac5b4dd.js";
3
+ import { TFunc, UpdatePayload } from "../index-26658829.js";
4
+ import { TaroDocument } from "./document.js";
5
+ import { TaroElement } from "./element.js";
6
+ import { TaroRootElement } from "./root.js";
7
7
  interface RemoveChildOptions {
8
8
  cleanRef?: boolean;
9
9
  doUpdate?: boolean;
10
10
  }
11
- export declare class TaroNode extends TaroEventTarget {
11
+ declare class TaroNode extends TaroEventTarget {
12
12
  uid: string;
13
13
  sid: string;
14
14
  nodeType: NodeType;
@@ -32,6 +32,14 @@ export declare class TaroNode extends TaroEventTarget {
32
32
  * @TODO 等待完整 innerHTML 实现
33
33
  */
34
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
+ */
35
43
  /**
36
44
  * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/insertBefore
37
45
  * @scenario
@@ -41,6 +49,14 @@ export declare class TaroNode extends TaroEventTarget {
41
49
  * 3. insert D before C, D has the different parent of C
42
50
  */
43
51
  insertBefore<T extends TaroNode>(newChild: T, refChild?: TaroNode | null, isReplace?: boolean): T;
52
+ /**
53
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
54
+ * @scenario
55
+ * [A,B,C]
56
+ * 1. append C, C has no parent
57
+ * 2. append C, C has the same parent of B
58
+ * 3. append C, C has the different parent of B
59
+ */
44
60
  /**
45
61
  * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/appendChild
46
62
  * @scenario
@@ -50,6 +66,14 @@ export declare class TaroNode extends TaroEventTarget {
50
66
  * 3. append C, C has the different parent of B
51
67
  */
52
68
  appendChild(newChild: TaroNode): TaroNode;
69
+ /**
70
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
71
+ * @scenario
72
+ * [A,B,C]
73
+ * 1. replace B with C, C has no parent
74
+ * 2. replace B with C, C has no parent, C has the same parent of B
75
+ * 3. replace B with C, C has no parent, C has the different parent of B
76
+ */
53
77
  /**
54
78
  * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/replaceChild
55
79
  * @scenario
@@ -59,6 +83,13 @@ export declare class TaroNode extends TaroEventTarget {
59
83
  * 3. replace B with C, C has no parent, C has the different parent of B
60
84
  */
61
85
  replaceChild(newChild: TaroNode, oldChild: TaroNode): TaroNode | undefined;
86
+ /**
87
+ * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
88
+ * @scenario
89
+ * [A,B,C]
90
+ * 1. remove A or B
91
+ * 2. remove C
92
+ */
62
93
  /**
63
94
  * @doc https://developer.mozilla.org/zh-CN/docs/Web/API/Node/removeChild
64
95
  * @scenario
@@ -73,4 +104,4 @@ export declare class TaroNode extends TaroEventTarget {
73
104
  get ownerDocument(): TaroDocument;
74
105
  static extend(methodName: string, options: TFunc | Record<string, any>): void;
75
106
  }
76
- export {};
107
+ export { TaroNode };
@@ -1,6 +1,6 @@
1
- import { TaroElement } from './element';
2
- import type { MpInstance, TFunc, UpdatePayload } from '../interface';
3
- export declare class TaroRootElement extends TaroElement {
1
+ import { TaroElement } from "./element.js";
2
+ import { MpInstance, TFunc, UpdatePayload } from "../index-26658829.js";
3
+ declare class TaroRootElement extends TaroElement {
4
4
  private updatePayloads;
5
5
  private updateCallbacks;
6
6
  pendingUpdate: boolean;
@@ -14,3 +14,4 @@ export declare class TaroRootElement extends TaroElement {
14
14
  enqueueUpdateCallback(cb: TFunc, ctx?: Record<string, any>): void;
15
15
  flushUpdateCallback(): void;
16
16
  }
17
+ export { TaroRootElement };
@@ -1,5 +1,5 @@
1
- import { TaroElement } from './element';
2
- export declare class Style {
1
+ import { TaroElement } from "./element.js";
2
+ declare class Style {
3
3
  _pending: boolean;
4
4
  _usedStyleProp: Set<string>;
5
5
  _value: Partial<CSSStyleDeclaration>;
@@ -12,3 +12,4 @@ export declare class Style {
12
12
  removeProperty(propertyName: string): string;
13
13
  getPropertyValue(propertyName: string): any;
14
14
  }
15
+ export { Style };
package/dist/dom/svg.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- import { TaroElement } from './element';
2
- export declare class SVGElement extends TaroElement {
1
+ import { TaroElement } from "./element.js";
2
+ declare class SVGElement extends TaroElement {
3
3
  }
4
+ export { SVGElement };
@@ -1,6 +1,6 @@
1
- import { TaroNode } from './node';
2
- import { NodeType } from './node_types';
3
- export declare class TaroText extends TaroNode {
1
+ import { TaroNode } from "./node.js";
2
+ import { NodeType } from "../node_types-9ac5b4dd.js";
3
+ declare class TaroText extends TaroNode {
4
4
  _value: string;
5
5
  nodeType: NodeType;
6
6
  nodeName: string;
@@ -12,3 +12,4 @@ export declare class TaroText extends TaroNode {
12
12
  set data(text: string);
13
13
  get data(): string;
14
14
  }
15
+ export { TaroText };
@@ -1,7 +1,8 @@
1
- import { TaroElement } from './element';
2
- export declare class TransferElement extends TaroElement {
1
+ import { TaroElement } from "./element.js";
2
+ declare class TransferElement extends TaroElement {
3
3
  dataName: string;
4
4
  isTransferElement: boolean;
5
5
  constructor(dataName: string);
6
6
  get _path(): string;
7
7
  }
8
+ export { TransferElement };
@@ -1,4 +1,4 @@
1
- import type { TaroElement } from './element';
1
+ import { TaroElement } from "./element.js";
2
2
  type Filter = (element: TaroElement) => boolean;
3
- export declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
4
- export {};
3
+ declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
4
+ export { treeToArray };
@@ -1,3 +1,4 @@
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;
1
+ import { TaroElement } from "../dom/element.js";
2
+ declare function getBoundingClientRectImpl(this: TaroElement): Promise<null>;
3
+ declare function getTemplateContent(ctx: TaroElement): TaroElement | undefined;
4
+ export { getBoundingClientRectImpl, getTemplateContent };
@@ -1,2 +1,3 @@
1
- import type { TaroNode } from '../../dom/node';
2
- export declare function setInnerHTML(element: TaroNode, html: string): void;
1
+ import { TaroNode } from "../../dom/node.js";
2
+ declare function setInnerHTML(element: TaroNode, html: string): void;
3
+ export { setInnerHTML };
@@ -1,5 +1,5 @@
1
- import type { TaroDocument } from '../../dom/document';
2
- import type { TaroElement } from '../../dom/element';
1
+ import { TaroDocument } from "../../dom/document.js";
2
+ import { TaroElement } from "../../dom/element.js";
3
3
  interface Node {
4
4
  type: string;
5
5
  }
@@ -7,19 +7,19 @@ interface Comment extends Node {
7
7
  type: 'comment';
8
8
  content: string;
9
9
  }
10
- export interface Text extends Node {
10
+ interface Text extends Node {
11
11
  type: 'text';
12
12
  content: string;
13
13
  }
14
- export interface Element extends Node {
14
+ interface Element extends Node {
15
15
  type: 'element';
16
16
  tagName: string;
17
17
  children: ChildNode[];
18
18
  attributes: string[];
19
19
  }
20
- export interface ParsedTaroElement extends TaroElement {
20
+ interface ParsedTaroElement extends TaroElement {
21
21
  h5tagName?: string;
22
22
  }
23
23
  type ChildNode = Comment | Text | Element;
24
- export declare function parser(html: string, document: TaroDocument): (import("../..").TaroText | TaroElement)[];
25
- export {};
24
+ declare function parser(html: string, document: TaroDocument): (import("../../index.js").TaroText | TaroElement)[];
25
+ export { Text, Element, ParsedTaroElement, parser };