Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dcloudio/types

Package Overview
Dependencies
Maintainers
9
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcloudio/types - npm Package Compare versions

Comparing version 3.2.3 to 3.2.4

uni-app/uni/base/MapContext.d.ts

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc