@tarojs/runtime 4.1.0-alpha.2 → 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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 一个小型缓存池,用于在切换页面时,存储一些上下文信息
3
3
  */
4
- export declare class RuntimeCache<T> {
4
+ declare class RuntimeCache<T> {
5
5
  name: string;
6
6
  cache: Map<string, T>;
7
7
  constructor(name: string);
@@ -10,3 +10,4 @@ export declare class RuntimeCache<T> {
10
10
  get(identifier: string): T | undefined;
11
11
  delete(identifier: string): void;
12
12
  }
13
+ export { RuntimeCache };
@@ -1,25 +1,26 @@
1
- import type { TaroElement } from '../dom/element';
2
- import type { TaroNode } from '../dom/node';
3
- import type { TaroText } from '../dom/text';
4
- import type { TFunc } from '../interface';
5
- export declare const incrementId: () => () => string;
6
- export declare function isElement(node: TaroNode): node is TaroElement;
7
- export declare function isText(node: TaroNode): node is TaroText;
8
- export declare function isComment(node: TaroNode): boolean;
9
- export declare function isHasExtractProp(el: TaroElement): boolean;
1
+ import { TaroElement } from "../dom/element.js";
2
+ import { TaroNode } from "../dom/node.js";
3
+ import { TaroText } from "../dom/text.js";
4
+ import { TFunc } from "../index-26658829.js";
5
+ declare const incrementId: () => () => string;
6
+ declare function isElement(node: TaroNode): node is TaroElement;
7
+ declare function isText(node: TaroNode): node is TaroText;
8
+ declare function isComment(node: TaroNode): boolean;
9
+ declare function isHasExtractProp(el: TaroElement): boolean;
10
10
  /**
11
11
  * 往上寻找组件树直到 root,寻找是否有祖先组件绑定了同类型的事件
12
12
  * @param node 当前组件
13
13
  * @param type 事件类型
14
14
  */
15
- export declare function isParentBinded(node: TaroElement | null, type: string): boolean;
16
- export declare function shortcutAttr(key: string): string;
17
- export declare const customWrapperCache: Map<string, Record<string, any>>;
15
+ declare function isParentBinded(node: TaroElement | null, type: string): boolean;
16
+ declare function shortcutAttr(key: string): string;
17
+ declare const customWrapperCache: Map<string, Record<string, any>>;
18
18
  interface Ctor {
19
19
  new (...args: any[]): any;
20
20
  }
21
- export declare function extend(ctor: Ctor, methodName: string, options: TFunc | Record<string, any>): void;
22
- export declare function getComponentsAlias(): any;
23
- export declare function convertNumber2PX(value: number): string;
24
- export * from './lodash';
25
- export * from './router';
21
+ declare function extend(ctor: Ctor, methodName: string, options: TFunc | Record<string, any>): void;
22
+ declare function getComponentsAlias(): any;
23
+ declare function convertNumber2PX(value: number): string;
24
+ export { incrementId, isElement, isText, isComment, isHasExtractProp, isParentBinded, shortcutAttr, customWrapperCache, extend, getComponentsAlias, convertNumber2PX };
25
+ export * from "./lodash.js";
26
+ export * from "./router.js";
@@ -1,2 +1,3 @@
1
- export declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
2
- export declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
1
+ declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
2
+ declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
3
+ export { throttle, debounce };
@@ -1,7 +1,8 @@
1
- export declare const addLeadingSlash: (url?: string) => string;
2
- export declare const hasBasename: (path?: string, prefix?: string) => boolean;
3
- export declare const stripBasename: (path?: string, prefix?: string) => string;
4
- export declare const stripTrailing: (str?: string) => string;
5
- export declare const stripSuffix: (path?: string, suffix?: string) => string;
6
- export declare const getHomePage: (path?: string, basename?: string, customRoutes?: Record<string, string | string[]>, entryPagePath?: string) => string;
7
- export declare const getCurrentPage: (routerMode?: string, basename?: string) => string;
1
+ declare const addLeadingSlash: (url?: string) => string;
2
+ declare const hasBasename: (path?: string, prefix?: string) => boolean;
3
+ declare const stripBasename: (path?: string, prefix?: string) => string;
4
+ declare const stripTrailing: (str?: string) => string;
5
+ declare const stripSuffix: (path?: string, suffix?: string) => string;
6
+ declare const getHomePage: (path?: string, basename?: string, customRoutes?: Record<string, string | string[]>, entryPagePath?: string) => string;
7
+ declare const getCurrentPage: (routerMode?: string, basename?: string) => string;
8
+ export { addLeadingSlash, hasBasename, stripBasename, stripTrailing, stripSuffix, getHomePage, getCurrentPage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/runtime",
3
- "version": "4.1.0-alpha.2",
3
+ "version": "4.1.0",
4
4
  "description": "taro runtime for mini apps.",
5
5
  "author": "O2Team",
6
6
  "license": "MIT",
@@ -24,15 +24,16 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "tslib": "^2.6.2",
27
- "@tarojs/shared": "4.1.0-alpha.2"
27
+ "@tarojs/shared": "4.1.0"
28
28
  },
29
29
  "devDependencies": {
30
+ "@rollup/plugin-typescript": "^12.1.2",
30
31
  "@types/react": "^18.2.79",
31
32
  "@vue/runtime-core": "^3.4.23",
32
33
  "lodash": "^4.17.21",
33
34
  "react": "^18.2.0",
34
35
  "rollup": "^4.37.0",
35
- "@rollup/plugin-typescript": "^12.1.2"
36
+ "rollup-plugin-ts": "^3.4.5"
36
37
  },
37
38
  "scripts": {
38
39
  "prod": "pnpm run build",
@@ -1,4 +0,0 @@
1
- export interface Attributes {
2
- name: string;
3
- value: string;
4
- }
@@ -1,11 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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 {};
@@ -1,29 +0,0 @@
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[];
@@ -1,7 +0,0 @@
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';
@@ -1,7 +0,0 @@
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,2 +0,0 @@
1
- export type TFunc = (...args: any[]) => any;
2
- export type PageConfig = Record<string, any>;