/** * uni.exit成功回调参数 */ export type ExitSuccess = { errMsg: string } /** * 错误码 * - 12001: 系统不支持 * - 12002: 未知错误 */ export type ExitErrorCode = 12001 | 12002 /** * uni.exit失败回调参数 */ export interface IExitError extends IUniError { errCode: ExitErrorCode } export type ExitFail = IExitError /** * uni.exit成功回调函数定义 */ export type ExitSuccessCallback = (res: ExitSuccess) => void /** * uni.exit失败回调函数定义 */ export type ExitFailCallback = (res: ExitFail) => void /** * uni.exit完成回调函数定义 */ export type ExitCompleteCallback = (res: any) => void /** * uni.exit参数定义 */ export type ExitOptions = { /** * 接口调用成功的回调函数 */ success?: ExitSuccessCallback | null, /** * 接口调用失败的回调函数 */ fail?: ExitFailCallback | null, /** * 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ExitCompleteCallback | null } export interface Uni { /** * 退出当前应用 * @uniPlatform { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "3.8.15", * "uniUtsPlugin": "3.9.0", * "unixVer": "3.9.0", * "unixUtsPlugin": "3.9.0" * }, * "ios": { * "osVer": "x", * "uniVer": "x", * "uniUtsPlugin": "x", * "unixVer": "x", * "unixUtsPlugin": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } * @uniVueVersion 2,3 //支持的vue版本 */ exit(options?: ExitOptions | null):void; } export type Exit = (options?: ExitOptions | null) => void;