@dcloudio/uni-app-x 0.2.0 → 0.4.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.
- package/.env +2 -0
- package/index.d.ts +1 -2
- package/package.json +15 -2
- package/types/index.d.ts +4 -0
- package/{native → types/native}/CustomEvent.d.ts +6 -0
- package/types/native/DrawableContext.d.ts +46 -0
- package/{native → types/native}/IPageManager.d.ts +3 -0
- package/types/native/RefresherEvent.d.ts +10 -0
- package/{native → types/native}/ResizeEvent.d.ts +2 -0
- package/types/native/ScrollEvent.d.ts +15 -0
- package/types/native/ScrollToLowerEvent.d.ts +10 -0
- package/types/native/ScrollToUpperEvent.d.ts +10 -0
- package/{native → types/native}/index.d.ts +4 -1
- package/types/uni/base/index.d.ts +3 -0
- package/types/uni/core/index.d.ts +9 -0
- package/types/uni/core/lib/base/event/index.d.ts +15 -0
- package/types/uni/core/lib/base/event/interface.d.ts +40 -0
- package/types/uni/core/lib/interface.d.ts +16 -0
- package/types/uni/core/lib/lifecycle/index.d.ts +9 -0
- package/types/uni/core/lib/lifecycle/interface.d.ts +12 -0
- package/types/uni/core/lib/route/index.d.ts +65 -0
- package/types/uni/core/lib/route/interface.d.ts +208 -0
- package/types/uni/core/lib/ui/create-selector-query/index.d.ts +15 -0
- package/types/uni/core/lib/ui/create-selector-query/interface.d.ts +172 -0
- package/types/uni/core/lib/ui/load-font-face/index.d.ts +25 -0
- package/types/uni/core/lib/ui/load-font-face/interface.d.ts +59 -0
- package/types/uni/core/lib/ui/page-scroll-to/index.d.ts +23 -0
- package/types/uni/core/lib/ui/page-scroll-to/interface.d.ts +52 -0
- package/types/uni/core/lib/ui/pull-down-refresh/index.d.ts +25 -0
- package/types/uni/core/lib/ui/pull-down-refresh/interface.d.ts +52 -0
- package/types/uni/core/lib/ui/set-navigation-bar-color/index.d.ts +23 -0
- package/types/uni/core/lib/ui/set-navigation-bar-color/interface.d.ts +56 -0
- package/types/uni/core/lib/ui/tab-bar/index.d.ts +145 -0
- package/types/uni/core/lib/ui/tab-bar/interface.d.ts +442 -0
- package/types/uni/ext/index.d.ts +19 -0
- package/types/uni/ext/lib/uni-audio/utssdk/index.d.ts +13 -0
- package/types/uni/ext/lib/uni-audio/utssdk/interface.d.ts +804 -0
- package/types/uni/ext/lib/uni-exit/utssdk/index.d.ts +19 -0
- package/types/uni/ext/lib/uni-exit/utssdk/interface.d.ts +63 -0
- package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +33 -0
- package/types/uni/ext/lib/uni-file-manager/utssdk/interface.d.ts +132 -0
- package/types/uni/ext/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +9 -0
- package/types/uni/ext/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +31 -0
- package/types/uni/ext/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +11 -0
- package/types/uni/ext/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +135 -0
- package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/index.d.ts +13 -0
- package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +120 -0
- package/types/uni/ext/lib/uni-getDeviceInfo/utssdk/index.d.ts +13 -0
- package/types/uni/ext/lib/uni-getDeviceInfo/utssdk/interface.d.ts +144 -0
- package/types/uni/ext/lib/uni-getLocation-system/utssdk/index.d.ts +15 -0
- package/types/uni/ext/lib/uni-getLocation-system/utssdk/interface.d.ts +99 -0
- package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/index.d.ts +15 -0
- package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/interface.d.ts +93 -0
- package/types/uni/ext/lib/uni-getNetworkType/utssdk/index.d.ts +23 -0
- package/types/uni/ext/lib/uni-getNetworkType/utssdk/interface.d.ts +67 -0
- package/types/uni/ext/lib/uni-getRecorderManager/utssdk/index.d.ts +13 -0
- package/types/uni/ext/lib/uni-getRecorderManager/utssdk/interface.d.ts +213 -0
- package/types/uni/ext/lib/uni-getSystemInfo/utssdk/index.d.ts +29 -0
- package/types/uni/ext/lib/uni-getSystemInfo/utssdk/interface.d.ts +517 -0
- package/types/uni/ext/lib/uni-getSystemSetting/utssdk/index.d.ts +11 -0
- package/types/uni/ext/lib/uni-getSystemSetting/utssdk/interface.d.ts +61 -0
- package/types/uni/ext/lib/uni-media/utssdk/index.d.ts +93 -0
- package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +877 -0
- package/types/uni/ext/lib/uni-network/utssdk/index.d.ts +61 -0
- package/types/uni/ext/lib/uni-network/utssdk/interface.d.ts +569 -0
- package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +23 -0
- package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +67 -0
- package/types/uni/ext/lib/uni-prompt/utssdk/index.d.ts +69 -0
- package/types/uni/ext/lib/uni-prompt/utssdk/interface.d.ts +686 -0
- package/types/uni/ext/lib/uni-storage/utssdk/index.d.ts +87 -0
- package/types/uni/ext/lib/uni-storage/utssdk/interface.d.ts +575 -0
- package/types/uni/ext/lib/uni-websocket/utssdk/index.d.ts +49 -0
- package/types/uni/ext/lib/uni-websocket/utssdk/interface.d.ts +511 -0
- package/types/uni/index.d.ts +3 -0
- package/types/uni-cloud/index.d.ts +274 -0
- package/{vue → types/vue}/CheckboxGroupChangeEvent.d.ts +9 -3
- package/types/vue/PickerViewChangeEvent.d.ts +16 -0
- package/types/vue/ProgressActiveendEvent.d.ts +16 -0
- package/types/vue/RadioGroupChangeEvent.d.ts +16 -0
- package/types/vue/SliderChangeEvent.d.ts +16 -0
- package/types/vue/SwitchChangeEvent.d.ts +16 -0
- package/types/vue/index.d.ts +6 -0
- package/vue/index.d.ts +0 -1
- /package/{native → types/native}/Event.d.ts +0 -0
- /package/{native → types/native}/IApp.d.ts +0 -0
- /package/{native → types/native}/IDocument.d.ts +0 -0
- /package/{native → types/native}/INode.d.ts +0 -0
- /package/{native → types/native}/IPage.d.ts +0 -0
- /package/{native → types/native}/ITabsNode.d.ts +0 -0
- /package/{native → types/native}/MouseEvent.d.ts +0 -0
- /package/{native → types/native}/NodeData.d.ts +0 -0
- /package/{native → types/native}/PageEvent.d.ts +0 -0
- /package/{native → types/native}/PageScrollEvent.d.ts +0 -0
- /package/{native → types/native}/TabTapEvent.d.ts +0 -0
- /package/{native → types/native}/TouchEvent.d.ts +0 -0
- /package/{native → types/native}/UniAppManager.d.ts +0 -0
package/.env
ADDED
package/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/// <reference path='./
|
|
2
|
-
/// <reference path='./vue/index.d.ts' />
|
|
1
|
+
/// <reference path='./types/index.d.ts' />
|
package/package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-app-x",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "uni-app x types",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"author": "DCloud",
|
|
7
|
-
"license": "Apache-2.0"
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build:types:core": "node ./scripts/build-types.js -t core",
|
|
11
|
+
"build:types:ext": "node ./scripts/build-types.js -t ext",
|
|
12
|
+
"build:types": "npm run build:types:core && npm run build:types:ext"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"delete": "^1.1.0",
|
|
16
|
+
"dotenv": "^16.3.1",
|
|
17
|
+
"fs-extra": "^11.1.1",
|
|
18
|
+
"glob": "^10.3.3",
|
|
19
|
+
"minimist": "^1.2.8"
|
|
20
|
+
}
|
|
8
21
|
}
|
package/types/index.d.ts
ADDED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/// <reference path="./Event.d.ts" />
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @package io.dcloud.uniapp.runtime
|
|
5
|
+
*/
|
|
3
6
|
declare class CustomEventOptions<T>{
|
|
4
7
|
detail: T
|
|
5
8
|
constructor (detail: T)
|
|
6
9
|
}
|
|
7
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @package io.dcloud.uniapp.runtime
|
|
13
|
+
*/
|
|
8
14
|
declare class CustomEvent<T> extends Event {
|
|
9
15
|
constructor (type: string, options: CustomEventOptions<T>)
|
|
10
16
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference path='./INode.d.ts' />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @package io.dcloud.uniapp.runtime
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
declare class DrawableContext {
|
|
8
|
+
font : string
|
|
9
|
+
fillStyle : string
|
|
10
|
+
lineCap : string
|
|
11
|
+
lineDashOffset : number
|
|
12
|
+
lineJoin : string
|
|
13
|
+
lineWidth : number
|
|
14
|
+
strokeStyle : string
|
|
15
|
+
textAlign : string
|
|
16
|
+
|
|
17
|
+
beginPath() : void
|
|
18
|
+
|
|
19
|
+
arc(x : number, y : number, radius : number, startAngle : number, endAngle : number, anticlockwise ?: boolean) : void
|
|
20
|
+
|
|
21
|
+
moveTo(x : number, y : number) : void
|
|
22
|
+
|
|
23
|
+
rect(x : number, y : number, width : number, height : number) : void
|
|
24
|
+
|
|
25
|
+
lineTo(x : number, y : number) : void
|
|
26
|
+
|
|
27
|
+
closePath() : void
|
|
28
|
+
|
|
29
|
+
stroke() : void
|
|
30
|
+
|
|
31
|
+
strokeRect(x : number, y : number, width : number, height : number) : void
|
|
32
|
+
|
|
33
|
+
strokeText(text : string, x : number, y : number) : void
|
|
34
|
+
|
|
35
|
+
fill(fillRule ?: string) : void
|
|
36
|
+
|
|
37
|
+
fillRect(x : number, y : number, width : number, height : number) : void
|
|
38
|
+
|
|
39
|
+
fillText(text : string, x : number, y : number) : void
|
|
40
|
+
|
|
41
|
+
reset() : void
|
|
42
|
+
|
|
43
|
+
update() : void
|
|
44
|
+
|
|
45
|
+
setLineDash(segments : Array<number>) : void
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference path='./Event.d.ts' />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @package io.dcloud.uniapp.runtime
|
|
5
|
+
*/
|
|
6
|
+
declare class ScrollEvent extends Event {
|
|
7
|
+
detail: {
|
|
8
|
+
scrollTop: number
|
|
9
|
+
scrollLeft: number
|
|
10
|
+
scrollHeight: number
|
|
11
|
+
scrollWidth: number
|
|
12
|
+
deltaY: number
|
|
13
|
+
deltaX: number
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference path='./CustomEvent.d.ts' />
|
|
2
2
|
/// <reference path='./Event.d.ts' />
|
|
3
|
-
/// <reference path='./Event.d.ts' />
|
|
4
3
|
/// <reference path='./IApp.d.ts' />
|
|
5
4
|
/// <reference path='./IDocument.d.ts' />
|
|
6
5
|
/// <reference path='./INode.d.ts' />
|
|
@@ -11,7 +10,11 @@
|
|
|
11
10
|
/// <reference path='./NodeData.d.ts' />
|
|
12
11
|
/// <reference path='./PageEvent.d.ts' />
|
|
13
12
|
/// <reference path='./PageScrollEvent.d.ts' />
|
|
13
|
+
/// <reference path='./RefresherEvent.d.ts' />
|
|
14
14
|
/// <reference path='./ResizeEvent.d.ts' />
|
|
15
|
+
/// <reference path='./ScrollEvent.d.ts' />
|
|
16
|
+
/// <reference path='./ScrollToLowerEvent.d.ts' />
|
|
17
|
+
/// <reference path='./ScrollToUpperEvent.d.ts' />
|
|
15
18
|
/// <reference path='./TabTapEvent.d.ts' />
|
|
16
19
|
/// <reference path='./TouchEvent.d.ts' />
|
|
17
20
|
/// <reference path='./UniAppManager.d.ts' />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference path='./lib/base/event/index.d.ts' />
|
|
2
|
+
/// <reference path='./lib/lifecycle/index.d.ts' />
|
|
3
|
+
/// <reference path='./lib/route/index.d.ts' />
|
|
4
|
+
/// <reference path='./lib/ui/create-selector-query/index.d.ts' />
|
|
5
|
+
/// <reference path='./lib/ui/load-font-face/index.d.ts' />
|
|
6
|
+
/// <reference path='./lib/ui/page-scroll-to/index.d.ts' />
|
|
7
|
+
/// <reference path='./lib/ui/pull-down-refresh/index.d.ts' />
|
|
8
|
+
/// <reference path='./lib/ui/set-navigation-bar-color/index.d.ts' />
|
|
9
|
+
/// <reference path='./lib/ui/tab-bar/index.d.ts' />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
$On as $OnOrigin,
|
|
3
|
+
$Once as $OnceOrigin,
|
|
4
|
+
$Off as $OffOrigin,
|
|
5
|
+
$Emit as $EmitOrigin,
|
|
6
|
+
Uni as UniOrigin
|
|
7
|
+
} from './interface'
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
type $On = $OnOrigin
|
|
11
|
+
type $Once = $OnceOrigin
|
|
12
|
+
type $Off = $OffOrigin
|
|
13
|
+
type $Emit = $EmitOrigin
|
|
14
|
+
interface Uni extends UniOrigin { }
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @ts-expect-error
|
|
2
|
+
type AnyCallback = Function<unknown>
|
|
3
|
+
|
|
4
|
+
type $OnCallback = AnyCallback
|
|
5
|
+
export type $On = (eventName: string, callback: $OnCallback) => void
|
|
6
|
+
|
|
7
|
+
type $OnceCallback = AnyCallback
|
|
8
|
+
export type $Once = (eventName: string, callback: $OnceCallback) => void
|
|
9
|
+
|
|
10
|
+
type $OffCallback = AnyCallback
|
|
11
|
+
export type $Off = (eventName: string, callback: $OffCallback) => void
|
|
12
|
+
|
|
13
|
+
export type $Emit = (eventName: string, args: any | null) => void
|
|
14
|
+
|
|
15
|
+
export interface Uni {
|
|
16
|
+
/**
|
|
17
|
+
* 监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。
|
|
18
|
+
*
|
|
19
|
+
* @tutorial http://uniapp.dcloud.io/api/window/communication?id=on
|
|
20
|
+
*/
|
|
21
|
+
$on: $On
|
|
22
|
+
/**
|
|
23
|
+
* 移除自定义事件监听器。如果没有指定事件名,则移除所有事件监听器。如果提供事件名,则移除该事件的所有监听器。如果提供了事件名和回调,则只移除这个回调的监听器。
|
|
24
|
+
*
|
|
25
|
+
* @tutorial http://uniapp.dcloud.io/api/window/communication?id=off
|
|
26
|
+
*/
|
|
27
|
+
$off: $Off
|
|
28
|
+
/**
|
|
29
|
+
* 监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。
|
|
30
|
+
*
|
|
31
|
+
* @tutorial http://uniapp.dcloud.io/api/window/communication?id=once
|
|
32
|
+
*/
|
|
33
|
+
$once: $Once
|
|
34
|
+
/**
|
|
35
|
+
* 触发自定义事件,附加的参数会传递给事件监听器。
|
|
36
|
+
*
|
|
37
|
+
* @tutorial http://uniapp.dcloud.io/api/window/communication?id=emit
|
|
38
|
+
*/
|
|
39
|
+
$emit: $Emit
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AsyncApiResult {
|
|
2
|
+
errMsg: string
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface AsyncApiSuccessResult extends AsyncApiResult {}
|
|
6
|
+
|
|
7
|
+
export interface UniError extends AsyncApiResult {
|
|
8
|
+
errCode: number
|
|
9
|
+
errSubject: string
|
|
10
|
+
data: any | null
|
|
11
|
+
cause: any | null
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type OnLaunchOptions = {
|
|
15
|
+
path: string
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OnLaunchOptions } from '../interface'
|
|
2
|
+
|
|
3
|
+
export type GetLaunchOptionsSync = () => OnLaunchOptions
|
|
4
|
+
|
|
5
|
+
export interface Uni {
|
|
6
|
+
/**
|
|
7
|
+
* 获取本次启动时的参数。返回值与App.onLaunch的回调参数一致
|
|
8
|
+
*
|
|
9
|
+
* @tutorial http://uniapp.dcloud.io/api/plugins/getLaunchOptionsSync
|
|
10
|
+
*/
|
|
11
|
+
getLaunchOptionsSync: GetLaunchOptionsSync
|
|
12
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NavigateTo as NavigateToOrigin,
|
|
3
|
+
EventChannel as EventChannelOrigin,
|
|
4
|
+
NavigateToSuccess as NavigateToSuccessOrigin,
|
|
5
|
+
NavigateToFail as NavigateToFailOrigin,
|
|
6
|
+
NavigateToComplete as NavigateToCompleteOrigin,
|
|
7
|
+
NavigateToOptions as NavigateToOptionsOrigin,
|
|
8
|
+
RedirectTo as RedirectToOrigin,
|
|
9
|
+
RedirectToSuccess as RedirectToSuccessOrigin,
|
|
10
|
+
RedirectToFail as RedirectToFailOrigin,
|
|
11
|
+
RedirectToComplete as RedirectToCompleteOrigin,
|
|
12
|
+
RedirectToOptions as RedirectToOptionsOrigin,
|
|
13
|
+
ReLaunch as ReLaunchOrigin,
|
|
14
|
+
ReLaunchSuccess as ReLaunchSuccessOrigin,
|
|
15
|
+
ReLaunchFail as ReLaunchFailOrigin,
|
|
16
|
+
ReLaunchComplete as ReLaunchCompleteOrigin,
|
|
17
|
+
ReLaunchOptions as ReLaunchOptionsOrigin,
|
|
18
|
+
SwitchTab as SwitchTabOrigin,
|
|
19
|
+
SwitchTabSuccess as SwitchTabSuccessOrigin,
|
|
20
|
+
SwitchTabSuccessCallback as SwitchTabSuccessCallbackOrigin,
|
|
21
|
+
SwitchTabFail as SwitchTabFailOrigin,
|
|
22
|
+
SwitchTabFailCallback as SwitchTabFailCallbackOrigin,
|
|
23
|
+
SwitchTabComplete as SwitchTabCompleteOrigin,
|
|
24
|
+
SwitchTabCompleteCallback as SwitchTabCompleteCallbackOrigin,
|
|
25
|
+
SwitchTabOptions as SwitchTabOptionsOrigin,
|
|
26
|
+
NavigateBack as NavigateBackOrigin,
|
|
27
|
+
NavigateBackSuccess as NavigateBackSuccessOrigin,
|
|
28
|
+
NavigateBackFail as NavigateBackFailOrigin,
|
|
29
|
+
NavigateBackComplete as NavigateBackCompleteOrigin,
|
|
30
|
+
NavigateBackOptions as NavigateBackOptionsOrigin,
|
|
31
|
+
Uni as UniOrigin
|
|
32
|
+
} from './interface'
|
|
33
|
+
|
|
34
|
+
declare global {
|
|
35
|
+
type NavigateTo = NavigateToOrigin
|
|
36
|
+
type EventChannel = EventChannelOrigin
|
|
37
|
+
type NavigateToSuccess = NavigateToSuccessOrigin
|
|
38
|
+
type NavigateToFail = NavigateToFailOrigin
|
|
39
|
+
type NavigateToComplete = NavigateToCompleteOrigin
|
|
40
|
+
type NavigateToOptions = NavigateToOptionsOrigin
|
|
41
|
+
type RedirectTo = RedirectToOrigin
|
|
42
|
+
type RedirectToSuccess = RedirectToSuccessOrigin
|
|
43
|
+
type RedirectToFail = RedirectToFailOrigin
|
|
44
|
+
type RedirectToComplete = RedirectToCompleteOrigin
|
|
45
|
+
type RedirectToOptions = RedirectToOptionsOrigin
|
|
46
|
+
type ReLaunch = ReLaunchOrigin
|
|
47
|
+
type ReLaunchSuccess = ReLaunchSuccessOrigin
|
|
48
|
+
type ReLaunchFail = ReLaunchFailOrigin
|
|
49
|
+
type ReLaunchComplete = ReLaunchCompleteOrigin
|
|
50
|
+
type ReLaunchOptions = ReLaunchOptionsOrigin
|
|
51
|
+
type SwitchTab = SwitchTabOrigin
|
|
52
|
+
type SwitchTabSuccess = SwitchTabSuccessOrigin
|
|
53
|
+
type SwitchTabSuccessCallback = SwitchTabSuccessCallbackOrigin
|
|
54
|
+
type SwitchTabFail = SwitchTabFailOrigin
|
|
55
|
+
type SwitchTabFailCallback = SwitchTabFailCallbackOrigin
|
|
56
|
+
type SwitchTabComplete = SwitchTabCompleteOrigin
|
|
57
|
+
type SwitchTabCompleteCallback = SwitchTabCompleteCallbackOrigin
|
|
58
|
+
type SwitchTabOptions = SwitchTabOptionsOrigin
|
|
59
|
+
type NavigateBack = NavigateBackOrigin
|
|
60
|
+
type NavigateBackSuccess = NavigateBackSuccessOrigin
|
|
61
|
+
type NavigateBackFail = NavigateBackFailOrigin
|
|
62
|
+
type NavigateBackComplete = NavigateBackCompleteOrigin
|
|
63
|
+
type NavigateBackOptions = NavigateBackOptionsOrigin
|
|
64
|
+
interface Uni extends UniOrigin { }
|
|
65
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { AsyncApiResult, AsyncApiSuccessResult, UniError } from '../interface'
|
|
2
|
+
|
|
3
|
+
export type NavigateTo = (options: NavigateToOptions) => void
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @tutorial http://uniapp.dcloud.io/api/router.html#event-channel
|
|
7
|
+
*/
|
|
8
|
+
export type EventChannel = {}
|
|
9
|
+
export type NavigateToSuccess = AsyncApiSuccessResult
|
|
10
|
+
type NavigateToSuccessCallback = (result: NavigateToSuccess) => void
|
|
11
|
+
export type NavigateToFail = UniError
|
|
12
|
+
|
|
13
|
+
type NavigateToFailCallback = (result: NavigateToFail) => void
|
|
14
|
+
export type NavigateToComplete = AsyncApiResult
|
|
15
|
+
type NavigateToCompleteCallback = (result: NavigateToComplete) => void
|
|
16
|
+
export type NavigateToOptions = {
|
|
17
|
+
/**
|
|
18
|
+
* 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数
|
|
19
|
+
*/
|
|
20
|
+
url: string
|
|
21
|
+
/**
|
|
22
|
+
* 窗口显示的动画类型
|
|
23
|
+
* - auto: 自动选择动画效果
|
|
24
|
+
* - none: 无动画效果
|
|
25
|
+
* - slide-in-right: 从右侧横向滑动效果
|
|
26
|
+
* - slide-in-left: 左侧横向滑动效果
|
|
27
|
+
* - slide-in-top: 从上侧竖向滑动效果
|
|
28
|
+
* - slide-in-bottom: 从下侧竖向滑动效果
|
|
29
|
+
* - fade-in: 从透明到不透明逐渐显示效果
|
|
30
|
+
* - zoom-out: 从小到大逐渐放大显示效果
|
|
31
|
+
* - zoom-fade-out: 从小到大逐渐放大并且从透明到不透明逐渐显示效果
|
|
32
|
+
* - pop-in: 从右侧平移入栈动画效果
|
|
33
|
+
* - UnionType => 'auto' | 'none' | 'slide-in-right' | 'slide-in-left' | 'slide-in-top' | 'slide-in-bottom' | 'fade-in' | 'zoom-out' | 'zoom-fade-out' | 'pop-in'
|
|
34
|
+
*/
|
|
35
|
+
animationType?: string | null
|
|
36
|
+
/**
|
|
37
|
+
* 窗口显示动画的持续时间,单位为 ms
|
|
38
|
+
*/
|
|
39
|
+
animationDuration?: number | null
|
|
40
|
+
/**
|
|
41
|
+
* 页面间通信接口,用于监听被打开页面发送到当前页面的数据
|
|
42
|
+
*/
|
|
43
|
+
events?: any | null
|
|
44
|
+
/**
|
|
45
|
+
* 接口调用成功的回调函数
|
|
46
|
+
*/
|
|
47
|
+
success?: NavigateToSuccessCallback | null
|
|
48
|
+
/**
|
|
49
|
+
* 接口调用失败的回调函数
|
|
50
|
+
*/
|
|
51
|
+
fail?: NavigateToFailCallback | null
|
|
52
|
+
/**
|
|
53
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
54
|
+
*/
|
|
55
|
+
complete?: NavigateToCompleteCallback | null
|
|
56
|
+
}
|
|
57
|
+
export type RedirectTo = (options: RedirectToOptions) => void
|
|
58
|
+
export type RedirectToSuccess = AsyncApiSuccessResult
|
|
59
|
+
type RedirectToSuccessCallback = (result: AsyncApiSuccessResult) => void
|
|
60
|
+
export type RedirectToFail = UniError
|
|
61
|
+
type RedirectToFailCallback = (result: RedirectToFail) => void
|
|
62
|
+
export type RedirectToComplete = AsyncApiResult
|
|
63
|
+
type RedirectToCompleteCallback = (result: RedirectToComplete) => void
|
|
64
|
+
export type RedirectToOptions = {
|
|
65
|
+
/**
|
|
66
|
+
* 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数
|
|
67
|
+
*/
|
|
68
|
+
url: string
|
|
69
|
+
/**
|
|
70
|
+
* 接口调用成功的回调函数
|
|
71
|
+
*/
|
|
72
|
+
success?: RedirectToSuccessCallback | null
|
|
73
|
+
/**
|
|
74
|
+
* 接口调用失败的回调函数
|
|
75
|
+
*/
|
|
76
|
+
fail?: RedirectToFailCallback | null
|
|
77
|
+
/**
|
|
78
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
79
|
+
*/
|
|
80
|
+
complete?: RedirectToCompleteCallback | null
|
|
81
|
+
}
|
|
82
|
+
export type ReLaunch = (options: ReLaunchOptions) => void
|
|
83
|
+
export type ReLaunchSuccess = AsyncApiSuccessResult
|
|
84
|
+
type ReLaunchSuccessCallback = (result: ReLaunchSuccess) => void
|
|
85
|
+
export type ReLaunchFail = UniError
|
|
86
|
+
type ReLaunchFailCallback = (result: ReLaunchFail) => void
|
|
87
|
+
export type ReLaunchComplete = AsyncApiResult
|
|
88
|
+
type ReLaunchCompleteCallback = (result: ReLaunchComplete) => void
|
|
89
|
+
export type ReLaunchOptions = {
|
|
90
|
+
/**
|
|
91
|
+
* 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数
|
|
92
|
+
*/
|
|
93
|
+
url: string
|
|
94
|
+
/**
|
|
95
|
+
* 接口调用成功的回调函数
|
|
96
|
+
*/
|
|
97
|
+
success?: ReLaunchSuccessCallback | null
|
|
98
|
+
/**
|
|
99
|
+
* 接口调用失败的回调函数
|
|
100
|
+
*/
|
|
101
|
+
fail?: ReLaunchFailCallback | null
|
|
102
|
+
/**
|
|
103
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
104
|
+
*/
|
|
105
|
+
complete?: ReLaunchCompleteCallback | null
|
|
106
|
+
}
|
|
107
|
+
export type SwitchTab = (options: SwitchTabOptions) => void
|
|
108
|
+
export type SwitchTabSuccess = AsyncApiSuccessResult
|
|
109
|
+
export type SwitchTabSuccessCallback = (result: SwitchTabSuccess) => void
|
|
110
|
+
export type SwitchTabFail = UniError
|
|
111
|
+
export type SwitchTabFailCallback = (result: SwitchTabFail) => void
|
|
112
|
+
export type SwitchTabComplete = AsyncApiResult
|
|
113
|
+
export type SwitchTabCompleteCallback = (result: SwitchTabComplete) => void
|
|
114
|
+
export type SwitchTabOptions = {
|
|
115
|
+
/**
|
|
116
|
+
* 需要跳转的 tabBar 页面的路径,路径后不能带参数
|
|
117
|
+
*/
|
|
118
|
+
url: string
|
|
119
|
+
/**
|
|
120
|
+
* 接口调用成功的回调函数
|
|
121
|
+
*/
|
|
122
|
+
success?: SwitchTabSuccessCallback | null
|
|
123
|
+
/**
|
|
124
|
+
* 接口调用失败的回调函数
|
|
125
|
+
*/
|
|
126
|
+
fail?: SwitchTabFailCallback | null
|
|
127
|
+
/**
|
|
128
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
129
|
+
*/
|
|
130
|
+
complete?: SwitchTabCompleteCallback | null
|
|
131
|
+
}
|
|
132
|
+
export type NavigateBack = (options: NavigateBackOptions) => void
|
|
133
|
+
export type NavigateBackSuccess = AsyncApiSuccessResult
|
|
134
|
+
type NavigateBackSuccessCallback = (result: NavigateBackSuccess) => void
|
|
135
|
+
export type NavigateBackFail = UniError
|
|
136
|
+
type NavigateBackFailCallback = (result: NavigateBackFail) => void
|
|
137
|
+
export type NavigateBackComplete = AsyncApiResult
|
|
138
|
+
type NavigateBackCompleteCallback = (result: NavigateBackComplete) => void
|
|
139
|
+
export type NavigateBackOptions = {
|
|
140
|
+
/**
|
|
141
|
+
* 返回的页面数,如果 delta 大于现有页面数,则返回到首页
|
|
142
|
+
*/
|
|
143
|
+
delta?: number | null
|
|
144
|
+
/**
|
|
145
|
+
* 窗口关闭的动画类型
|
|
146
|
+
* - auto: 自动选择动画效果
|
|
147
|
+
* - none: 无动画效果
|
|
148
|
+
* - slide-out-right: 横向向右侧滑出屏幕动画
|
|
149
|
+
* - slide-out-left: 横向向左侧滑出屏幕动画
|
|
150
|
+
* - slide-out-top: 竖向向上侧滑出屏幕动画
|
|
151
|
+
* - slide-out-bottom: 竖向向下侧滑出屏幕动画
|
|
152
|
+
* - fade-out: 从不透明到透明逐渐隐藏动画
|
|
153
|
+
* - zoom-in: 从大逐渐缩小关闭动画
|
|
154
|
+
* - zoom-fade-in: 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画
|
|
155
|
+
* - pop-out: 从右侧平移出栈动画效果
|
|
156
|
+
* - UnionType => 'auto' | 'none' | 'slide-out-right' | 'slide-out-left' | 'slide-out-top' | 'slide-out-bottom' | 'fade-out' | 'zoom-in' | 'zoom-fade-in' | 'pop-out'
|
|
157
|
+
*/
|
|
158
|
+
animationType?: string | null
|
|
159
|
+
/**
|
|
160
|
+
* 窗口关闭动画的持续时间,单位为 ms
|
|
161
|
+
*/
|
|
162
|
+
animationDuration?: number | null
|
|
163
|
+
/**
|
|
164
|
+
* 接口调用成功的回调函数
|
|
165
|
+
*/
|
|
166
|
+
success?: NavigateBackSuccessCallback | null
|
|
167
|
+
/**
|
|
168
|
+
* 接口调用失败的回调函数
|
|
169
|
+
*/
|
|
170
|
+
fail?: NavigateBackFailCallback | null
|
|
171
|
+
/**
|
|
172
|
+
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
|
173
|
+
*/
|
|
174
|
+
complete?: NavigateBackCompleteCallback | null
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface Uni {
|
|
178
|
+
/**
|
|
179
|
+
* 保留当前页面,跳转到应用内的某个页面
|
|
180
|
+
*
|
|
181
|
+
* @tutorial http://uniapp.dcloud.io/api/router?id=navigateto
|
|
182
|
+
*/
|
|
183
|
+
navigateTo: NavigateTo
|
|
184
|
+
/**
|
|
185
|
+
* 关闭当前页面,跳转到应用内的某个页面
|
|
186
|
+
*
|
|
187
|
+
* @tutorial http://uniapp.dcloud.io/api/router?id=redirectto
|
|
188
|
+
*/
|
|
189
|
+
redirectTo: RedirectTo
|
|
190
|
+
/**
|
|
191
|
+
* 关闭所有页面,打开到应用内的某个页面
|
|
192
|
+
*
|
|
193
|
+
* @tutorial http://uniapp.dcloud.io/api/router?id=relaunch
|
|
194
|
+
*/
|
|
195
|
+
reLaunch: ReLaunch
|
|
196
|
+
/**
|
|
197
|
+
* 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
|
|
198
|
+
*
|
|
199
|
+
* @tutorial http://uniapp.dcloud.io/api/router?id=switchtab
|
|
200
|
+
*/
|
|
201
|
+
switchTab: SwitchTab
|
|
202
|
+
/**
|
|
203
|
+
* 关闭当前页面,返回上一页面或多级页面
|
|
204
|
+
*
|
|
205
|
+
* @tutorial http://uniapp.dcloud.io/api/router?id=navigateback
|
|
206
|
+
*/
|
|
207
|
+
navigateBack: NavigateBack
|
|
208
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateSelectorQuery as CreateSelectorQueryOrigin,
|
|
3
|
+
SelectorQueryNodeInfoCallback as SelectorQueryNodeInfoCallbackOrigin,
|
|
4
|
+
NodeInfo as NodeInfoOrigin,
|
|
5
|
+
NodeField as NodeFieldOrigin,
|
|
6
|
+
Uni as UniOrigin
|
|
7
|
+
} from './interface'
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
type CreateSelectorQuery = CreateSelectorQueryOrigin
|
|
11
|
+
type SelectorQueryNodeInfoCallback = SelectorQueryNodeInfoCallbackOrigin
|
|
12
|
+
type NodeInfo = NodeInfoOrigin
|
|
13
|
+
type NodeField = NodeFieldOrigin
|
|
14
|
+
interface Uni extends UniOrigin { }
|
|
15
|
+
}
|