@tarojs/runtime 4.0.10-alpha.5 → 4.0.10-alpha.8

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 +3 -6
  2. package/dist/bom/URLSearchParams.d.ts +1 -2
  3. package/dist/bom/document.d.ts +2 -3
  4. package/dist/bom/getComputedStyle.d.ts +4 -5
  5. package/dist/bom/history.d.ts +5 -7
  6. package/dist/bom/location.d.ts +3 -5
  7. package/dist/bom/navigator.d.ts +1 -2
  8. package/dist/bom/raf.d.ts +2 -2
  9. package/dist/bom/window.d.ts +8 -9
  10. package/dist/constants/index.d.ts +52 -53
  11. package/dist/current.d.ts +5 -5
  12. package/dist/dom/anchor-element.d.ts +2 -3
  13. package/dist/dom/class-list.d.ts +2 -3
  14. package/dist/dom/document.d.ts +6 -10
  15. package/dist/dom/element.d.ts +6 -7
  16. package/dist/dom/event-source.d.ts +3 -3
  17. package/dist/dom/event-target.d.ts +2 -3
  18. package/dist/dom/event.d.ts +5 -6
  19. package/dist/dom/form.d.ts +3 -4
  20. package/dist/dom/node.d.ts +8 -39
  21. package/dist/{node_types-9ac5b4dd.d.ts → dom/node_types.d.ts} +1 -2
  22. package/dist/dom/root.d.ts +3 -4
  23. package/dist/dom/style.d.ts +2 -3
  24. package/dist/dom/svg.d.ts +2 -3
  25. package/dist/dom/text.d.ts +3 -4
  26. package/dist/dom/transfer.d.ts +2 -3
  27. package/dist/dom/tree.d.ts +3 -3
  28. package/dist/dom-external/element.d.ts +3 -4
  29. package/dist/dom-external/inner-html/html.d.ts +2 -3
  30. package/dist/dom-external/inner-html/parser.d.ts +7 -7
  31. package/dist/dom-external/inner-html/scaner.d.ts +3 -3
  32. package/dist/dom-external/inner-html/style.d.ts +3 -3
  33. package/dist/dom-external/inner-html/tags.d.ts +5 -6
  34. package/dist/dom-external/inner-html/utils.d.ts +1 -2
  35. package/dist/dom-external/mutation-observer/implements.d.ts +6 -25
  36. package/dist/dom-external/mutation-observer/index.d.ts +6 -5
  37. package/dist/{record-32b054d8.d.ts → dom-external/mutation-observer/record.d.ts} +3 -4
  38. package/dist/dom-external/node.d.ts +5 -6
  39. package/dist/dsl/common.d.ts +14 -15
  40. package/dist/{instance-530729bd.d.ts → dsl/instance.d.ts} +13 -14
  41. package/dist/emitter/emitter.d.ts +2 -2
  42. package/dist/env.d.ts +2 -2
  43. package/dist/hydrate.d.ts +4 -5
  44. package/dist/index.cjs.js +4 -4
  45. package/dist/index.d.ts +33 -32
  46. package/dist/interface/element.d.ts +4 -0
  47. package/dist/interface/event-target.d.ts +11 -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/{options-530729bd.d.ts → interface/options.d.ts} +4 -5
  53. package/dist/interface/utils.d.ts +2 -0
  54. package/dist/next-tick.d.ts +2 -3
  55. package/dist/options.d.ts +2 -3
  56. package/dist/perf.d.ts +2 -2
  57. package/dist/polyfill/array.d.ts +2 -3
  58. package/dist/polyfill/intersection-observer.d.ts +1 -2
  59. package/dist/polyfill/object.d.ts +3 -4
  60. package/dist/utils/cache.d.ts +1 -2
  61. package/dist/utils/index.d.ts +17 -18
  62. package/dist/utils/lodash.d.ts +2 -3
  63. package/dist/utils/router.d.ts +7 -8
  64. package/package.json +4 -4
  65. package/dist/index-26658829.d.ts +0 -23
  66. package/dist/index.cjs.d.ts +0 -813
  67. package/dist/runtime.esm.d.ts +0 -813
@@ -1,5 +1,5 @@
1
- import { TaroDocument } from "../../dom/document.js";
2
- import { TaroElement } from "../../dom/element.js";
1
+ import type { TaroDocument } from '../../dom/document';
2
+ import type { TaroElement } from '../../dom/element';
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
- interface Text extends Node {
10
+ export interface Text extends Node {
11
11
  type: 'text';
12
12
  content: string;
13
13
  }
14
- interface Element extends Node {
14
+ export interface Element extends Node {
15
15
  type: 'element';
16
16
  tagName: string;
17
17
  children: ChildNode[];
18
18
  attributes: string[];
19
19
  }
20
- interface ParsedTaroElement extends TaroElement {
20
+ export interface ParsedTaroElement extends TaroElement {
21
21
  h5tagName?: string;
22
22
  }
23
23
  type ChildNode = Comment | Text | Element;
24
- declare function parser(html: string, document: TaroDocument): (import("../../index.js").TaroText | TaroElement)[];
25
- export { Text, Element, ParsedTaroElement, parser };
24
+ export declare function parser(html: string, document: TaroDocument): (import("../..").TaroText | TaroElement)[];
25
+ export {};
@@ -3,7 +3,7 @@ interface Position {
3
3
  column: number;
4
4
  line: number;
5
5
  }
6
- interface Token {
6
+ export interface Token {
7
7
  type: string;
8
8
  content?: string;
9
9
  position?: {
@@ -12,7 +12,7 @@ interface Token {
12
12
  };
13
13
  close?: boolean;
14
14
  }
15
- declare class Scaner {
15
+ export declare class Scaner {
16
16
  private tokens;
17
17
  private position;
18
18
  private html;
@@ -27,4 +27,4 @@ declare class Scaner {
27
27
  private scanAttrs;
28
28
  private scanSkipTag;
29
29
  }
30
- export { Token, Scaner };
30
+ export {};
@@ -1,4 +1,4 @@
1
- import { ParsedTaroElement } from "./parser.js";
1
+ import type { ParsedTaroElement } from './parser';
2
2
  interface ISelector {
3
3
  isChild: boolean;
4
4
  isGeneralSibling: boolean;
@@ -16,7 +16,7 @@ interface IStyle {
16
16
  content: string;
17
17
  selectorList: ISelector[];
18
18
  }
19
- declare class StyleTagParser {
19
+ export default class StyleTagParser {
20
20
  styles: IStyle[];
21
21
  extractStyle(src: string): string;
22
22
  stringToSelector(style: string): void;
@@ -24,4 +24,4 @@ declare class StyleTagParser {
24
24
  matchStyle(tagName: string, el: ParsedTaroElement, list: number[]): string;
25
25
  matchCurrent(tagName: string, el: ParsedTaroElement, selector: ISelector): boolean;
26
26
  }
27
- export { StyleTagParser as default };
27
+ export {};
@@ -1,9 +1,8 @@
1
- declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
2
- declare const specialMiniElements: {
1
+ export declare function makeMap(str: string, expectsLowerCase?: boolean): (key: string) => boolean;
2
+ export declare const specialMiniElements: {
3
3
  img: string;
4
4
  iframe: string;
5
5
  };
6
- declare const isMiniElements: (key: string) => boolean;
7
- declare const isInlineElements: (key: string) => boolean;
8
- declare const isBlockElements: (key: string) => boolean;
9
- export { makeMap, specialMiniElements, isMiniElements, isInlineElements, isBlockElements };
6
+ export declare const isMiniElements: (key: string) => boolean;
7
+ export declare const isInlineElements: (key: string) => boolean;
8
+ export declare const isBlockElements: (key: string) => boolean;
@@ -1,2 +1 @@
1
- declare function unquote(str: string): string;
2
- export { unquote };
1
+ export declare function unquote(str: string): string;
@@ -1,10 +1,10 @@
1
- import { TaroNode } from "../../dom/node.js";
2
- import { MutationRecord } from "../../record-32b054d8.js";
3
- type MutationCallback = (mutations: MutationRecord[]) => any;
1
+ import type { TaroNode } from '../../dom/node';
2
+ import type { MutationRecord } from './record';
3
+ export type MutationCallback = (mutations: MutationRecord[]) => any;
4
4
  /**
5
5
  * @see https://dom.spec.whatwg.org/#dictdef-mutationobserverinit
6
6
  */
7
- interface MutationObserverInit {
7
+ export interface MutationObserverInit {
8
8
  attributeFilter?: string[];
9
9
  attributeOldValue?: boolean;
10
10
  attributes?: boolean;
@@ -21,20 +21,12 @@ interface MutationObserverInit {
21
21
  * @see https://dom.spec.whatwg.org/#mutationobserver
22
22
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
23
23
  */
24
- declare class MutationObserverImpl {
24
+ export declare class MutationObserverImpl {
25
25
  callback: MutationCallback;
26
26
  target: TaroNode | null;
27
27
  options: MutationObserverInit;
28
28
  records: MutationRecord[];
29
29
  constructor(callback: MutationCallback);
30
- /**
31
- * Configures the MutationObserver
32
- * to begin receiving notifications
33
- * through its callback function
34
- * when DOM changes matching the given options occur.
35
- *
36
- * Options matching is to be implemented.
37
- */
38
30
  /**
39
31
  * Configures the MutationObserver
40
32
  * to begin receiving notifications
@@ -44,22 +36,12 @@ declare class MutationObserverImpl {
44
36
  * Options matching is to be implemented.
45
37
  */
46
38
  observe(target: TaroNode, options?: MutationObserverInit): void;
47
- /**
48
- * Stop the MutationObserver instance
49
- * from receiving further notifications
50
- * until and unless observe() is called again.
51
- */
52
39
  /**
53
40
  * Stop the MutationObserver instance
54
41
  * from receiving further notifications
55
42
  * until and unless observe() is called again.
56
43
  */
57
44
  disconnect(): void;
58
- /**
59
- * Removes all pending notifications
60
- * from the MutationObserver's notification queue
61
- * and returns them in a new Array of MutationRecord objects.
62
- */
63
45
  /**
64
46
  * Removes all pending notifications
65
47
  * from the MutationObserver's notification queue
@@ -67,5 +49,4 @@ declare class MutationObserverImpl {
67
49
  */
68
50
  takeRecords(): MutationRecord[];
69
51
  }
70
- declare function recordMutation(record: MutationRecord): void;
71
- export { MutationCallback, MutationObserverInit, MutationObserverImpl, recordMutation };
52
+ export declare function recordMutation(record: MutationRecord): void;
@@ -1,7 +1,8 @@
1
- import { MutationObserverImpl, MutationCallback, MutationObserverInit } from "./implements.js";
2
- import { MutationRecord, MutationRecordType } from "../../record-32b054d8.js";
3
- import { TaroNode } from "../../dom/node.js";
4
- declare class MutationObserver {
1
+ import { MutationObserverImpl } from './implements';
2
+ import { MutationRecord, MutationRecordType } from './record';
3
+ import type { TaroNode } from '../../dom/node';
4
+ import type { MutationCallback, MutationObserverInit } from './implements';
5
+ export declare class MutationObserver {
5
6
  core: Pick<MutationObserverImpl, 'observe' | 'disconnect' | 'takeRecords'>;
6
7
  constructor(callback: MutationCallback);
7
8
  observe(...args: [TaroNode, MutationObserverInit?]): void;
@@ -9,4 +10,4 @@ declare class MutationObserver {
9
10
  takeRecords(): MutationRecord[];
10
11
  static record(record: MutationRecord): void;
11
12
  }
12
- export { MutationObserver, MutationRecordType };
13
+ export { MutationRecordType };
@@ -1,11 +1,11 @@
1
- import { TaroNode } from "./dom/node.js";
1
+ import type { TaroNode } from '../../dom/node';
2
2
  /**
3
3
  * A MutationRecord represents an individual DOM mutation.
4
4
  * It is the object that is passed to MutationObserver's callback.
5
5
  * @see https://dom.spec.whatwg.org/#interface-mutationrecord
6
6
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord
7
7
  */
8
- interface MutationRecord {
8
+ export interface MutationRecord {
9
9
  readonly target: TaroNode;
10
10
  readonly addedNodes?: TaroNode[];
11
11
  readonly removedNodes?: TaroNode[];
@@ -17,9 +17,8 @@ interface MutationRecord {
17
17
  readonly type: MutationRecordType;
18
18
  readonly value?: string | null;
19
19
  }
20
- declare const enum MutationRecordType {
20
+ export declare const enum MutationRecordType {
21
21
  ATTRIBUTES = "attributes",
22
22
  CHARACTER_DATA = "characterData",
23
23
  CHILD_LIST = "childList"
24
24
  }
25
- export { MutationRecord, MutationRecordType };
@@ -1,12 +1,11 @@
1
- import { TaroNode } from "../dom/node.js";
2
- type IPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
1
+ import type { TaroNode } from '../dom/node';
2
+ export type IPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
3
3
  /**
4
4
  * An implementation of `Element.insertAdjacentHTML()`
5
5
  * to support Vue 3 with a version of or greater than `vue@3.1.2`
6
6
  */
7
- declare function insertAdjacentHTML(this: TaroNode, position: IPosition, html: string): void;
8
- declare function cloneNode(this: TaroNode, isDeep?: boolean): any;
9
- declare function contains(this: TaroNode, node: TaroNode & {
7
+ export declare function insertAdjacentHTML(this: TaroNode, position: IPosition, html: string): void;
8
+ export declare function cloneNode(this: TaroNode, isDeep?: boolean): any;
9
+ export declare function contains(this: TaroNode, node: TaroNode & {
10
10
  id?: string;
11
11
  }): boolean;
12
- export { IPosition, insertAdjacentHTML, cloneNode, contains };
@@ -1,16 +1,15 @@
1
1
  /// <reference types="react" />
2
- import { PageConfig } from "../index-26658829.js";
3
- import { Instance, PageInstance, PageProps } from "../instance-530729bd.js";
4
- declare function injectPageInstance(inst: Instance<PageProps>, id: string): void;
5
- declare function getPageInstance(id: string): Instance | undefined;
6
- declare function removePageInstance(id: string): void;
7
- declare function safeExecute(path: string, lifecycle: string, ...args: unknown[]): any;
8
- declare function stringify(obj?: Record<string, unknown>): string;
9
- declare function getPath(id: string, options?: Record<string, unknown>): string;
10
- declare function getOnReadyEventKey(path: string): string;
11
- declare function getOnShowEventKey(path: string): string;
12
- declare function getOnHideEventKey(path: string): string;
13
- declare function createPageConfig(component: any, pageName?: string, data?: Record<string, unknown>, pageConfig?: PageConfig): PageInstance;
14
- declare function createComponentConfig(component: React.ComponentClass, componentName?: string, data?: Record<string, unknown>): any;
15
- declare function createRecursiveComponentConfig(componentName?: string): any;
16
- export { injectPageInstance, getPageInstance, removePageInstance, safeExecute, stringify, getPath, getOnReadyEventKey, getOnShowEventKey, getOnHideEventKey, createPageConfig, createComponentConfig, createRecursiveComponentConfig };
2
+ import type { PageConfig } from '../interface';
3
+ import type { Instance, PageInstance, PageProps } from './instance';
4
+ export declare function injectPageInstance(inst: Instance<PageProps>, id: string): void;
5
+ export declare function getPageInstance(id: string): Instance | undefined;
6
+ export declare function removePageInstance(id: string): void;
7
+ export declare function safeExecute(path: string, lifecycle: string, ...args: unknown[]): any;
8
+ export declare function stringify(obj?: Record<string, unknown>): string;
9
+ export declare function getPath(id: string, options?: Record<string, unknown>): string;
10
+ export declare function getOnReadyEventKey(path: string): string;
11
+ export declare function getOnShowEventKey(path: string): string;
12
+ export declare function getOnHideEventKey(path: string): string;
13
+ export declare function createPageConfig(component: any, pageName?: string, data?: Record<string, unknown>, pageConfig?: PageConfig): PageInstance;
14
+ export declare function createComponentConfig(component: React.ComponentClass, componentName?: string, data?: Record<string, unknown>): any;
15
+ export declare function createRecursiveComponentConfig(componentName?: string): any;
@@ -1,27 +1,26 @@
1
- /// <reference types="react" />
2
- import { Component as Vue3Component } from '@vue/runtime-core';
3
- import { Component, ComponentClass } from 'react';
4
- import { TaroElement } from "./dom/element.js";
5
- import { MpEvent, TFunc } from "./index-26658829.js";
6
- interface Instance<T = Record<string, any>> extends Component<T>, Show, PageInstance {
1
+ import type { Component as Vue3Component } from '@vue/runtime-core';
2
+ import type { Component, ComponentClass } from 'react';
3
+ import type { TaroElement } from '../dom/element';
4
+ import type { MpEvent, TFunc } from '../interface';
5
+ export interface Instance<T = Record<string, any>> extends Component<T>, Show, PageInstance {
7
6
  tid?: string;
8
7
  node?: TaroElement;
9
8
  $forceUpdate?(): void;
10
9
  $nextTick?(cb: () => void): void;
11
10
  $options: Instance;
12
11
  }
13
- interface PageProps {
12
+ export interface PageProps {
14
13
  tid?: string;
15
14
  }
16
- interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
15
+ export interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
17
16
  }
18
- interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
17
+ export interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
19
18
  componentDidShow?(): void;
20
19
  componentDidHide?(): void;
21
20
  }
22
- interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
21
+ export interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
23
22
  }
24
- interface PageLifeCycle extends Show {
23
+ export interface PageLifeCycle extends Show {
25
24
  eh?(event: MpEvent): void;
26
25
  onAddToFavorites?(): void;
27
26
  onLoad?(options: Record<string, unknown>, cb?: TFunc): void;
@@ -50,7 +49,7 @@ interface PageLifeCycle extends Show {
50
49
  onTitleClick?(): void;
51
50
  onUnload?(): void;
52
51
  }
53
- interface PageInstance extends PageLifeCycle {
52
+ export interface PageInstance extends PageLifeCycle {
54
53
  /** 页面的初始数据 */
55
54
  data?: Record<string, unknown>;
56
55
  /** 页面路径 */
@@ -68,7 +67,7 @@ interface Show {
68
67
  onShow?(): void;
69
68
  onHide?(): void;
70
69
  }
71
- interface AppInstance extends Show {
70
+ export interface AppInstance extends Show {
72
71
  componentDidShow?(options?: Record<string, unknown>): void;
73
72
  mount?(component: React.ComponentClass | Vue3Component, id: string, cb: (...args: any[]) => void): void;
74
73
  mount?(component: React.ComponentClass | Vue3Component, id: string, getCtx: (...args: any[]) => void, cb: (...args: any[]) => void): void;
@@ -82,4 +81,4 @@ interface AppInstance extends Show {
82
81
  taroGlobalData?: Record<any, any>;
83
82
  config?: Record<any, any>;
84
83
  }
85
- export { Instance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance };
84
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { Events } from '@tarojs/shared';
2
2
  declare const eventCenter: Events;
3
- type EventsType = typeof Events;
4
- export { EventsType, eventCenter, Events };
3
+ export type EventsType = typeof Events;
4
+ export { eventCenter, Events };
package/dist/env.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { TaroDocument } from "./dom/document.js";
1
+ import type { TaroDocument } from './dom/document';
2
2
  interface Env {
3
3
  window: any;
4
4
  document: TaroDocument;
5
5
  }
6
6
  declare const env: Env;
7
- export { env as default };
7
+ export default env;
package/dist/hydrate.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { TaroElement } from "./dom/element.js";
2
- import { TaroText } from "./dom/text.js";
3
- import { MiniData } from "./index-26658829.js";
1
+ import type { TaroElement } from './dom/element';
2
+ import type { TaroText } from './dom/text';
3
+ import type { MiniData } from './interface';
4
4
  /**
5
5
  * React also has a fancy function's name for this: `hydrate()`.
6
6
  * You may have been heard `hydrate` as a SSR-related function,
7
7
  * actually, `hydrate` basicly do the `render()` thing, but ignore some properties,
8
8
  * it's a vnode traverser and modifier: that's exactly what Taro's doing in here.
9
9
  */
10
- declare function hydrate(node: TaroElement | TaroText): MiniData;
11
- export { hydrate };
10
+ export declare function hydrate(node: TaroElement | TaroText): MiniData;
package/dist/index.cjs.js CHANGED
@@ -5087,12 +5087,12 @@ if (process.env.SUPPORT_TARO_POLYFILL !== 'disabled' && process.env.TARO_PLATFOR
5087
5087
  }
5088
5088
 
5089
5089
  Object.defineProperty(exports, "Events", {
5090
- enumerable: true,
5091
- get: function () { return shared.Events; }
5090
+ enumerable: true,
5091
+ get: function () { return shared.Events; }
5092
5092
  });
5093
5093
  Object.defineProperty(exports, "hooks", {
5094
- enumerable: true,
5095
- get: function () { return shared.hooks; }
5094
+ enumerable: true,
5095
+ get: function () { return shared.hooks; }
5096
5096
  });
5097
5097
  exports.A = A;
5098
5098
  exports.APP = APP;
package/dist/index.d.ts CHANGED
@@ -1,34 +1,35 @@
1
- import env from "./env.js";
1
+ import './dom-external';
2
+ import env from './env';
2
3
  export { hooks } from '@tarojs/shared';
3
- export { taroDocumentProvider as document } from "./bom/document.js";
4
- export { taroGetComputedStyleProvider as getComputedStyle } from "./bom/getComputedStyle.js";
5
- export { History } from "./bom/history.js";
6
- export { Location } from "./bom/location.js";
7
- export { nav as navigator } from "./bom/navigator.js";
8
- export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from "./bom/raf.js";
9
- export { parseUrl, TaroURLProvider as URL } from "./bom/URL.js";
10
- export { URLSearchParams } from "./bom/URLSearchParams.js";
11
- export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from "./bom/window.js";
12
- export { TaroElement } from "./dom/element.js";
13
- export { createEvent, eventHandler, TaroEvent } from "./dom/event.js";
14
- export { FormElement } from "./dom/form.js";
15
- export { TaroNode } from "./dom/node.js";
16
- export { TaroRootElement } from "./dom/root.js";
17
- export { Style } from "./dom/style.js";
18
- export { SVGElement } from "./dom/svg.js";
19
- export { TaroText } from "./dom/text.js";
20
- export { MutationObserver } from "./dom-external/mutation-observer/index.js";
4
+ export { taroDocumentProvider as document } from './bom/document';
5
+ export { taroGetComputedStyleProvider as getComputedStyle } from './bom/getComputedStyle';
6
+ export { History } from './bom/history';
7
+ export { Location } from './bom/location';
8
+ export { nav as navigator } from './bom/navigator';
9
+ export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from './bom/raf';
10
+ export { parseUrl, TaroURLProvider as URL } from './bom/URL';
11
+ export { URLSearchParams } from './bom/URLSearchParams';
12
+ export { taroHistoryProvider as history, taroLocationProvider as location, taroWindowProvider as window } from './bom/window';
13
+ export { TaroElement } from './dom/element';
14
+ export { createEvent, eventHandler, TaroEvent } from './dom/event';
15
+ export { FormElement } from './dom/form';
16
+ export { TaroNode } from './dom/node';
17
+ export { TaroRootElement } from './dom/root';
18
+ export { Style } from './dom/style';
19
+ export { SVGElement } from './dom/svg';
20
+ export { TaroText } from './dom/text';
21
+ export { MutationObserver } from './dom-external/mutation-observer';
21
22
  export { env };
22
- export * from "./constants/index.js";
23
- export { Current, getCurrentInstance } from "./current.js";
24
- export { eventSource } from "./dom/event-source.js";
25
- export { createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify } from "./dsl/common.js";
26
- export * from "./emitter/emitter.js";
27
- export { hydrate } from "./hydrate.js";
28
- export { nextTick } from "./next-tick.js";
29
- export { options } from "./options.js";
30
- export * from "./perf.js";
31
- export * from "./utils/index.js";
32
- export * from "./instance-530729bd.js";
33
- export * from "./index-26658829.js";
34
- export * from "./polyfill/index.js";
23
+ export * from './constants';
24
+ export { Current, getCurrentInstance } from './current';
25
+ export { eventSource } from './dom/event-source';
26
+ export { createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify } from './dsl/common';
27
+ export * from './emitter/emitter';
28
+ export { hydrate } from './hydrate';
29
+ export { nextTick } from './next-tick';
30
+ export { options } from './options';
31
+ export * from './perf';
32
+ export * from './utils';
33
+ export * from './dsl/instance';
34
+ export * from './interface';
35
+ export * from './polyfill';
@@ -0,0 +1,4 @@
1
+ export interface Attributes {
2
+ name: string;
3
+ value: string;
4
+ }
@@ -0,0 +1,11 @@
1
+ export interface EventListenerOptions {
2
+ capture?: boolean;
3
+ }
4
+ export interface AddEventListenerOptions extends EventListenerOptions {
5
+ once?: boolean;
6
+ passive?: boolean;
7
+ }
8
+ export interface EventHandler<T = any, R = void> {
9
+ (...args: T[]): R;
10
+ _stop?: boolean;
11
+ }
@@ -0,0 +1,15 @@
1
+ export interface EventOptions {
2
+ bubbles: boolean;
3
+ cancelable: boolean;
4
+ }
5
+ type Target = Record<string, unknown> & {
6
+ dataset: Record<string, unknown>;
7
+ id: string;
8
+ };
9
+ export interface MpEvent {
10
+ type: string;
11
+ detail: Record<string, unknown>;
12
+ target: Target;
13
+ currentTarget: Target;
14
+ }
15
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { Shortcuts } from '@tarojs/shared';
2
+ import type { PageConfig } from './utils';
3
+ export interface MpInstance {
4
+ config: PageConfig;
5
+ setData: (data: unknown, cb: () => void) => void;
6
+ route?: string;
7
+ __route__: string;
8
+ $taroParams?: Record<string, unknown>;
9
+ $taroPath: string;
10
+ __data__: any;
11
+ data: any;
12
+ exitState?: any;
13
+ selectComponent: (selector: string) => any;
14
+ }
15
+ export interface MiniElementData {
16
+ [Shortcuts.Childnodes]?: MiniData[];
17
+ [Shortcuts.NodeName]: string;
18
+ [Shortcuts.Class]?: string;
19
+ [Shortcuts.Style]?: string;
20
+ uid?: string;
21
+ sid: string;
22
+ [key: string]: unknown;
23
+ }
24
+ export interface MiniTextData {
25
+ [Shortcuts.Text]: string;
26
+ [Shortcuts.NodeName]: string;
27
+ }
28
+ export type MiniData = MiniElementData | MiniTextData;
29
+ export type HydratedData = () => MiniData | MiniData[];
@@ -0,0 +1,7 @@
1
+ export * from './element';
2
+ export * from './event';
3
+ export * from './event-target';
4
+ export * from './hydrate';
5
+ export * from './node';
6
+ export * from './options';
7
+ export * from './utils';
@@ -0,0 +1,7 @@
1
+ import { HydratedData } from './index';
2
+ export type UpdatePayloadValue = string | boolean | HydratedData;
3
+ export type DataTree = Record<string, UpdatePayloadValue | ReturnType<HydratedData>>;
4
+ export interface UpdatePayload {
5
+ path: string;
6
+ value: UpdatePayloadValue;
7
+ }
@@ -1,7 +1,7 @@
1
- import { TaroElement } from "./dom/element.js";
2
- import { TaroText } from "./dom/text.js";
3
- import { Element, Text } from "./dom-external/inner-html/parser.js";
4
- interface Options {
1
+ import type { TaroElement } from '../dom/element';
2
+ import type { TaroText } from '../dom/text';
3
+ import type { Element, Text } from '../dom-external/inner-html/parser';
4
+ export interface Options {
5
5
  prerender: boolean;
6
6
  debug: boolean;
7
7
  html?: {
@@ -14,4 +14,3 @@ interface Options {
14
14
  };
15
15
  miniGlobal?: any;
16
16
  }
17
- export { Options };
@@ -0,0 +1,2 @@
1
+ export type TFunc = (...args: any[]) => any;
2
+ export type PageConfig = Record<string, any>;
@@ -1,3 +1,2 @@
1
- import { TFunc } from "./index-26658829.js";
2
- declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
3
- export { nextTick };
1
+ import type { TFunc } from './interface';
2
+ export declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
package/dist/options.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { Options } from "./index-26658829.js";
2
- declare const options: Options;
3
- export { options };
1
+ import type { Options } from './interface';
2
+ export declare const options: Options;
package/dist/perf.d.ts CHANGED
@@ -5,5 +5,5 @@ declare class Performance {
5
5
  stop(id: string, now?: number): void;
6
6
  delayStop(id: string, delay?: number): ((...args: any[]) => void) | undefined;
7
7
  }
8
- declare const perf: Performance;
9
- export { perf };
8
+ export declare const perf: Performance;
9
+ export {};
@@ -1,3 +1,2 @@
1
- declare function handleArrayFindPolyfill(): void;
2
- declare function handleArrayIncludesPolyfill(): void;
3
- export { handleArrayFindPolyfill, handleArrayIncludesPolyfill };
1
+ export declare function handleArrayFindPolyfill(): void;
2
+ export declare function handleArrayIncludesPolyfill(): void;
@@ -1,2 +1 @@
1
- declare function handleIntersectionObserverPolyfill(): void;
2
- export { handleIntersectionObserverPolyfill };
1
+ export declare function handleIntersectionObserverPolyfill(): void;
@@ -1,4 +1,3 @@
1
- declare function handleObjectAssignPolyfill(): void;
2
- declare function handleObjectEntriesPolyfill(): void;
3
- declare function handleObjectDefinePropertyPolyfill(): void;
4
- export { handleObjectAssignPolyfill, handleObjectEntriesPolyfill, handleObjectDefinePropertyPolyfill };
1
+ export declare function handleObjectAssignPolyfill(): void;
2
+ export declare function handleObjectEntriesPolyfill(): void;
3
+ export declare function handleObjectDefinePropertyPolyfill(): void;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 一个小型缓存池,用于在切换页面时,存储一些上下文信息
3
3
  */
4
- declare class RuntimeCache<T> {
4
+ export declare class RuntimeCache<T> {
5
5
  name: string;
6
6
  cache: Map<string, T>;
7
7
  constructor(name: string);
@@ -10,4 +10,3 @@ declare class RuntimeCache<T> {
10
10
  get(identifier: string): T | undefined;
11
11
  delete(identifier: string): void;
12
12
  }
13
- export { RuntimeCache };