diff --git a/runtime/main/extend/systemplugin/napi/ohos_uri.js b/runtime/main/extend/systemplugin/napi/ohos_uri.js index 0af4e601..9f13e67e 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_uri.js +++ b/runtime/main/extend/systemplugin/napi/ohos_uri.js @@ -16,47 +16,43 @@ import { paramMock } from "../utils" export function mockUri() { - const uri = { - URI: function (...args) { - console.warn("uri.URI interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return URIMock; - } - } - const URIMock = { + const URIClass = class URI { constructor(...args) { console.warn("uri.URI.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - toString: function (...args) { - console.warn("URI.toString interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramStringMock; - }, - equals: function (...args) { - console.warn("URI.equals interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - checkIsAbsolute: function (...args) { - console.warn("URI.checkIsAbsolute interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - normalize: function (...args) { - console.warn("URI.normalize interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - scheme: '[PC preview] unknow scheme', - userInfo: '[PC preview] unknow userInfo', - host: '[PC preview] unknow host', - port: '[PC preview] unknow port', - path: '[PC preview] unknow path', - query: '[PC preview] unknow query', - fragment: '[PC preview] unknow fragment', - authority: '[PC preview] unknow authority', - ssp: '[PC preview] unknow ssp' - } - return uri; + " may be different from that on a real device."); + this.toString = function (...args) { + console.warn("URI.toString interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramStringMock; + }; + this.equals = function (...args) { + console.warn("URI.equals interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.checkIsAbsolute = function (...args) { + console.warn("URI.checkIsAbsolute interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.normalize = function (...args) { + console.warn("URI.normalize interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return new URIClass(); + }; + this.scheme = '[PC preview] unknow scheme'; + this.userInfo = '[PC preview] unknow userInfo'; + this.host = '[PC preview] unknow host'; + this.port = '[PC preview] unknow port'; + this.path = '[PC preview] unknow path'; + this.query = '[PC preview] unknow query'; + this.fragment = '[PC preview] unknow fragment'; + this.authority = '[PC preview] unknow authority'; + this.ssp = '[PC preview] unknow ssp'; + } + }; + const uriMock = { + URI : URIClass + }; + return uriMock; } diff --git a/runtime/main/extend/systemplugin/napi/ohos_util.js b/runtime/main/extend/systemplugin/napi/ohos_util.js index 017e87ac..d4f9f9cc 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_util.js +++ b/runtime/main/extend/systemplugin/napi/ohos_util.js @@ -16,578 +16,542 @@ import { paramMock } from "../utils" export function mockUtil() { - const util = { + const TextDecoderClass = class TextDecoder { + constructor(...args) { + console.warn("util.TextDecoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.decode = function (...args) { + console.warn("TextDecoder.decode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramStringMock; + }; + this.encoding = "[PC preview] unknow encoding"; + this.fatal = "[PC preview] unknow fatal"; + this.ignoreBOM = "[PC preview] unknow ignoreBOM" + } + }; + + const TextEncoderClass = class TextEncoder { + constructor(...args) { + console.warn("util.TextEncoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.encode = function (...args) { + console.warn("TextEncoder.encode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + const arr = new Uint8Array() + return arr; + }; + this.encodeInto = function (...args) { + console.warn("TextEncoder.encodeInto interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramObjectMock; + }; + this.encoding = "[PC preview] unknow encoding" + } + }; + + const RationalNumberClass = class RationalNumber { + constructor(...args) { + console.warn("util.RationalNumber.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.compareTo = function (...args) { + console.warn("RationalNumber.compareTo​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.equals = function (...args) { + console.warn("RationalNumber.equals​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.valueOf = function (...args) { + console.warn("RationalNumber.valueOf interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getDenominator = function (...args) { + console.warn("RationalNumber.getDenominator​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getNumerator = function (...args) { + console.warn("RationalNumber.getNumerator​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.isFinite = function (...args) { + console.warn("RationalNumber.isFinite​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isNaN = function (...args) { + console.warn("RationalNumber.isNaN​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isZero = function (...args) { + console.warn("RationalNumber.isZero​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.toString = function (...args) { + console.warn("RationalNumber.toString interface mocked in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramStringMock; + } + } + }; + + RationalNumberClass.getCommonDivisor = function (...args) { + console.warn("RationalNumber.getDenominator​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + + RationalNumberClass.createRationalFromString = function (...args) { + console.warn("RationalNumber.createRationalFromString​ interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return new RationalNumberClass(); + }; + + const LruBufferClass = class LruBuffer { + constructor(...args) { + console.warn("util.LruBuffer.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.updateCapacity = function (...args) { + console.warn("LruBuffer.updateCapacity interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + }; + this.toString = function (...args) { + console.warn("LruBuffer.toString interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramStringMock; + }; + this.getCapacity = function (...args) { + console.warn("LruBuffer.getCapacity interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.clear = function (...args) { + console.warn("LruBuffer.clear interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + }; + this.getCreateCount = function (...args) { + console.warn("LruBuffer.getCreateCount interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getMissCount = function (...args) { + console.warn("LruBuffer.getMissCount interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getRemovalCount = function (...args) { + console.warn("LruBuffer.getRemovalCount interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getMatchCount = function (...args) { + console.warn("LruBuffer.getMatchCount interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.getPutCount = function (...args) { + console.warn("LruBuffer.getPutCount interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramNumberMock; + }; + this.isEmpty = function (...args) { + console.warn("LruBuffer.isEmpty​ interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.get = function (...args) { + console.warn("LruBuffer.get interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramObjectMock; + }; + this.put = function (...args) { + console.warn("LruBuffer.put interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramObjectMock; + }; + this.values = function (...args) { + console.warn("LruBuffer.values interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramArrayMock; + }; + this.keys = function (...args) { + console.warn("LruBuffer.keys​ interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramArrayMock; + }; + this.remove = function (...args) { + console.warn("LruBuffer.remove interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramObjectMock; + }; + this.afterRemoval = function (...args) { + console.warn("LruBuffer.afterRemoval interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + }; + this.contains = function (...args) { + console.warn("LruBuffer.contains​ interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.createDefault = function (...args) { + console.warn("LruBuffer.createDefault​ interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramObjectMock; + }; + this.entries = function (...args) { + console.warn("LruBuffer.entries interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramArrayMock; + }; + this[Symbol.iterator] = function (...args) { + console.warn("LruBuffer.[Symbol.iterator] interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramArrayMock; + }; + this.length = "[PC preview] unknow length" + } + }; + + const ScopeComparableMock = { + compareTo: function(...args) { + console.warn("ScopeComparable.compareTo interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + } + }; + + const ScopeType = "[PC preview] unknow ScopeType"; + + const ScopeClass = class Scope { + constructor(...args) { + console.warn("util.Scope.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.toString = function (...args) { + console.warn("Scope.toString interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramStringMock; + }; + this.intersect = function (...args) { + console.warn("Scope.intersect interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return new ScopeClass(); + }; + this.getUpper = function (...args) { + console.warn("Scope.getUpper interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return ScopeType; + }; + this.getLower = function (...args) { + console.warn("Scope.getLower interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return ScopeType; + }; + this.expand = function (...args) { + console.warn("Scope.expand interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return new ScopeClass(); + }; + this.contains = function (...args) { + console.warn("Scope.contains interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.clamp = function (...args) { + console.warn("Scope.clamp interface mockecd in the Previewer. How this interface works on the Previewer" + + "may be different from that on a real device."); + return ScopeType; + } + } + }; + + const Base64Class = class Base64 { + constructor(...args) { + console.warn("util.Base64.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.encodeSync = function (...args) { + console.warn("Base64.encodeSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + const arr = new Uint8Array() + return arr; + }; + this.encodeToStringSync = function (...args) { + console.warn("Base64.encodeToStringSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramStringMock; + }; + this.decodeSync = function (...args) { + console.warn("Base64.decodeSync interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + const arr = new Uint8Array() + return arr; + }; + this.encode = function (...args) { + console.warn("Base64.encode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + const arr = new Uint8Array() + return new Promise((resolve, reject) => { + resolve(arr); + }) + }; + this.encodeToString = function (...args) { + console.warn("Base64.encodeToString interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return new Promise((resolve, reject) => { + resolve(paramMock.paramStringMock); + }) + }; + this.decode = function (...args) { + console.warn("Base64.decode interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + const arr = new Uint8Array() + return new Promise((resolve, reject) => { + resolve(arr); + }) + } + } + }; + + const typesClass = class types { + constructor(...args) { + console.warn("util.types.constructor interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + this.isAnyArrayBuffer = function (...args) { + console.warn("types.isAnyArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isArrayBufferView = function (...args) { + console.warn("types.isArrayBufferView interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isArgumentsObject = function (...args) { + console.warn("types.isArgumentsObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isArrayBuffer = function (...args) { + console.warn("types.isArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isAsyncFunction = function (...args) { + console.warn("types.isAsyncFunction interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isBigInt64Array = function (...args) { + console.warn("types.isBigInt64Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isBigUint64Array = function (...args) { + console.warn("types.isBigUint64Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isBooleanObject = function (...args) { + console.warn("types.isBooleanObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isBoxedPrimitive = function (...args) { + console.warn("types.isBoxedPrimitive interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isDataView = function (...args) { + console.warn("types.isDataView interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isDate = function (...args) { + console.warn("types.isDate interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isExternal = function (...args) { + console.warn("types.isExternal interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isFloat32Array = function (...args) { + console.warn("types.isFloat32Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isFloat64Array = function (...args) { + console.warn("types.isFloat64Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isGeneratorFunction = function (...args) { + console.warn("types.isGeneratorFunction interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isGeneratorObject = function (...args) { + console.warn("types.isGeneratorObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isInt8Array = function (...args) { + console.warn("types.isInt8Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isInt16Array = function (...args) { + console.warn("types.isInt16Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isInt32Array = function (...args) { + console.warn("types.isInt32Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isMap = function (...args) { + console.warn("types.isMap interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isMapIterator = function (...args) { + console.warn("types.isMapIterator interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isModuleNamespaceObject = function (...args) { + console.warn("types.isModuleNamespaceObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isNativeError = function (...args) { + console.warn("types.isNativeError interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isNumberObject = function (...args) { + console.warn("types.isNumberObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isPromise = function (...args) { + console.warn("types.isPromise interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isProxy = function (...args) { + console.warn("types.isProxy interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isRegExp = function (...args) { + console.warn("types.isRegExp interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isSet = function (...args) { + console.warn("types.isSet interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isSetIterator = function (...args) { + console.warn("types.isSetIterator interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isSharedArrayBuffer = function (...args) { + console.warn("types.isSharedArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isStringObject = function (...args) { + console.warn("types.isStringObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isSymbolObject = function (...args) { + console.warn("types.isSymbolObject interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isTypedArray = function (...args) { + console.warn("types.isTypedArray interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isUint8Array = function (...args) { + console.warn("types.isUint8Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isUint8ClampedArray = function (...args) { + console.warn("types.isUint8ClampedArray interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isUint16Array = function (...args) { + console.warn("types.isUint16Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isUint32Array = function (...args) { + console.warn("types.isUint32Array interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isWeakMap = function (...args) { + console.warn("types.isWeakMap interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + }; + this.isWeakSet = function (...args) { + console.warn("types.isWeakSet interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); + return paramMock.paramBooleanMock; + } + } + }; + + const utilMock = { + TextDecoder : TextDecoderClass, + TextEncoder : TextEncoderClass, + RationalNumber : RationalNumberClass, + LruBuffer : LruBufferClass, + Scope : ScopeClass, + Base64 : Base64Class, + types : typesClass, printf: function (...args) { console.warn("util.printf interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") + " may be different from that on a real device."); return paramMock.paramStringMock; }, getErrorString: function (...args) { console.warn("util.getErrorString interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") + " may be different from that on a real device."); return paramMock.paramStringMock; }, callbackWrapper: function (...args) { console.warn("util.callbackWrapper interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") + " may be different from that on a real device."); }, promiseWrapper: function (...args) { console.warn("util.promiseWrapper interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") + " may be different from that on a real device."); return paramMock.paramObjectMock; }, - TextDecoder: function (...args) { - console.warn("util.TextDecoder interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return TextDecoderMock; - }, - TextEncoder: function (...args) { - console.warn("util.TextEncoder interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return TextEncoderMock; - }, - RationalNumber: function (...args) { - console.warn("util.RationalNumber interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return RationalNumberMock; - }, - LruBuffer: function (...args) { - console.warn("util.LruBuffer interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return LruBufferMock; - }, - ScopeComparable: function (...args) { - console.warn("util.Scope interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return ScopeComparableMock; - }, - Scope: function (...args) { - console.warn("util.Scope interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return ScopeMock; - }, - Base64: function (...args) { - console.warn("util.Base64 interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return Base64Mock; - }, - types: function (...args) { - console.warn("util.types interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return TypesMock; - } - } - const TextDecoderMock = { - encoding: "[PC preview] unknow encoding", - fatal: "[PC preview] unknow fatal", - ignoreBOM: "[PC preview] unknow ignoreBOM", - constructor(...args) { - console.warn("util.TextDecoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - decode: function (...args) { - console.warn("TextDecoder.decode interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramStringMock; - } - } - const TextEncoderMock = { - encoding: "[PC preview] unknow encoding", - constructor(...args) { - console.warn("util.TextEncoder.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - encode: function (...args) { - console.warn("TextEncoder.encode interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - const arr = new Uint8Array() - return arr; - }, - encodeInto: function (...args) { - console.warn("TextEncoder.encodeInto interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") + promisify: function (...args) { + console.warn("util.promisify interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device."); return paramMock.paramObjectMock; } - } - const RationalNumberMock = { - constructor(...args) { - console.warn("util.RationalNumber.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - createRationalFromString: function (...args) { - console.warn("RationalNumber.createRationalFromString​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - compareTo: function (...args) { - console.warn("RationalNumber.compareTo​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - equals: function (...args) { - console.warn("RationalNumber.equals​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - valueOf: function (...args) { - console.warn("RationalNumber.valueOf interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getCommonDivisor: function (...args) { - console.warn("RationalNumber.getCommonDivisor​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getDenominator: function (...args) { - console.warn("RationalNumber.getDenominator​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getNumerator: function (...args) { - console.warn("RationalNumber.getNumerator​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - isFinite: function (...args) { - console.warn("RationalNumber.isFinite​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isNaN: function (...args) { - console.warn("RationalNumber.isNaN​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isZero: function (...args) { - console.warn("RationalNumber.isZero​ interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - toString: function (...args) { - console.warn("RationalNumber.toString interface mocked in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramStringMock; - } - } - const LruBufferMock = { - length: "[PC preview] unknow length", - constructor(...args) { - console.warn("util.LruBuffer.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - updateCapacity: function (...args) { - console.warn("LruBuffer.updateCapacity interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - }, - toString: function (...args) { - console.warn("LruBuffer.toString interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramStringMock; - }, - getCapacity: function (...args) { - console.warn("LruBuffer.getCapacity interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - clear: function (...args) { - console.warn("LruBuffer.clear interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - }, - getCreateCount: function (...args) { - console.warn("LruBuffer.getCreateCount interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getMissCount: function (...args) { - console.warn("LruBuffer.getMissCount interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getRemovalCount: function (...args) { - console.warn("LruBuffer.getRemovalCount interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getMatchCount: function (...args) { - console.warn("LruBuffer.getMatchCount interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - getPutCount: function (...args) { - console.warn("LruBuffer.getPutCount interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramNumberMock; - }, - isEmpty: function (...args) { - console.warn("LruBuffer.isEmpty​ interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - get: function (...args) { - console.warn("LruBuffer.get interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - put: function (...args) { - console.warn("LruBuffer.put interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - values: function (...args) { - console.warn("LruBuffer.values interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - keys: function (...args) { - console.warn("LruBuffer.keys​ interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - remove: function (...args) { - console.warn("LruBuffer.remove interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - afterRemoval: function (...args) { - console.warn("LruBuffer.afterRemoval interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - }, - contains: function (...args) { - console.warn("LruBuffer.contains​ interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - createDefault: function (...args) { - console.warn("LruBuffer.createDefault​ interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - entries: function (...args) { - console.warn("LruBuffer.entries interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - }, - [Symbol.iterator]: function (...args) { - console.warn("LruBuffer.[Symbol.iterator] interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramObjectMock; - } - } - const ScopeComparableMock = { - compareTo: function(...args) { - console.warn("ScopeComparable.compareTo interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - } - } - const ScopeMock = { - constructor(...args) { - console.warn("util.Scope.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - toString: function (...args) { - console.warn("Scope.toString interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramStringMock; - }, - intersect: function (...args) { - console.warn("Scope.intersect interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeMock; - }, - intersect: function (...args) { - console.warn("Scope.intersect interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeMock; - }, - getUpper: function (...args) { - console.warn("Scope.getUpper interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeTypeMock; - }, - getLower: function (...args) { - console.warn("Scope.getLower interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeTypeMock; - }, - expand: function (...args) { - console.warn("Scope.expand interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeMock; - }, - expand: function (...args) { - console.warn("Scope.expand interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeMock; - }, - expand: function (...args) { - console.warn("Scope.expand interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeMock; - }, - contains: function (...args) { - console.warn("Scope.contains interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - contains: function (...args) { - console.warn("Scope.contains interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - clamp: function (...args) { - console.warn("Scope.clamp interface mockecd in the Previewer. How this interface works on the Previewer" + - "may be different from that on a real device.") - return paramMock.paramScopeTypeMock; - } - } - const Base64Mock = { - constructor(...args) { - console.warn("util.Base64.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - encodeSync: function (...args) { - console.warn("Base64.encodeSync interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - const arr = new Uint8Array() - return arr; - }, - encodeToStringSync: function (...args) { - console.warn("Base64.encodeToStringSync interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramStringMock; - }, - decodeSync: function (...args) { - console.warn("Base64.decodeSync interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - const arr = new Uint8Array() - return arr; - }, - encode: function (...args) { - console.warn("Base64.encode interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - const arr = new Uint8Array() - return new Promise((resolve, reject) => { - resolve(arr); - }) - }, - encodeToString: function (...args) { - console.warn("Base64.encodeToString interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return new Promise((resolve, reject) => { - resolve(paramMock.paramStringMock); - }) - }, - decode: function (...args) { - console.warn("Base64.decode interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - const arr = new Uint8Array() - return new Promise((resolve, reject) => { - resolve(arr); - }) - } - } - const TypesMock = { - constructor(...args) { - console.warn("util.Types.constructor interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - }, - isAnyArrayBuffer: function (...args) { - console.warn("types.isAnyArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isArrayBufferView: function (...args) { - console.warn("types.isArrayBufferView interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isArgumentsObject: function (...args) { - console.warn("types.isArgumentsObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isArrayBuffer: function (...args) { - console.warn("types.isArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isAsyncFunction: function (...args) { - console.warn("types.isAsyncFunction interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isBigInt64Array: function (...args) { - console.warn("types.isBigInt64Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isBigUint64Array: function (...args) { - console.warn("types.isBigUint64Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isBooleanObject: function (...args) { - console.warn("types.isBooleanObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isBoxedPrimitive: function (...args) { - console.warn("types.isBoxedPrimitive interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isDataView: function (...args) { - console.warn("types.isDataView interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isDate: function (...args) { - console.warn("types.isDate interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isExternal: function (...args) { - console.warn("types.isExternal interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isFloat32Array: function (...args) { - console.warn("types.isFloat32Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isFloat64Array: function (...args) { - console.warn("types.isFloat64Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isGeneratorFunction: function (...args) { - console.warn("types.isGeneratorFunction interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isGeneratorObject: function (...args) { - console.warn("types.isGeneratorObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isInt8Array: function (...args) { - console.warn("types.isInt8Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isInt16Array: function (...args) { - console.warn("types.isInt16Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isInt32Array: function (...args) { - console.warn("types.isInt32Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isMap: function (...args) { - console.warn("types.isMap interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isMapIterator: function (...args) { - console.warn("types.isMapIterator interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isModuleNamespaceObject: function (...args) { - console.warn("types.isModuleNamespaceObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isNativeError: function (...args) { - console.warn("types.isNativeError interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isNumberObject: function (...args) { - console.warn("types.isNumberObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isPromise: function (...args) { - console.warn("types.isPromise interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isProxy: function (...args) { - console.warn("types.isProxy interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isRegExp: function (...args) { - console.warn("types.isRegExp interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isSet: function (...args) { - console.warn("types.isSet interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isSetIterator: function (...args) { - console.warn("types.isSetIterator interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isSharedArrayBuffer: function (...args) { - console.warn("types.isSharedArrayBuffer interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isStringObject: function (...args) { - console.warn("types.isStringObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isSymbolObject: function (...args) { - console.warn("types.isSymbolObject interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isTypedArray: function (...args) { - console.warn("types.isTypedArray interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isUint8Array: function (...args) { - console.warn("types.isUint8Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isUint8ClampedArray: function (...args) { - console.warn("types.isUint8ClampedArray interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isUint16Array: function (...args) { - console.warn("types.isUint16Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isUint32Array: function (...args) { - console.warn("types.isUint32Array interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isWeakMap: function (...args) { - console.warn("types.isWeakMap interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - }, - isWeakSet: function (...args) { - console.warn("types.isWeakSet interface mocked in the Previewer. How this interface works on the Previewer" + - " may be different from that on a real device.") - return paramMock.paramBooleanMock; - } - } - return util; + }; + return utilMock; } \ No newline at end of file