@tarojs/runtime 3.7.0-alpha.0 → 3.7.0-alpha.1

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.
@@ -6,10 +6,10 @@ export interface HistoryState {
6
6
  title: string;
7
7
  url: string;
8
8
  }
9
- declare type Options = {
9
+ type Options = {
10
10
  window: any;
11
11
  };
12
- declare type HistoryContext = {
12
+ type HistoryContext = {
13
13
  location: LocationType.Location;
14
14
  stack: HistoryState[];
15
15
  cur: number;
@@ -1,9 +1,9 @@
1
1
  import { Events } from '../emitter/emitter';
2
2
  import { RuntimeCache } from '../utils/cache';
3
- declare type Options = {
3
+ type Options = {
4
4
  window: any;
5
5
  };
6
- declare type LocationContext = {
6
+ type LocationContext = {
7
7
  lastHref: string;
8
8
  };
9
9
  export declare class Location extends Events {
@@ -1,4 +1,4 @@
1
1
  import type { TaroElement } from './element';
2
- declare type Filter = (element: TaroElement) => boolean;
2
+ type Filter = (element: TaroElement) => boolean;
3
3
  export declare function treeToArray(root: TaroElement, predict?: Filter): TaroElement[];
4
4
  export {};
@@ -20,6 +20,6 @@ export interface Element extends Node {
20
20
  export interface ParsedTaroElement extends TaroElement {
21
21
  h5tagName?: string;
22
22
  }
23
- declare type ChildNode = Comment | Text | Element;
23
+ type ChildNode = Comment | Text | Element;
24
24
  export declare function parser(html: string, document: TaroDocument): (import("../..").TaroText | TaroElement)[];
25
25
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { TaroNode } from '../../dom/node';
2
2
  import type { MutationRecord } from './record';
3
- export declare type MutationCallback = (mutations: MutationRecord[]) => any;
3
+ export type MutationCallback = (mutations: MutationRecord[]) => any;
4
4
  /**
5
5
  * @see https://dom.spec.whatwg.org/#dictdef-mutationobserverinit
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { TaroNode } from '../dom/node';
2
- export declare type IPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
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`
@@ -13,7 +13,7 @@ export interface Instance<T = Record<string, any>> extends Component<T>, Show, P
13
13
  export interface VueAppInstance extends ComponentOptions<VueCtor> {
14
14
  $options: AppInstance;
15
15
  }
16
- export declare type VueInstance<M = Record<string, any>, P = Record<string, any>> = CombinedVueInstance<VueCtor, Record<string, any>, M, P, Record<never, any>> & VueInternal;
16
+ export type VueInstance<M = Record<string, any>, P = Record<string, any>> = CombinedVueInstance<VueCtor, Record<string, any>, M, P, Record<never, any>> & VueInternal;
17
17
  interface VueInternal {
18
18
  _render(): VNode;
19
19
  _update(vnode: VNode, hyrate: boolean): void;
@@ -1,4 +1,4 @@
1
1
  import { Events } from '@tarojs/shared';
2
2
  declare const eventCenter: Events;
3
- export declare type EventsType = typeof Events;
3
+ export type EventsType = typeof Events;
4
4
  export { eventCenter, Events };
@@ -2,7 +2,7 @@ export interface EventOptions {
2
2
  bubbles: boolean;
3
3
  cancelable: boolean;
4
4
  }
5
- declare type Target = Record<string, unknown> & {
5
+ type Target = Record<string, unknown> & {
6
6
  dataset: Record<string, unknown>;
7
7
  id: string;
8
8
  };
@@ -25,6 +25,6 @@ interface MiniTextData {
25
25
  [Shortcuts.Text]: string;
26
26
  [Shortcuts.NodeName]: string;
27
27
  }
28
- export declare type MiniData = MiniElementData | MiniTextData;
29
- export declare type HydratedData = () => MiniData | MiniData[];
28
+ export type MiniData = MiniElementData | MiniTextData;
29
+ export type HydratedData = () => MiniData | MiniData[];
30
30
  export {};
@@ -1,6 +1,6 @@
1
1
  import { HydratedData } from './index';
2
- export declare type UpdatePayloadValue = string | boolean | HydratedData;
3
- export declare type DataTree = Record<string, UpdatePayloadValue | ReturnType<HydratedData>>;
2
+ export type UpdatePayloadValue = string | boolean | HydratedData;
3
+ export type DataTree = Record<string, UpdatePayloadValue | ReturnType<HydratedData>>;
4
4
  export interface UpdatePayload {
5
5
  path: string;
6
6
  value: UpdatePayloadValue;
@@ -1,2 +1,2 @@
1
- export declare type Func = (...args: any[]) => any;
2
- export declare type Ctx = Record<string, any>;
1
+ export type Func = (...args: any[]) => any;
2
+ export type Ctx = Record<string, any>;
@@ -578,7 +578,7 @@ declare class MutationObserver {
578
578
  takeRecords(): MutationRecord[];
579
579
  static record(record: MutationRecord): void;
580
580
  }
581
- interface Instance<T> extends Component<T>, Show, PageInstance {
581
+ interface Instance<T = Record<string, any>> extends Component<T>, Show, PageInstance {
582
582
  tid?: string;
583
583
  $forceUpdate?(): void;
584
584
  $nextTick?(cb: () => void): void;
@@ -587,7 +587,7 @@ interface Instance<T> extends Component<T>, Show, PageInstance {
587
587
  interface VueAppInstance extends ComponentOptions<VueCtor> {
588
588
  $options: AppInstance;
589
589
  }
590
- type VueInstance<M, P> = CombinedVueInstance<VueCtor, Record<string, any>, M, P, Record<never, any>> & VueInternal;
590
+ type VueInstance<M = Record<string, any>, P = Record<string, any>> = CombinedVueInstance<VueCtor, Record<string, any>, M, P, Record<never, any>> & VueInternal;
591
591
  interface VueInternal {
592
592
  _render(): VNode;
593
593
  _update(vnode: VNode, hyrate: boolean): void;
@@ -595,13 +595,13 @@ interface VueInternal {
595
595
  interface PageProps {
596
596
  tid?: string;
597
597
  }
598
- interface ReactPageComponent<T> extends ComponentClass<T>, PageInstance {
598
+ interface ReactPageComponent<T = PageProps> extends ComponentClass<T>, PageInstance {
599
599
  }
600
- interface ReactPageInstance<T> extends Component<T>, PageInstance {
600
+ interface ReactPageInstance<T = PageProps> extends Component<T>, PageInstance {
601
601
  componentDidShow?(): void;
602
602
  componentDidHide?(): void;
603
603
  }
604
- interface ReactAppInstance<T> extends Component<T>, AppInstance {
604
+ interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
605
605
  }
606
606
  interface PageLifeCycle extends Show {
607
607
  eh?(event: MpEvent): void;
@@ -2879,6 +2879,12 @@ _URLSearchParams_dict = new WeakMap();
2879
2879
 
2880
2880
  var _URL_hash, _URL_hostname, _URL_pathname, _URL_port, _URL_protocol, _URL_search;
2881
2881
  class URL {
2882
+ static createObjectURL() {
2883
+ throw new Error('Oops, not support URL.createObjectURL() in miniprogram.');
2884
+ }
2885
+ static revokeObjectURL() {
2886
+ throw new Error('Oops, not support URL.revokeObjectURL() in miniprogram.');
2887
+ }
2882
2888
  constructor(url, base) {
2883
2889
  /* private property */
2884
2890
  _URL_hash.set(this, '');
@@ -2898,12 +2904,6 @@ class URL {
2898
2904
  __classPrivateFieldSet(this, _URL_protocol, protocol, "f");
2899
2905
  __classPrivateFieldSet(this, _URL_search, new URLSearchParams(search), "f");
2900
2906
  }
2901
- static createObjectURL() {
2902
- throw new Error('Oops, not support URL.createObjectURL() in miniprogram.');
2903
- }
2904
- static revokeObjectURL() {
2905
- throw new Error('Oops, not support URL.revokeObjectURL() in miniprogram.');
2906
- }
2907
2907
  /* public property */
2908
2908
  get protocol() {
2909
2909
  return __classPrivateFieldGet(this, _URL_protocol, "f");