@tarojs/runtime 3.6.0-canary.9 → 3.6.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.
@@ -0,0 +1,50 @@
1
+ import { URLSearchParams } from './URLSearchParams';
2
+ export declare class URL {
3
+ #private;
4
+ static createObjectURL(): void;
5
+ static revokeObjectURL(): void;
6
+ constructor(url: string, base?: string);
7
+ get protocol(): string;
8
+ set protocol(val: string);
9
+ get host(): string;
10
+ set host(val: string);
11
+ get hostname(): string;
12
+ set hostname(val: string);
13
+ get port(): string;
14
+ set port(val: string);
15
+ get pathname(): string;
16
+ set pathname(val: string);
17
+ get search(): string;
18
+ set search(val: string);
19
+ get hash(): string;
20
+ set hash(val: string);
21
+ get href(): string;
22
+ set href(val: string);
23
+ get origin(): string;
24
+ set origin(val: string);
25
+ get searchParams(): URLSearchParams;
26
+ toString(): string;
27
+ toJSON(): string;
28
+ _toRaw(): {
29
+ protocol: string;
30
+ port: string;
31
+ host: string;
32
+ hostname: string;
33
+ pathname: string;
34
+ hash: string;
35
+ search: string;
36
+ origin: string;
37
+ href: string;
38
+ };
39
+ }
40
+ export declare function parseUrlBase(url: string, base?: string): {
41
+ href: string;
42
+ origin: string;
43
+ protocol: string;
44
+ hostname: string;
45
+ host: string;
46
+ port: string;
47
+ pathname: string;
48
+ search: string;
49
+ hash: string;
50
+ };
@@ -33,4 +33,16 @@ export declare class Location extends Events {
33
33
  toString(): string;
34
34
  get cache(): RuntimeCache<LocationContext>;
35
35
  }
36
+ export declare function resolveRelativePath(path: string, relative: string): string;
37
+ export declare function parseUrl(url?: string): {
38
+ href: string;
39
+ origin: string;
40
+ protocol: string;
41
+ hostname: string;
42
+ host: string;
43
+ port: string;
44
+ pathname: string;
45
+ search: string;
46
+ hash: string;
47
+ };
36
48
  export {};
@@ -44,7 +44,9 @@ export declare const ON_SHOW = "onShow";
44
44
  export declare const ON_HIDE = "onHide";
45
45
  export declare const OPTIONS = "options";
46
46
  export declare const EXTERNAL_CLASSES = "externalClasses";
47
+ export declare const EVENT_CALLBACK_RESULT = "e_result";
47
48
  export declare const BEHAVIORS = "behaviors";
49
+ export declare const A = "a";
48
50
  /**
49
51
  * 页面上下文切换时的行为
50
52
  */
@@ -0,0 +1,13 @@
1
+ import { TaroElement } from './element';
2
+ export declare class AnchorElement extends TaroElement {
3
+ get href(): string;
4
+ set href(val: string);
5
+ get protocol(): any;
6
+ get host(): any;
7
+ get search(): any;
8
+ get hash(): any;
9
+ get hostname(): any;
10
+ get port(): any;
11
+ get pathname(): any;
12
+ setAttribute(qualifiedName: string, value: any): void;
13
+ }
@@ -20,4 +20,4 @@ export declare class TaroEvent {
20
20
  get currentTarget(): any;
21
21
  }
22
22
  export declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
23
- export declare function eventHandler(event: MpEvent): void;
23
+ export declare function eventHandler(event: MpEvent): any;
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { document } from './bom/document';
4
4
  export { getComputedStyle } from './bom/getComputedStyle';
5
5
  export { nav as navigator } from './bom/navigator';
6
6
  export { caf as cancelAnimationFrame, now, raf as requestAnimationFrame } from './bom/raf';
7
+ export { URL } from './bom/URL';
7
8
  export { URLSearchParams } from './bom/URLSearchParams';
8
9
  export { history, location, window } from './bom/window';
9
10
  export { TaroElement } from './dom/element';
@@ -15,6 +16,7 @@ export { Style } from './dom/style';
15
16
  export { SVGElement } from './dom/svg';
16
17
  export { TaroText } from './dom/text';
17
18
  export { MutationObserver } from './dom-external/mutation-observer';
19
+ export { parseUrl } from './bom/location';
18
20
  export { Current, getCurrentInstance } from './current';
19
21
  export { eventSource } from './dom/event-source';
20
22
  export { addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getPageInstance, injectPageInstance, removePageInstance, safeExecute, stringify } from './dsl/common';
@@ -127,7 +127,7 @@ declare class TaroEvent {
127
127
  }
128
128
  declare function createEvent(event: MpEvent | string, node?: TaroElement): TaroEvent;
129
129
  // 小程序的事件代理回调函数
130
- declare function eventHandler(event: MpEvent): void;
130
+ declare function eventHandler(event: MpEvent): any;
131
131
  declare class FormElement extends TaroElement {
132
132
  get value(): string | boolean | number | any[];
133
133
  set value(val: string | boolean | number | any[]);
@@ -341,6 +341,47 @@ declare class URLSearchParams {
341
341
  toJSON(): {};
342
342
  toString(): string;
343
343
  }
344
+ declare class URL {
345
+ #private;
346
+ static createObjectURL(): void;
347
+ static revokeObjectURL(): void;
348
+ constructor(url: string, base?: string);
349
+ /* public property */
350
+ get protocol(): string;
351
+ set protocol(val: string);
352
+ get host(): string;
353
+ set host(val: string);
354
+ get hostname(): string;
355
+ set hostname(val: string);
356
+ get port(): string;
357
+ set port(val: string);
358
+ get pathname(): string;
359
+ set pathname(val: string);
360
+ get search(): string;
361
+ set search(val: string);
362
+ get hash(): string;
363
+ set hash(val: string);
364
+ get href(): string;
365
+ set href(val: string);
366
+ get origin(): string;
367
+ set origin(val: string);
368
+ get searchParams(): URLSearchParams;
369
+ // public method
370
+ toString(): string;
371
+ toJSON(): string;
372
+ // convenient for deconstructor
373
+ _toRaw(): {
374
+ protocol: string;
375
+ port: string;
376
+ host: string;
377
+ hostname: string;
378
+ pathname: string;
379
+ hash: string;
380
+ search: string;
381
+ origin: string;
382
+ href: string;
383
+ };
384
+ }
344
385
  declare let window: any;
345
386
  declare const location: any;
346
387
  declare const history: any;
@@ -431,6 +472,22 @@ declare class MutationObserver {
431
472
  takeRecords(): MutationRecord[];
432
473
  static record(record: MutationRecord): void;
433
474
  }
475
+ declare const eventCenter: Events;
476
+ type EventsType = typeof Events;
477
+ type Options$0 = {
478
+ window: any;
479
+ };
480
+ declare function parseUrl(url?: string): {
481
+ href: string;
482
+ origin: string;
483
+ protocol: string;
484
+ hostname: string;
485
+ host: string;
486
+ port: string;
487
+ pathname: string;
488
+ search: string;
489
+ hash: string;
490
+ };
434
491
  interface Instance<T> extends Component<T>, Show, PageInstance {
435
492
  tid?: string;
436
493
  $forceUpdate?(): void;
@@ -542,8 +599,6 @@ declare function stringify(obj?: Record<string, unknown>): string;
542
599
  declare function createPageConfig(component: any, pageName?: string, data?: Record<string, unknown>, pageConfig?: PageConfig): PageInstance;
543
600
  declare function createComponentConfig(component: React.ComponentClass, componentName?: string, data?: Record<string, unknown>): any;
544
601
  declare function createRecursiveComponentConfig(componentName?: string): any;
545
- declare const eventCenter: Events;
546
- type EventsType = typeof Events;
547
602
  /**
548
603
  * React also has a fancy function's name for this: `hydrate()`.
549
604
  * You may have been heard `hydrate` as a SSR-related function,
@@ -555,4 +610,4 @@ declare const nextTick: (cb: Func, ctx?: Record<string, any>) => void;
555
610
  declare const options: Options;
556
611
  declare const incrementId: () => () => string;
557
612
  export { hooks } from '@tarojs/shared';
558
- export { document, getComputedStyle, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getPageInstance, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options, Func, Ctx };
613
+ export { document, getComputedStyle, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, parseUrl, Current, getCurrentInstance, eventSource, addLeadingSlash, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getPageInstance, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$0 as Options, Func, Ctx };