@dcloudio/types
Advanced tools
Comparing version 3.2.3 to 3.2.4
{ | ||
"name": "@dcloudio/types", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"description": "uni-app types", | ||
@@ -5,0 +5,0 @@ "typings": "index.d.ts", |
@@ -1,22 +0,25 @@ | ||
interface GeneralCallbackResult { | ||
/** | ||
* 错误信息 | ||
*/ | ||
errMsg: string; | ||
} | ||
declare global { | ||
namespace UniNamespace { | ||
interface GeneralCallbackResult { | ||
/** | ||
* 错误信息 | ||
*/ | ||
errMsg: string; | ||
} | ||
/** | ||
* 小程序错误事件的监听函数 | ||
*/ | ||
export type OnAppErrorCallback = ( | ||
/** 错误信息,包含堆栈 */ | ||
error: string | ||
) => void; | ||
/** | ||
* 小程序错误事件的监听函数 | ||
*/ | ||
type OnAppErrorCallback = ( | ||
/** 错误信息,包含堆栈 */ | ||
error: string | ||
) => void; | ||
/** | ||
* onError 传入的监听函数。不传此参数则移除所有监听函数。 | ||
*/ | ||
type OffAppErrorCallback = (res: GeneralCallbackResult) => void; | ||
} | ||
} | ||
/** | ||
* onError 传入的监听函数。不传此参数则移除所有监听函数。 | ||
*/ | ||
export type OffAppErrorCallback = (res: GeneralCallbackResult) => void; | ||
/** | ||
* | ||
@@ -31,3 +34,3 @@ * 需要基础库: `2.1.2` | ||
*/ | ||
export function onError(listener: OnAppErrorCallback): void; | ||
export function onError(listener: UniNamespace.OnAppErrorCallback): void; | ||
@@ -45,4 +48,2 @@ /** | ||
*/ | ||
export function offError(listener?: OffAppErrorCallback): void; | ||
export {}; | ||
export function offError(listener?: UniNamespace.OffAppErrorCallback): void; |
import { | ||
OnThemeChangeCallbackResult as OnMemoryWarningCallbackResult1, | ||
OnThemeChangeCallback as OnMemoryWarningCallback1, | ||
onThemeChange, | ||
@@ -8,4 +6,2 @@ offThemeChange, | ||
import { | ||
OnUnhandledRejectionCallbackResult as OnUnhandledRejectionCallbackResult1, | ||
OnUnhandledRejectionCallback as OnUnhandledRejectionCallback1, | ||
onUnhandledRejection, | ||
@@ -16,17 +12,11 @@ offUnhandledRejection, | ||
import { | ||
OnAppErrorCallback as OnAppErrorCallback1, | ||
OffAppErrorCallback as OffAppErrorCallback1, | ||
onError as onError1, | ||
offError as offError1, | ||
onError, | ||
offError | ||
} from './Error'; | ||
import { | ||
createMapContext | ||
} from './MapContext'; | ||
declare global { | ||
namespace UniNamespace { | ||
type OnThemeChangeCallbackResult = OnMemoryWarningCallbackResult1; | ||
type OnThemeChangeCallback = OnMemoryWarningCallback1; | ||
type OnUnhandledRejectionCallbackResult = OnUnhandledRejectionCallbackResult1; | ||
type OnUnhandledRejectionCallback = OnUnhandledRejectionCallback1; | ||
type OnAppErrorCallback = OnAppErrorCallback1; | ||
type OffAppErrorCallback = OffAppErrorCallback1; | ||
} | ||
interface Uni { | ||
@@ -37,5 +27,6 @@ onThemeChange: typeof onThemeChange; | ||
offUnhandledRejection: typeof offUnhandledRejection; | ||
onError: typeof onError1; | ||
offError: typeof offError1; | ||
onError: typeof onError; | ||
offError: typeof offError; | ||
createMapContext: typeof createMapContext; | ||
} | ||
} |
@@ -1,9 +0,12 @@ | ||
export interface OnThemeChangeCallbackResult { | ||
/** | ||
* 主题名称 | ||
*/ | ||
theme: 'dark' | 'light'; | ||
declare global { | ||
namespace UniNamespace { | ||
interface OnThemeChangeCallbackResult { | ||
/** | ||
* 主题名称 | ||
*/ | ||
theme: 'dark' | 'light'; | ||
} | ||
type OnThemeChangeCallback = (res: OnThemeChangeCallbackResult) => void; | ||
} | ||
} | ||
export type OnThemeChangeCallback = (res: OnThemeChangeCallbackResult) => void; | ||
/** | ||
@@ -14,3 +17,3 @@ * 监听系统主题状态变化。 | ||
*/ | ||
export function onThemeChange(callback: OnThemeChangeCallback): void; | ||
export function onThemeChange(callback: UniNamespace.OnThemeChangeCallback): void; | ||
/** | ||
@@ -21,2 +24,2 @@ * 取消监听系统主题状态变化。 | ||
*/ | ||
export function offThemeChange(callback: OnThemeChangeCallback): void; | ||
export function offThemeChange(callback: UniNamespace.OnThemeChangeCallback): void; |
@@ -1,17 +0,22 @@ | ||
export interface OnUnhandledRejectionCallbackResult { | ||
/** | ||
* 被拒绝的 Promise 对象 | ||
*/ | ||
promise: Promise<any>; | ||
/** | ||
* 拒绝原因,一般是一个 Error 对象 | ||
*/ | ||
reason: string; | ||
declare global { | ||
namespace UniNamespace { | ||
interface OnUnhandledRejectionCallbackResult { | ||
/** | ||
* 被拒绝的 Promise 对象 | ||
*/ | ||
promise: Promise<any>; | ||
/** | ||
* 拒绝原因,一般是一个 Error 对象 | ||
*/ | ||
reason: string; | ||
} | ||
/** | ||
* 未处理的 Promise 拒绝事件的回调函数 | ||
*/ | ||
type OnUnhandledRejectionCallback = (result: OnUnhandledRejectionCallbackResult) => void; | ||
} | ||
} | ||
/** | ||
* 未处理的 Promise 拒绝事件的回调函数 | ||
*/ | ||
export type OnUnhandledRejectionCallback = (result: OnUnhandledRejectionCallbackResult) => void; | ||
/** | ||
* 监听未处理的 Promise 拒绝事件。该事件与 `App.onUnhandledRejection` 的回调时机与参数一致。 | ||
@@ -29,3 +34,3 @@ * | ||
*/ | ||
export function onUnhandledRejection(callback: OnUnhandledRejectionCallback): void; | ||
export function onUnhandledRejection(callback: UniNamespace.OnUnhandledRejectionCallback): void; | ||
@@ -39,2 +44,2 @@ /** | ||
*/ | ||
export function offUnhandledRejection(callback: OnUnhandledRejectionCallback): void; | ||
export function offUnhandledRejection(callback: UniNamespace.OnUnhandledRejectionCallback): void; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1912184
25
47774