import Vnmf from '../../index' declare module '../../index' { /** @ignore */ type TypedArray = | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array namespace setStorage { interface Option { /** What needs to be stored。Original type only、Date、♪ And be able to pass`JSON.stringify`Sequenced Object。 */ data: any /** Specified in Local Cache key */ key: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace removeStorage { interface Option { /** Specified in Local Cache key */ key: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } namespace getStorageInfoSync { interface Option { /** The size of the space currently occupied, Units KB */ currentSize: number /** Current storage All of them. key */ keys: string[] /** Limit the size of space,Units KB */ limitSize: number } } namespace getStorageInfo { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (option: SuccessCallbackOption) => void } interface SuccessCallbackOption { /** The size of the space currently occupied, Units KB */ currentSize: number /** Current storage All of them. key */ keys: string[] /** Limit the size of space,Units KB */ limitSize: number } } namespace getStorage { interface Option { /** Specified in Local Cache key */ key: string /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** keyCorresponding content */ data: T /** Call Results */ errMsg: string } } namespace clearStorage { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Interface calls a successful echo function */ success?: (res: VnmfGeneral.CallbackResult) => void } } interface VnmfStatic { /** Vnmf.setStorage Synchronized version of the * @supported weapp, h5, tt * @example * ```tsx * Vnmf.setStorage({ * key:"key", * data:"value" * }) * ``` * @example * ```tsx * try { * Vnmf.setStorageSync('key', 'value') * } catch (e) { } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorageSync.html */ setStorageSync( /** Specified in Local Cache key */ key: string, /** What needs to be stored。Original type only、Date、♪ And be able to pass`JSON.stringify`Sequenced Object。 */ data: any, ): void /** Store data as specified in local cache key Medium。It'll overwrite what it's supposed to be. key Corresponding content。Unless the user removes it on its own initiative or is cleaned up by system for storage space,Otherwise, the data will always be available.。Single key Allow maximum data length to store 1MB,The maximum limit for all data storage is 10MB。 * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.setStorage({ * key:"key", * data:"value" * }) * ``` * ```tsx * try { * Vnmf.setStorageSync('key', 'value') * } catch (e) { } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorage.html */ setStorage(option: setStorage.Option): Promise /** According to URL Destruction of data in memory * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.revokeBufferURL.html */ revokeBufferURL( /** Binary data to be destroyed URL */ url: string ): void /** Vnmf.removeStorage Synchronized version of the * @supported weapp, h5, tt * @example * ```tsx * try { * Vnmf.removeStorageSync('key') * } catch (e) { * // Do something when catch error * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorageSync.html */ removeStorageSync( /** Specified in Local Cache key */ key: string, ): void /** Remove specified from local cache key * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.removeStorage({ * key: 'key', * success: function (res) { * console.log(res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorage.html */ removeStorage(option: removeStorage.Option): Promise /** Vnmf.getStorage Synchronized version of the * @supported weapp, h5, tt * @example * ```tsx * try { * var value = Vnmf.getStorageSync('key') * if (value) { * // Do something with return value * } * } catch (e) { * // Do something when catch error * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageSync.html */ getStorageSync( /** Specified in Local Cache key */ key: string, ): T /** Vnmf.getStorageInfo Synchronized version of the * @supported weapp, h5, rn, tt * @example * ```tsx * try { * const res = Vnmf.getStorageInfoSync() * console.log(res.keys) * console.log(res.currentSize) * console.log(res.limitSize) * } catch (e) { * // Do something when catch error * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfoSync.html */ getStorageInfoSync(): getStorageInfoSync.Option /** Assortment fetching the currentstorageof the Convention on Elimination All Forms Discrimination against Women * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.getStorageInfo({ * success: function (res) { * console.log(res.keys) * console.log(res.currentSize) * console.log(res.limitSize) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfo.html */ getStorageInfo(option?: getStorageInfo.Option): Promise /** Get Assorted From Local Cache key Contents * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.getStorage({ * key: 'key', * success: function (res) { * console.log(res.data) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorage.html */ getStorage(option: getStorage.Option): Promise> /** According to the incoming, buffer Create a unique URL Memory in existence * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.createBufferURL.html */ createBufferURL( /** Binary data required to be stored in memory */ buffer: ArrayBuffer | TypedArray ): void /** Vnmf.clearStorage Synchronized version of the * @supported weapp, h5, tt * @example * ```tsx * try { * Vnmf.clearStorageSync() * } catch(e) { * // Do something when catch error * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorageSync.html */ clearStorageSync(): void /** Clean Local Data Cache * @supported weapp, h5, rn, tt * @example * ```tsx * Vnmf.clearStorage() * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html */ clearStorage(option?: clearStorage.Option): Promise } }