@tarojs/runtime 4.0.0-alpha.22 → 4.0.0-alpha.24

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 +52 -51
  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 +806 -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-4c64b022.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-4c64b022.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 +806 -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/index.cjs.js CHANGED
@@ -5056,12 +5056,12 @@ if (process.env.SUPPORT_TARO_POLYFILL !== 'disabled' && process.env.TARO_PLATFOR
5056
5056
  }
5057
5057
 
5058
5058
  Object.defineProperty(exports, "Events", {
5059
- enumerable: true,
5060
- get: function () { return shared.Events; }
5059
+ enumerable: true,
5060
+ get: function () { return shared.Events; }
5061
5061
  });
5062
5062
  Object.defineProperty(exports, "hooks", {
5063
- enumerable: true,
5064
- get: function () { return shared.hooks; }
5063
+ enumerable: true,
5064
+ get: function () { return shared.hooks; }
5065
5065
  });
5066
5066
  exports.A = A;
5067
5067
  exports.APP = APP;
package/dist/index.d.ts CHANGED
@@ -1,35 +1,34 @@
1
- import './dom-external';
2
- import env from './env';
1
+ import env from "./env.js";
3
2
  export { hooks } from '@tarojs/shared';
4
- export { document } from './bom/document';
5
- export { 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, URL } from './bom/URL';
11
- export { URLSearchParams } from './bom/URLSearchParams';
12
- export { history, location, 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';
3
+ export { document } from "./bom/document.js";
4
+ export { 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, URL } from "./bom/URL.js";
10
+ export { URLSearchParams } from "./bom/URLSearchParams.js";
11
+ export { history, location, 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";
22
21
  export { env };
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';
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-4c64b022.js";
33
+ export * from "./index-26658829.js";
34
+ export * from "./polyfill/index.js";
@@ -1,26 +1,27 @@
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 {
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 {
6
7
  tid?: string;
7
8
  node?: TaroElement;
8
9
  $forceUpdate?(): void;
9
10
  $nextTick?(cb: () => void): void;
10
11
  $options: Instance;
11
12
  }
12
- export interface PageProps {
13
+ interface PageProps {
13
14
  tid?: string;
14
15
  }
15
- export interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
16
+ interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
16
17
  }
17
- export interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
18
+ interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
18
19
  componentDidShow?(): void;
19
20
  componentDidHide?(): void;
20
21
  }
21
- export interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
22
+ interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
22
23
  }
23
- export interface PageLifeCycle extends Show {
24
+ interface PageLifeCycle extends Show {
24
25
  eh?(event: MpEvent): void;
25
26
  onAddToFavorites?(): void;
26
27
  onLoad?(options: Record<string, unknown>, cb?: TFunc): void;
@@ -49,7 +50,7 @@ export interface PageLifeCycle extends Show {
49
50
  onTitleClick?(): void;
50
51
  onUnload?(): void;
51
52
  }
52
- export interface PageInstance extends PageLifeCycle {
53
+ interface PageInstance extends PageLifeCycle {
53
54
  /** 页面的初始数据 */
54
55
  data?: Record<string, unknown>;
55
56
  /** 页面路径 */
@@ -67,7 +68,7 @@ interface Show {
67
68
  onShow?(): void;
68
69
  onHide?(): void;
69
70
  }
70
- export interface AppInstance extends Show {
71
+ interface AppInstance extends Show {
71
72
  componentDidShow?(options?: Record<string, unknown>): void;
72
73
  mount?(component: React.ComponentClass | Vue3Component, id: string, cb: (...args: any[]) => void): void;
73
74
  mount?(component: React.ComponentClass | Vue3Component, id: string, getCtx: (...args: any[]) => void, cb: (...args: any[]) => void): void;
@@ -81,4 +82,4 @@ export interface AppInstance extends Show {
81
82
  taroGlobalData?: Record<any, any>;
82
83
  config?: Record<any, any>;
83
84
  }
84
- export {};
85
+ export { Instance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance };
@@ -1,2 +1,3 @@
1
- import type { TFunc } from './interface';
2
- export declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
1
+ import { TFunc } from "./index-26658829.js";
2
+ declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
3
+ export { nextTick };
@@ -1,4 +1,4 @@
1
- export declare const enum NodeType {
1
+ declare const enum NodeType {
2
2
  ELEMENT_NODE = 1,
3
3
  ATTRIBUTE_NODE = 2,
4
4
  TEXT_NODE = 3,
@@ -8,3 +8,4 @@ export declare const enum NodeType {
8
8
  PROCESSING_INSTRUCTION_NODE = 7,
9
9
  DOCUMENT_NODE = 9
10
10
  }
11
+ export { NodeType };
@@ -1,7 +1,7 @@
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 {
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 {
5
5
  prerender: boolean;
6
6
  debug: boolean;
7
7
  html?: {
@@ -14,3 +14,4 @@ export interface Options {
14
14
  };
15
15
  miniGlobal?: any;
16
16
  }
17
+ export { Options };
package/dist/options.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- import type { Options } from './interface';
2
- export declare const options: Options;
1
+ import { Options } from "./index-26658829.js";
2
+ declare const options: Options;
3
+ export { 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
- export declare const perf: Performance;
9
- export {};
8
+ declare const perf: Performance;
9
+ export { perf };
@@ -1,2 +1,3 @@
1
- export declare function handleArrayFindPolyfill(): void;
2
- export declare function handleArrayIncludesPolyfill(): void;
1
+ declare function handleArrayFindPolyfill(): void;
2
+ declare function handleArrayIncludesPolyfill(): void;
3
+ export { handleArrayFindPolyfill, handleArrayIncludesPolyfill };
@@ -1 +1,2 @@
1
- export declare function handleIntersectionObserverPolyfill(): void;
1
+ declare function handleIntersectionObserverPolyfill(): void;
2
+ export { handleIntersectionObserverPolyfill };
@@ -1,3 +1,4 @@
1
- export declare function handleObjectAssignPolyfill(): void;
2
- export declare function handleObjectEntriesPolyfill(): void;
3
- export declare function handleObjectDefinePropertyPolyfill(): void;
1
+ declare function handleObjectAssignPolyfill(): void;
2
+ declare function handleObjectEntriesPolyfill(): void;
3
+ declare function handleObjectDefinePropertyPolyfill(): void;
4
+ export { handleObjectAssignPolyfill, handleObjectEntriesPolyfill, handleObjectDefinePropertyPolyfill };
@@ -1,11 +1,11 @@
1
- import type { TaroNode } from '../../dom/node';
1
+ import { TaroNode } from "./dom/node.js";
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
- export interface MutationRecord {
8
+ interface MutationRecord {
9
9
  readonly target: TaroNode;
10
10
  readonly addedNodes?: TaroNode[];
11
11
  readonly removedNodes?: TaroNode[];
@@ -17,8 +17,9 @@ export interface MutationRecord {
17
17
  readonly type: MutationRecordType;
18
18
  readonly value?: string | null;
19
19
  }
20
- export declare const enum MutationRecordType {
20
+ declare const enum MutationRecordType {
21
21
  ATTRIBUTES = "attributes",
22
22
  CHARACTER_DATA = "characterData",
23
23
  CHILD_LIST = "childList"
24
24
  }
25
+ export { MutationRecord, MutationRecordType };