@tarojs/runtime 3.7.0-canary.6 → 3.8.0-canary.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.
- package/LICENSE +14 -0
- package/dist/bom/URL.d.ts +54 -0
- package/dist/bom/URL.js +221 -0
- package/dist/bom/URL.js.map +1 -0
- package/dist/bom/URLSearchParams.d.ts +2 -0
- package/dist/bom/URLSearchParams.js +131 -0
- package/dist/bom/URLSearchParams.js.map +1 -0
- package/dist/bom/document.d.ts +3 -0
- package/dist/bom/document.js +39 -0
- package/dist/bom/document.js.map +1 -0
- package/dist/bom/getComputedStyle.d.ts +5 -0
- package/dist/bom/getComputedStyle.js +8 -0
- package/dist/bom/getComputedStyle.js.map +1 -0
- package/dist/bom/history.d.ts +32 -0
- package/dist/bom/history.js +121 -0
- package/dist/bom/history.js.map +1 -0
- package/dist/bom/location.d.ts +39 -0
- package/dist/bom/location.js +240 -0
- package/dist/bom/location.js.map +1 -0
- package/dist/bom/navigator.d.ts +2 -0
- package/dist/bom/navigator.js +24 -0
- package/dist/bom/navigator.js.map +1 -0
- package/dist/bom/raf.d.ts +4 -0
- package/dist/bom/raf.js +33 -0
- package/dist/bom/raf.js.map +1 -0
- package/dist/bom/window.d.ts +25 -0
- package/dist/bom/window.js +92 -0
- package/dist/bom/window.js.map +1 -0
- package/dist/constants/index.d.ts +60 -0
- package/dist/constants/index.js +63 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/current.d.ts +19 -0
- package/dist/current.js +9 -0
- package/dist/current.js.map +1 -0
- package/dist/dom/anchor-element.d.ts +14 -0
- package/dist/dom/anchor-element.js +54 -0
- package/dist/dom/anchor-element.js.map +1 -0
- package/dist/dom/class-list.d.ts +17 -0
- package/dist/dom/class-list.js +92 -0
- package/dist/dom/class-list.js.map +1 -0
- package/dist/dom/document.d.ts +25 -0
- package/dist/dom/document.js +80 -0
- package/dist/dom/document.js.map +1 -0
- package/dist/dom/element.d.ts +40 -0
- package/dist/dom/element.js +318 -0
- package/dist/dom/element.js.map +1 -0
- package/dist/dom/event-source.d.ts +7 -0
- package/dist/dom/event-source.js +17 -0
- package/dist/dom/event-source.js.map +1 -0
- package/dist/dom/event-target.d.ts +8 -0
- package/dist/dom/event-target.js +78 -0
- package/dist/dom/event-target.js.map +1 -0
- package/dist/dom/event.d.ts +24 -0
- package/dist/dom/event.js +152 -0
- package/dist/dom/event.js.map +1 -0
- package/dist/dom/form.d.ts +10 -0
- package/dist/dom/form.js +38 -0
- package/dist/dom/form.js.map +1 -0
- package/dist/dom/node.d.ts +107 -0
- package/dist/dom/node.js +292 -0
- package/dist/dom/node.js.map +1 -0
- package/dist/dom/root.d.ts +16 -0
- package/dist/dom/root.js +169 -0
- package/dist/dom/root.js.map +1 -0
- package/dist/dom/style.d.ts +15 -0
- package/dist/dom/style.js +168 -0
- package/dist/dom/style.js.map +1 -0
- package/dist/dom/style_properties.d.ts +3 -0
- package/dist/dom/style_properties.js +186 -0
- package/dist/dom/style_properties.js.map +1 -0
- package/dist/dom/svg.d.ts +4 -0
- package/dist/dom/svg.js +8 -0
- package/dist/dom/svg.js.map +1 -0
- package/dist/dom/text.d.ts +15 -0
- package/dist/dom/text.js +41 -0
- package/dist/dom/text.js.map +1 -0
- package/dist/dom/transfer.d.ts +8 -0
- package/dist/dom/transfer.js +15 -0
- package/dist/dom/transfer.js.map +1 -0
- package/dist/dom/tree.d.ts +4 -0
- package/dist/dom/tree.js +38 -0
- package/dist/dom/tree.js.map +1 -0
- package/dist/dom-external/element.d.ts +4 -0
- package/dist/dom-external/element.js +29 -0
- package/dist/dom-external/element.js.map +1 -0
- package/dist/dom-external/index.d.ts +1 -0
- package/dist/dom-external/index.js +38 -0
- package/dist/dom-external/index.js.map +1 -0
- package/dist/dom-external/inner-html/html.d.ts +3 -0
- package/dist/dom-external/inner-html/html.js +28 -0
- package/dist/dom-external/inner-html/html.js.map +1 -0
- package/dist/dom-external/inner-html/parser.d.ts +25 -0
- package/dist/dom-external/inner-html/parser.js +257 -0
- package/dist/dom-external/inner-html/parser.js.map +1 -0
- package/dist/dom-external/inner-html/scaner.d.ts +30 -0
- package/dist/dom-external/inner-html/scaner.js +304 -0
- package/dist/dom-external/inner-html/scaner.js.map +1 -0
- package/dist/dom-external/inner-html/style.d.ts +27 -0
- package/dist/dom-external/inner-html/style.js +235 -0
- package/dist/dom-external/inner-html/style.js.map +1 -0
- package/dist/dom-external/inner-html/tags.d.ts +14 -0
- package/dist/dom-external/inner-html/tags.js +41 -0
- package/dist/dom-external/inner-html/tags.js.map +1 -0
- package/dist/dom-external/inner-html/utils.d.ts +2 -0
- package/dist/dom-external/inner-html/utils.js +12 -0
- package/dist/dom-external/inner-html/utils.js.map +1 -0
- package/dist/dom-external/mutation-observer/implements.d.ts +71 -0
- package/dist/dom-external/mutation-observer/implements.js +108 -0
- package/dist/dom-external/mutation-observer/implements.js.map +1 -0
- package/dist/dom-external/mutation-observer/index.d.ts +12 -0
- package/dist/dom-external/mutation-observer/index.js +35 -0
- package/dist/dom-external/mutation-observer/index.js.map +1 -0
- package/dist/dom-external/node.d.ts +12 -0
- package/dist/dom-external/node.js +75 -0
- package/dist/dom-external/node.js.map +1 -0
- package/dist/dsl/common.d.ts +15 -0
- package/dist/dsl/common.js +337 -0
- package/dist/dsl/common.js.map +1 -0
- package/dist/emitter/emitter.d.ts +4 -0
- package/dist/emitter/emitter.js +7 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/env.d.ts +7 -0
- package/dist/env.js +9 -0
- package/dist/env.js.map +1 -0
- package/dist/hydrate.d.ts +11 -0
- package/dist/hydrate.js +91 -0
- package/dist/hydrate.js.map +1 -0
- package/dist/index-26658829.d.ts +23 -0
- package/dist/{runtime.cjs.d.ts → index.cjs.d.ts} +95 -88
- package/dist/{runtime.h5.js → index.cjs.js} +2276 -438
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/instance-0f017c6e.d.ts +95 -0
- package/dist/next-tick.d.ts +3 -0
- package/dist/next-tick.js +47 -0
- package/dist/next-tick.js.map +1 -0
- package/dist/node_types-9ac5b4dd.d.ts +11 -0
- package/dist/options-0f017c6e.d.ts +17 -0
- package/dist/options.d.ts +3 -0
- package/dist/options.js +7 -0
- package/dist/options.js.map +1 -0
- package/dist/perf.d.ts +7 -0
- package/dist/perf.js +28 -0
- package/dist/perf.js.map +1 -0
- package/dist/polyfill/array.d.ts +3 -0
- package/dist/polyfill/array.js +56 -0
- package/dist/polyfill/array.js.map +1 -0
- package/dist/polyfill/index.d.ts +2 -0
- package/dist/polyfill/index.js +34 -0
- package/dist/polyfill/index.js.map +1 -0
- package/dist/polyfill/intersection-observer.d.ts +2 -0
- package/dist/polyfill/intersection-observer.js +599 -0
- package/dist/polyfill/intersection-observer.js.map +1 -0
- package/dist/polyfill/object.d.ts +4 -0
- package/dist/polyfill/object.js +102 -0
- package/dist/polyfill/object.js.map +1 -0
- package/dist/record-32b054d8.d.ts +25 -0
- package/dist/runtime.esm.d.ts +95 -88
- package/dist/runtime.esm.js +1267 -427
- package/dist/runtime.esm.js.map +1 -1
- package/dist/utils/cache.d.ts +13 -0
- package/dist/utils/cache.js +27 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/index.d.ts +24 -0
- package/dist/utils/index.js +95 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lodash.d.ts +2 -0
- package/dist/utils/lodash.js +22 -0
- package/dist/utils/lodash.js.map +1 -0
- package/dist/utils/router.d.ts +8 -0
- package/dist/utils/router.js +24 -0
- package/dist/utils/router.js.map +1 -0
- package/package.json +16 -11
- package/dist/runtime.cjs.js +0 -4614
- package/dist/runtime.h5.d.ts +0 -781
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Shortcuts, Events } from "@tarojs/shared";
|
|
2
|
-
import { PageConfig } from "@tarojs/taro";
|
|
3
2
|
import VueCtor from "vue";
|
|
4
3
|
import { ComponentOptions, VNode } from "vue";
|
|
5
4
|
import { Component as Vue3Component } from "@vue/runtime-core";
|
|
@@ -45,9 +44,13 @@ interface AddEventListenerOptions extends EventListenerOptions {
|
|
|
45
44
|
once?: boolean;
|
|
46
45
|
passive?: boolean;
|
|
47
46
|
}
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
48
48
|
interface EventHandler extends Function {
|
|
49
49
|
_stop?: boolean;
|
|
50
50
|
}
|
|
51
|
+
// Note: @tarojs/runtime 不依赖 @tarojs/taro, 所以不能改为从 @tarojs/taro 引入 (可能导致循环依赖)
|
|
52
|
+
type TFunc = (...args: any[]) => any;
|
|
53
|
+
type PageConfig = Record<string, any>;
|
|
51
54
|
interface MpInstance {
|
|
52
55
|
config: PageConfig;
|
|
53
56
|
setData: (data: unknown, cb: () => void) => void;
|
|
@@ -134,8 +137,6 @@ interface Options {
|
|
|
134
137
|
};
|
|
135
138
|
miniGlobal?: any;
|
|
136
139
|
}
|
|
137
|
-
type Func = (...args: any[]) => any;
|
|
138
|
-
type Ctx = Record<string, any>;
|
|
139
140
|
declare class TaroEventTarget {
|
|
140
141
|
__handlers: Record<string, EventHandler[]>;
|
|
141
142
|
addEventListener(type: string, handler: EventHandler, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -151,8 +152,8 @@ declare class TaroRootElement extends TaroElement {
|
|
|
151
152
|
get _path(): string;
|
|
152
153
|
get _root(): TaroRootElement;
|
|
153
154
|
enqueueUpdate(payload: UpdatePayload): void;
|
|
154
|
-
performUpdate(initRender?: boolean, prerender?:
|
|
155
|
-
enqueueUpdateCallback(cb:
|
|
155
|
+
performUpdate(initRender?: boolean, prerender?: TFunc): void;
|
|
156
|
+
enqueueUpdateCallback(cb: TFunc, ctx?: Record<string, any>): void;
|
|
156
157
|
flushUpdateCallback(): void;
|
|
157
158
|
}
|
|
158
159
|
interface RemoveChildOptions {
|
|
@@ -223,7 +224,7 @@ declare class TaroNode extends TaroEventTarget {
|
|
|
223
224
|
hasChildNodes(): boolean;
|
|
224
225
|
enqueueUpdate(payload: UpdatePayload): void;
|
|
225
226
|
get ownerDocument(): TaroDocument;
|
|
226
|
-
static extend(methodName: string, options:
|
|
227
|
+
static extend(methodName: string, options: TFunc | Record<string, any>): void;
|
|
227
228
|
}
|
|
228
229
|
declare class Style {
|
|
229
230
|
_pending: boolean;
|
|
@@ -297,7 +298,7 @@ declare class TaroElement extends TaroNode {
|
|
|
297
298
|
dispatchEvent(event: TaroEvent): boolean;
|
|
298
299
|
addEventListener(type: any, handler: any, options: any): void;
|
|
299
300
|
removeEventListener(type: any, handler: any, sideEffect?: boolean): void;
|
|
300
|
-
static extend(methodName: string, options:
|
|
301
|
+
static extend(methodName: string, options: TFunc | Record<string, any>): void;
|
|
301
302
|
}
|
|
302
303
|
declare class FormElement extends TaroElement {
|
|
303
304
|
get type(): string;
|
|
@@ -311,6 +312,7 @@ declare class TaroDocument extends TaroElement {
|
|
|
311
312
|
head: TaroElement;
|
|
312
313
|
body: TaroElement;
|
|
313
314
|
createEvent: typeof createEvent;
|
|
315
|
+
cookie?: string;
|
|
314
316
|
constructor();
|
|
315
317
|
createElement(type: string): TaroElement | TaroRootElement | FormElement;
|
|
316
318
|
// an ugly fake createElementNS to deal with @vue/runtime-dom's
|
|
@@ -329,8 +331,9 @@ interface Env {
|
|
|
329
331
|
document: TaroDocument;
|
|
330
332
|
}
|
|
331
333
|
declare const env: Env;
|
|
332
|
-
declare
|
|
333
|
-
|
|
334
|
+
declare const document: TaroDocument;
|
|
335
|
+
type TGetComputedStyle = typeof window.getComputedStyle | ((el: TaroElement) => Style);
|
|
336
|
+
declare const getComputedStyle: TGetComputedStyle;
|
|
334
337
|
declare const eventCenter: Events;
|
|
335
338
|
type EventsType = typeof Events;
|
|
336
339
|
/**
|
|
@@ -345,75 +348,60 @@ declare class RuntimeCache<T> {
|
|
|
345
348
|
get(identifier: string): T | undefined;
|
|
346
349
|
delete(identifier: string): void;
|
|
347
350
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
set search(val: string);
|
|
385
|
-
get hash(): string;
|
|
386
|
-
// 小程序的navigateTo存在截断hash字符串的问题
|
|
387
|
-
set hash(val: string);
|
|
388
|
-
get href(): string;
|
|
389
|
-
set href(val: string);
|
|
390
|
-
get origin(): string;
|
|
391
|
-
set origin(val: string);
|
|
392
|
-
/* public method */
|
|
393
|
-
assign(): void;
|
|
394
|
-
reload(): void;
|
|
395
|
-
replace(url: string): void;
|
|
396
|
-
toString(): string;
|
|
397
|
-
// For debug
|
|
398
|
-
get cache(): RuntimeCache<LocationContext>;
|
|
399
|
-
}
|
|
351
|
+
type Options$0 = {
|
|
352
|
+
window: any;
|
|
353
|
+
};
|
|
354
|
+
type LocationContext = {
|
|
355
|
+
lastHref: string;
|
|
356
|
+
};
|
|
357
|
+
declare class TaroLocation extends Events {
|
|
358
|
+
#private;
|
|
359
|
+
constructor(options: Options$0);
|
|
360
|
+
/* public property */
|
|
361
|
+
get protocol(): string;
|
|
362
|
+
set protocol(val: string);
|
|
363
|
+
get host(): string;
|
|
364
|
+
set host(val: string);
|
|
365
|
+
get hostname(): string;
|
|
366
|
+
set hostname(val: string);
|
|
367
|
+
get port(): string;
|
|
368
|
+
set port(val: string);
|
|
369
|
+
get pathname(): string;
|
|
370
|
+
set pathname(val: string);
|
|
371
|
+
get search(): string;
|
|
372
|
+
set search(val: string);
|
|
373
|
+
get hash(): string;
|
|
374
|
+
// 小程序的navigateTo存在截断hash字符串的问题
|
|
375
|
+
set hash(val: string);
|
|
376
|
+
get href(): string;
|
|
377
|
+
set href(val: string);
|
|
378
|
+
get origin(): string;
|
|
379
|
+
set origin(val: string);
|
|
380
|
+
/* public method */
|
|
381
|
+
assign(): void;
|
|
382
|
+
reload(): void;
|
|
383
|
+
replace(url: string): void;
|
|
384
|
+
toString(): string;
|
|
385
|
+
// For debug
|
|
386
|
+
get cache(): RuntimeCache<LocationContext>;
|
|
400
387
|
}
|
|
388
|
+
declare const Location: typeof TaroLocation;
|
|
401
389
|
interface HistoryState {
|
|
402
390
|
state: Record<string, any> | null;
|
|
403
391
|
title: string;
|
|
404
392
|
url: string;
|
|
405
393
|
}
|
|
406
|
-
type Options$
|
|
394
|
+
type Options$1 = {
|
|
407
395
|
window: any;
|
|
408
396
|
};
|
|
409
397
|
type HistoryContext = {
|
|
410
|
-
location:
|
|
398
|
+
location: TaroLocation;
|
|
411
399
|
stack: HistoryState[];
|
|
412
400
|
cur: number;
|
|
413
401
|
};
|
|
414
|
-
declare class
|
|
402
|
+
declare class TaroHistory extends Events {
|
|
415
403
|
#private;
|
|
416
|
-
constructor(location:
|
|
404
|
+
constructor(location: TaroLocation, options: Options$1);
|
|
417
405
|
/* public property */
|
|
418
406
|
get length(): number;
|
|
419
407
|
get state(): Record<string, any> | null;
|
|
@@ -426,28 +414,15 @@ declare class History extends Events {
|
|
|
426
414
|
// For debug
|
|
427
415
|
get cache(): RuntimeCache<HistoryContext>;
|
|
428
416
|
}
|
|
429
|
-
declare const
|
|
417
|
+
declare const History: typeof TaroHistory;
|
|
418
|
+
declare const nav: typeof window.navigator;
|
|
430
419
|
// https://github.com/myrne/performance-now
|
|
431
420
|
declare let now: () => number;
|
|
432
421
|
// https://gist.github.com/paulirish/1579671
|
|
433
422
|
// https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
|
|
434
423
|
declare const _raf: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
435
424
|
declare const _caf: typeof cancelAnimationFrame;
|
|
436
|
-
declare class
|
|
437
|
-
#private;
|
|
438
|
-
constructor(query: any);
|
|
439
|
-
append(name: string, value: string): void;
|
|
440
|
-
delete(name: string): void;
|
|
441
|
-
get(name: string): any;
|
|
442
|
-
getAll(name: string): any;
|
|
443
|
-
has(name: string): boolean;
|
|
444
|
-
keys(): string[];
|
|
445
|
-
set(name: string, value: string): void;
|
|
446
|
-
forEach(callback: any, thisArg: any): void;
|
|
447
|
-
toJSON(): {};
|
|
448
|
-
toString(): string;
|
|
449
|
-
}
|
|
450
|
-
declare class URL {
|
|
425
|
+
declare class TaroURL {
|
|
451
426
|
#private;
|
|
452
427
|
static createObjectURL(): void;
|
|
453
428
|
static revokeObjectURL(): void;
|
|
@@ -488,6 +463,7 @@ declare class URL {
|
|
|
488
463
|
href: string;
|
|
489
464
|
};
|
|
490
465
|
}
|
|
466
|
+
declare const URL: typeof TaroURL;
|
|
491
467
|
declare function parseUrl(url?: string): {
|
|
492
468
|
href: string;
|
|
493
469
|
origin: string;
|
|
@@ -499,9 +475,27 @@ declare function parseUrl(url?: string): {
|
|
|
499
475
|
search: string;
|
|
500
476
|
hash: string;
|
|
501
477
|
};
|
|
502
|
-
declare
|
|
503
|
-
declare
|
|
504
|
-
|
|
478
|
+
declare const URLSearchParams: any;
|
|
479
|
+
declare class TaroWindow extends Events {
|
|
480
|
+
navigator: Navigator;
|
|
481
|
+
requestAnimationFrame: typeof requestAnimationFrame | ((callback: any) => NodeJS.Timeout);
|
|
482
|
+
cancelAnimationFrame: typeof cancelAnimationFrame;
|
|
483
|
+
getComputedStyle: TGetComputedStyle;
|
|
484
|
+
Date: DateConstructor;
|
|
485
|
+
location: TaroLocation;
|
|
486
|
+
history: TaroHistory;
|
|
487
|
+
XMLHttpRequest?: Partial<XMLHttpRequest>;
|
|
488
|
+
constructor();
|
|
489
|
+
initEvent(): void;
|
|
490
|
+
get document(): TaroDocument;
|
|
491
|
+
addEventListener(event: string, callback: (arg: any) => void): void;
|
|
492
|
+
removeEventListener(event: string, callback: (arg: any) => void): void;
|
|
493
|
+
setTimeout(...args: Parameters<typeof setTimeout>): NodeJS.Timeout;
|
|
494
|
+
clearTimeout(...args: Parameters<typeof clearTimeout>): void;
|
|
495
|
+
}
|
|
496
|
+
declare const window: TaroWindow;
|
|
497
|
+
declare const location: TaroLocation;
|
|
498
|
+
declare const history: TaroHistory;
|
|
505
499
|
// for Vue3
|
|
506
500
|
declare class SVGElement extends TaroElement {
|
|
507
501
|
}
|
|
@@ -626,6 +620,7 @@ declare const KEY_CODE = "keyCode";
|
|
|
626
620
|
declare const TOUCHMOVE = "touchmove";
|
|
627
621
|
declare const DATE = "Date";
|
|
628
622
|
declare const SET_TIMEOUT = "setTimeout";
|
|
623
|
+
declare const COMPILE_MODE = "compileMode";
|
|
629
624
|
declare const CATCHMOVE = "catchMove";
|
|
630
625
|
declare const CATCH_VIEW = "catch-view";
|
|
631
626
|
declare const COMMENT = "comment";
|
|
@@ -676,7 +671,7 @@ interface ReactAppInstance<T = AppInstance> extends Component<T>, AppInstance {
|
|
|
676
671
|
interface PageLifeCycle extends Show {
|
|
677
672
|
eh?(event: MpEvent): void;
|
|
678
673
|
onAddToFavorites?(): void;
|
|
679
|
-
onLoad?(options: Record<string, unknown>, cb?:
|
|
674
|
+
onLoad?(options: Record<string, unknown>, cb?: TFunc): void;
|
|
680
675
|
onOptionMenuClick?(): void;
|
|
681
676
|
onPageScroll?(obj: {
|
|
682
677
|
scrollTop: number;
|
|
@@ -711,6 +706,8 @@ interface PageInstance extends PageLifeCycle {
|
|
|
711
706
|
options?: Record<string, unknown>;
|
|
712
707
|
/** 页面渲染引擎类型 */
|
|
713
708
|
renderer?: "webview" | "skyline";
|
|
709
|
+
/** 获得一个 EventChannel 对象,用于页面间通讯 */
|
|
710
|
+
getOpenerEventChannel?(): Record<string, any>;
|
|
714
711
|
}
|
|
715
712
|
interface Show {
|
|
716
713
|
componentDidShow?(): void;
|
|
@@ -727,6 +724,7 @@ interface AppInstance extends Show {
|
|
|
727
724
|
onPageNotFound?(res: any): void;
|
|
728
725
|
onUnhandledRejection?(error: any): void;
|
|
729
726
|
onShow?(options?: Record<string, unknown>): void;
|
|
727
|
+
onHide?(options?: Record<string, unknown>): void;
|
|
730
728
|
unmount?(id: string, cb?: () => void): void;
|
|
731
729
|
taroGlobalData?: Record<any, any>;
|
|
732
730
|
config?: Record<any, any>;
|
|
@@ -756,7 +754,6 @@ declare const eventSource: IEventSource;
|
|
|
756
754
|
declare function injectPageInstance(inst: Instance<PageProps>, id: string): void;
|
|
757
755
|
declare function getPageInstance(id: string): Instance | undefined;
|
|
758
756
|
declare function removePageInstance(id: string): void;
|
|
759
|
-
declare function addLeadingSlash(path?: string): string;
|
|
760
757
|
declare function safeExecute(path: string, lifecycle: string, ...args: unknown[]): any;
|
|
761
758
|
declare function stringify(obj?: Record<string, unknown>): string;
|
|
762
759
|
declare function getPath(id: string, options?: Record<string, unknown>): string;
|
|
@@ -773,9 +770,19 @@ declare function createRecursiveComponentConfig(componentName?: string): any;
|
|
|
773
770
|
* it's a vnode traverser and modifier: that's exactly what Taro's doing in here.
|
|
774
771
|
*/
|
|
775
772
|
declare function hydrate(node: TaroElement | TaroText): MiniData;
|
|
776
|
-
declare const nextTick: (cb:
|
|
773
|
+
declare const nextTick: (cb: TFunc, ctx?: Record<string, any>) => void;
|
|
777
774
|
declare const options: Options;
|
|
778
775
|
declare const incrementId: () => () => string;
|
|
779
776
|
declare function isHasExtractProp(el: TaroElement): boolean;
|
|
777
|
+
// export const removeLeadingSlash = (str = '') => str.replace(/^\.?\//, '')
|
|
778
|
+
// export const removeTrailingSearch = (str = '') => str.replace(/\?[\s\S]*$/, '')
|
|
779
|
+
declare const addLeadingSlash: (url?: string) => string;
|
|
780
|
+
declare const hasBasename: (path?: string, prefix?: string) => boolean;
|
|
781
|
+
declare const stripBasename: (path?: string, prefix?: string) => string;
|
|
782
|
+
declare const stripTrailing: (str?: string) => string;
|
|
783
|
+
declare const stripSuffix: (path?: string, suffix?: string) => string;
|
|
784
|
+
declare const getHomePage: (path?: string, basename?: string, customRoutes?: Record<string, string | string[]>, entryPagePath?: string) => string;
|
|
785
|
+
declare const getCurrentPage: (routerMode?: string, basename?: string) => string;
|
|
786
|
+
declare function handlePolyfill(): void;
|
|
780
787
|
export { hooks } from '@tarojs/shared';
|
|
781
|
-
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource,
|
|
788
|
+
export { document, getComputedStyle, History, Location, nav as navigator, _caf as cancelAnimationFrame, now, _raf as requestAnimationFrame, parseUrl, URL, URLSearchParams, history, location, window, TaroElement, createEvent, eventHandler, TaroEvent, FormElement, TaroNode, TaroRootElement, Style, SVGElement, TaroText, MutationObserver, env, PROPERTY_THRESHOLD, TARO_RUNTIME, HOOKS_APP_ID, SET_DATA, PAGE_INIT, ROOT_STR, HTML, HEAD, BODY, APP, CONTAINER, DOCUMENT_ELEMENT_NAME, DOCUMENT_FRAGMENT, ID, UID, CLASS, STYLE, FOCUS, VIEW, STATIC_VIEW, PURE_VIEW, PROPS, DATASET, OBJECT, VALUE, INPUT, CHANGE, CUSTOM_WRAPPER, TARGET, CURRENT_TARGET, TYPE, CONFIRM, TIME_STAMP, KEY_CODE, TOUCHMOVE, DATE, SET_TIMEOUT, COMPILE_MODE, CATCHMOVE, CATCH_VIEW, COMMENT, ON_LOAD, ON_READY, ON_SHOW, ON_HIDE, OPTIONS, EXTERNAL_CLASSES, EVENT_CALLBACK_RESULT, BEHAVIORS, A, CONTEXT_ACTIONS, Current, getCurrentInstance, eventSource, createComponentConfig, createPageConfig, createRecursiveComponentConfig, getOnHideEventKey, getOnReadyEventKey, getOnShowEventKey, getPageInstance, getPath, injectPageInstance, removePageInstance, safeExecute, stringify, EventsType, eventCenter, Events, hydrate, nextTick, options, incrementId, isHasExtractProp, addLeadingSlash, hasBasename, stripBasename, stripTrailing, stripSuffix, getHomePage, getCurrentPage, Instance, VueAppInstance, VueInstance, PageProps, ReactPageComponent, ReactPageInstance, ReactAppInstance, PageLifeCycle, PageInstance, AppInstance, Attributes, EventOptions, MpEvent, EventListenerOptions, AddEventListenerOptions, EventHandler, MpInstance, MiniElementData, MiniTextData, MiniData, HydratedData, UpdatePayloadValue, DataTree, UpdatePayload, Options$1 as Options, TFunc, PageConfig, handlePolyfill };
|