提交 faecb590 编写于 作者: fxy060608's avatar fxy060608

wip(uts): compiler

上级 adb1c99c
{"version":3,"sources":["uni_modules/test-component/utssdk/app-ios/index.vue"],"sourcesContent":["\n\n\n\n\n\nimport {\n LottieAnimationView,\n LottieAnimation,\n LottieLoopMode\n} from 'Lottie'\nimport {\n URL\n} from 'Foundation'\nimport {\n UIView\n} from \"UIKit\"\nimport {\n UTSiOS\n} from \"DCloudUTSFoundation\"\n\n\n//原生提供以下属性或方法的实现 \nexport default {\n name: \"animation-view\",\n /**\n * 当播放到末尾时触发 ended 事件(自然播放结束会触发回调,循环播放结束及手动停止动画不会触发)\n */\n emits: ['bindended'],\n props: {\n /**\n * 动画资源地址,目前只支持绝对路径\n */\n \"path\": {\n type: String,\n },\n /**\n * 动画是否循环播放\n */\n \"autoplay\": {\n type: Boolean,\n },\n /**\n * 动画是否自动播放\n */\n \"loop\": {\n type: Boolean,\n },\n /**\n * 是否隐藏动画\n */\n \"hidden\": {\n type: Boolean,\n },\n /**\n * 动画操作,可取值 play、pause、stop\n */\n \"action\": {\n type: String,\n }\n\n },\n data() {\n return {\n animationView: null as LottieAnimationView | null\n }\n },\n watch: {\n\n /// 注意: newValue 都需要强转成对应的类型\n\n \"path\": {\n handler(newValue: string, oldValue: string) {\n this.path = newValue\n if (this.autoplay) {\n this.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"loop\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.loop = newValue\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"autoplay\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.autoplay = newValue\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"action\": {\n handler(newValue: string, oldValue: string) {\n const action = newValue\n\n if (action == \"play\" || action == \"pause\" || action == \"stop\") {\n this.action = action\n switch (action) {\n case \"play\":\n this.playAnimation()\n break;\n case \"pause\":\n this.animationView.pause()\n break;\n case \"stop\":\n this.animationView.stop()\n break;\n default:\n break;\n }\n } else {\n // 非法入参,不管\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"hidden\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.hidden = newValue\n this.animationView.isHidden = this.hidden\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n },\n methods: {\n // 需要对外暴露的方法\n // 设置 RepeatMode \n setRepeatMode(repeatMode: string) {\n if (repeatMode == \"RESTART\") {\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n } else {\n this.animationView.loopMode = LottieLoopMode.playOnce\n }\n } else if (repeatMode == \"REVERSE\") {\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.autoReverse\n } else {\n this.animationView.loopMode = LottieLoopMode.repeatBackwards(1)\n }\n }\n },\n // 不对外暴露的方法\n // 播放动画 \n playAnimation() {\n if (this.path == null) {\n return\n }\n\n // 构建动画资源 url\n var animationUrl: URL | null\n\n if (this.path!.hasPrefix(\"http\")) {\n animationUrl = new URL(string = this.path!)\n } else {\n var filePath = UTSiOS.getResourcePath(this.path!)\n animationUrl = new URL(filePath = filePath)\n }\n\n if (animationUrl != null) {\n // 加载动画 LottieAnimation\n LottieAnimation.loadedFrom(url = animationUrl!, closure = (animation: LottieAnimation): void => {\n if (animation != null) {\n // 加载成功开始播放\n this.animationView.animation = animation\n this.animationView.play(completion = (isFinish: boolean): void => {\n if (isFinish) {\n // 播放完成回调事件\n this.fireEvent(\"bindended\")\n }\n })\n }\n })\n }\n }\n },\n created() { //创建组件,替换created \n\n },\n measure(size: UTSSize): UTSSize { //测量组件大小\n //可选实现,仅当需要原生计算组件大小时需要实现 \n return new UTSSize(100, 100);\n },\n NVBeforeLoad() { //组件将要创建,对应前端beforeMount \n //可选实现,这里可以提前做一些操作 \n },\n NVLoad(): UIView { //创建原生View,必须定义返回值类型(Android需要明确知道View类型,需特殊校验) \n // 初始化 LottieAnimationView\n this.animationView = new LottieAnimationView()\n // 默认只播放一次动画\n this.animationView.loopMode = LottieLoopMode.playOnce\n return this.animationView\n },\n NVLoaded() { //原生View已创建 \n\n /// 更新 props 中定义的属性值\n\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n }\n\n this.animationView.isHidden = this.hidden\n\n if (this.autoplay) {\n this.playAnimation()\n }\n },\n\n NVLayouted() { //原生View布局完成 \n //可选实现,这里可以做布局后续操作 \n },\n\n NVBeforeUnload() { //原生View将释放 \n //可选实现,这里可以做释放View之前的操作 \n },\n NVUnloaded() { //原生View已释放 \n //可选实现,这里可以做释放View之后的操作 \n },\n NVMeasure(size: UTSSize): UTSSize {\n return UTSSize(100, 100)\n },\n unmounted() { //组件销毁 \n //可选实现 \n }\n}\n\n\n\n\n\n\n\n\n"],"names":[],"mappings":"AAMA,cAIe;AACf,kBAEmB;AACnB,aAEc;AACd,2BAE4B;;;mDA6Kd;qBA9JI;yBAMA;qBAMA;uBAMA;uBAMA;8BAMiB,uBAAR,GAAI;mCAsHjB,CAEV;iCACQ,EAAA,MAAM,OAAO,KAAG,QAAQ;QAE5B,OAAO,AAAI,QAAQ,GAAG,EAAE,GAAG;IAC/B;wCACe,CAEf;qCACU,OAAO;QAEb,IAAI,CAAC,aAAa,GAAG,AAAI;QAEzB,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,eAAe,QAAQ;QACrD,OAAO,IAAI,CAAC,aAAa;IAC7B;oCACW;QAIP,IAAI,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,eAAe,IAAI;;QAGrD,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM;QAEzC,IAAI,IAAI,CAAC,QAAQ;YACb,IAAI,CAAC,aAAa;;IAE1B;sCAEa,CAEb;0CAEiB,CAEjB;sCACa,CAEb;mCACU,MAAM,OAAO,KAAG,QAAQ;QAC9B,OAAO,QAAQ,GAAG,EAAE,GAA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mB;QACvB,IAAI,CAAC,QAAQ,GAAG;;;;YAKZ;YAAkB;QACtB,IAAM,SAAS;QAEf,IAAI,UAAU,UAAU,UAAU,WAAW,UAAU,QAAQ;YAC3D,IAAI,CAAC,MAAM,GAAG;YACd,OAAQ;gBACJ,KAAK;oBACD,IAAI,CAAC,aAAa;oBAClB,KAAM;gBACV,KAAK;oBACD,IAAI,CAAC,aAAa,CAAC,KAAK;oBACxB,KAAM;gBACV,KAAK;oBACD,IAAI,CAAC,aAAa,CAAC,IAAI;oBACvB,KAAM;gBACV;oBACI,KAAM;YACd;QACJ;;;;YAQI;YAAmB;QACvB,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-component/utssdk/app-ios/index.vue"],"sourcesContent":["\n\n\n\n\n\nimport {\n LottieAnimationView,\n LottieAnimation,\n LottieLoopMode\n} from 'Lottie'\nimport {\n URL\n} from 'Foundation'\nimport {\n UIView\n} from \"UIKit\"\nimport {\n UTSiOS\n} from \"DCloudUTSFoundation\"\n\n\n//原生提供以下属性或方法的实现 \nexport default {\n name: \"animation-view\",\n /**\n * 当播放到末尾时触发 ended 事件(自然播放结束会触发回调,循环播放结束及手动停止动画不会触发)\n */\n emits: ['bindended'],\n props: {\n /**\n * 动画资源地址,目前只支持绝对路径\n */\n \"path\": {\n type: String,\n },\n /**\n * 动画是否循环播放\n */\n \"autoplay\": {\n type: Boolean,\n },\n /**\n * 动画是否自动播放\n */\n \"loop\": {\n type: Boolean,\n },\n /**\n * 是否隐藏动画\n */\n \"hidden\": {\n type: Boolean,\n },\n /**\n * 动画操作,可取值 play、pause、stop\n */\n \"action\": {\n type: String,\n }\n\n },\n data() {\n return {\n animationView: null as LottieAnimationView | null\n }\n },\n watch: {\n\n /// 注意: newValue 都需要强转成对应的类型\n\n \"path\": {\n handler(newValue: string, oldValue: string) {\n this.path = newValue\n if (this.autoplay) {\n this.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"loop\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.loop = newValue\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"autoplay\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.autoplay = newValue\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"action\": {\n handler(newValue: string, oldValue: string) {\n const action = newValue\n\n if (action == \"play\" || action == \"pause\" || action == \"stop\") {\n this.action = action\n switch (action) {\n case \"play\":\n this.playAnimation()\n break;\n case \"pause\":\n this.animationView.pause()\n break;\n case \"stop\":\n this.animationView.stop()\n break;\n default:\n break;\n }\n } else {\n // 非法入参,不管\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"hidden\": {\n handler(newValue: boolean, oldValue: boolean) {\n this.hidden = newValue\n this.animationView.isHidden = this.hidden\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n },\n methods: {\n // 需要对外暴露的方法\n // 设置 RepeatMode \n setRepeatMode(repeatMode: string) {\n if (repeatMode == \"RESTART\") {\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n } else {\n this.animationView.loopMode = LottieLoopMode.playOnce\n }\n } else if (repeatMode == \"REVERSE\") {\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.autoReverse\n } else {\n this.animationView.loopMode = LottieLoopMode.repeatBackwards(1)\n }\n }\n },\n // 不对外暴露的方法\n // 播放动画 \n playAnimation() {\n if (this.path == null) {\n return\n }\n\n // 构建动画资源 url\n var animationUrl: URL | null\n\n if (this.path!.hasPrefix(\"http\")) {\n animationUrl = new URL(string = this.path!)\n } else {\n var filePath = UTSiOS.getResourcePath(this.path!)\n animationUrl = new URL(filePath = filePath)\n }\n\n if (animationUrl != null) {\n // 加载动画 LottieAnimation\n LottieAnimation.loadedFrom(url = animationUrl!, closure = (animation: LottieAnimation): void => {\n if (animation != null) {\n // 加载成功开始播放\n this.animationView.animation = animation\n this.animationView.play(completion = (isFinish: boolean): void => {\n if (isFinish) {\n // 播放完成回调事件\n this.fireEvent(\"bindended\")\n }\n })\n }\n })\n }\n }\n },\n created() { //创建组件,替换created \n\n },\n measure(size: UTSSize): UTSSize { //测量组件大小\n //可选实现,仅当需要原生计算组件大小时需要实现 \n return new UTSSize(100, 100);\n },\n NVBeforeLoad() { //组件将要创建,对应前端beforeMount \n //可选实现,这里可以提前做一些操作 \n },\n NVLoad(): UIView { //创建原生View,必须定义返回值类型(Android需要明确知道View类型,需特殊校验) \n // 初始化 LottieAnimationView\n this.animationView = new LottieAnimationView()\n // 默认只播放一次动画\n this.animationView.loopMode = LottieLoopMode.playOnce\n return this.animationView\n },\n NVLoaded() { //原生View已创建 \n\n /// 更新 props 中定义的属性值\n\n if (this.loop) {\n this.animationView.loopMode = LottieLoopMode.loop\n }\n\n this.animationView.isHidden = this.hidden\n\n if (this.autoplay) {\n this.playAnimation()\n }\n },\n\n NVLayouted() { //原生View布局完成 \n //可选实现,这里可以做布局后续操作 \n },\n\n NVBeforeUnload() { //原生View将释放 \n //可选实现,这里可以做释放View之前的操作 \n },\n NVUnloaded() { //原生View已释放 \n //可选实现,这里可以做释放View之后的操作 \n },\n NVMeasure(size: UTSSize): UTSSize {\n return UTSSize(100, 100)\n },\n unmounted() { //组件销毁 \n //可选实现 \n }\n}\n\n\n\n\n\n\n\n\n"],"names":[],"mappings":"AAMA,cAIe;AACf,kBAEmB;AACnB,aAEc;AACd,2BAE4B;;;mDA6Kd;qBA9JI;yBAMA;qBAMA;uBAMA;uBAMA;8BAMiB,uBAAR,GAAI;mCAsHjB,CAEV;iCACQ,EAAA,MAAM,OAAO,KAAG,QAAQ;QAE5B,OAAO,AAAI,QAAQ,GAAG,EAAE,GAAG;IAC/B;wCACe,CAEf;qCACU,OAAO;QAEb,IAAI,CAAC,aAAa,GAAG,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AAI,CAAC,aAAa,CAAC,SAAS,GAAG;gBAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAa;iBAAC,UAAU,IAAO;gBACnD,IAAI;oBAEA,IAAI,CAAC,SAAS,CAAC;;;YAG3B;;;IAGZ;;;;;;;;;;YA5GY;YAAkB;QACtB,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,IAAI,CAAC,QAAQ;YACb,IAAI,CAAC,aAAa;;;;;YAMlB;YAAmB;QACvB,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,eAAe,IAAI;;;;;YAMjD;YAAmB;QACvB,IAAI,CAAC,QAAQ,GAAG;;;;YAKZ;YAAkB;QACtB,IAAM,SAAS;QAEf,IAAI,UAAU,UAAU,UAAU,WAAW,UAAU,QAAQ;YAC3D,IAAI,CAAC,MAAM,GAAG;YACd,OAAQ;gBACJ,KAAK;oBACD,IAAI,CAAC,aAAa;gBAEtB,KAAK;oBACD,IAAI,CAAC,aAAa,CAAC,KAAK;gBAE5B,KAAK;oBACD,IAAI,CAAC,aAAa,CAAC,IAAI;gBAE3B;oBACI,KAAM;YACd;QACJ;;;;YAQI;YAAmB;QACvB,IAAI,CAAC,MAAM,GAAG;QACd,IAAI,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-uniplugin/static/logo.png","uni_modules/test-uniplugin/utssdk/app-android/index.uts","uni_modules/test-uniplugin/utssdk/app-android/utils.uts","uni_modules/test-uniplugin/utssdk/app-android/login.uts","uni_modules/test-uniplugin/utssdk/app-android/interface.uts","uni_modules/test-uniplugin/utssdk/interface.uts"],"sourcesContent":["import { UTSAndroid } from 'io.dcloud.uts'\nexport default UTSAndroid.getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { login } from 'login'\nimport { IUser } from './interface'\nimport logo from '../../static/logo.png'\nimport { ShowToast } from '../interface.uts'\n\nconst test = arrayOf(1, 2, 3)\n\ntype GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n for (let i = 0; i < 10; i++) {\n console.log(i)\n }\n Log.info(logo)\n\n console.log('def android')\n\n\n\n\n\n\n\n\n console.log('ndef ios')\n\n\n console.log('def android || def ios')\n\n\n\n\n const a = -3\n console.log(~a)\n new XToast<XToast<unknown>>(getUniActivity())\n .setContentView(R.layout.toast_hint)\n .setDuration(1000)\n .setImageDrawable(android.R.id.icon, R.mipmap.ic_dialog_tip_finish)\n .setText(android.R.id.message, '点我消失')\n .show()\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {\n console.log(new TestClass())\n }\n}\nfunction login(name: string, callback: () => void) { }\n\n@Suppress(\"DEPRECATION\")\n export function register(name: string, callback: () => void) { }\nexport function offMemoryWarning(\n callback: null | ((level: number) => void) = null\n) {\n uni.showToast()\n uni.showToast()\n uni.showModel()\n}\nclass TestClass {\n\n}\nexport const showToast1: ShowToast = (msg) => { }\nexport const showToast2: ShowToast = function (msg) { }\nexport const showToast3: ShowToast = function showToast(msg) { }\n","export function test(){\n console.log('test')\n}\n","import { test } from \"./utils.uts\"\nexport function login(name: string, pwd: string) {\n console.log('login')\n test()\n return { name, pwd }\n}\n","export interface IUser {\n register(name: string): void\n}\n","export type ShowToast = (msg: string) => void\n"],"names":[],"mappings":";;;;;;;;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;ACF7B,IAAS,OAAM;IAClB,QAAQ,GAAG,CAAC;AAChB;ACD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AC1D,IAAS,iBACd,2BAA6C,IAAI,EACjD;IACI;IACA;IACA;AACN;AACA,WAAM;AAEN;AACO,IAAM,wBAAwB,IAAC,IAAQ,CAAE;AACzC,IAAM,wBAAwB,IAAU,GAAG,EAAE,CAAE;AAC/C,IAAM,wBAAwB,IAAmB,GAAG,EAAE,CAAE"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-uniplugin/static/logo.png","uni_modules/test-uniplugin/utssdk/app-android/index.uts","uni_modules/test-uniplugin/utssdk/app-android/utils.uts","uni_modules/test-uniplugin/utssdk/app-android/login.uts","uni_modules/test-uniplugin/utssdk/app-android/interface.uts","uni_modules/test-uniplugin/utssdk/interface.uts"],"sourcesContent":["import { UTSAndroid } from 'io.dcloud.uts'\nexport default UTSAndroid.getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { login } from 'login'\nimport { IUser } from './interface'\nimport logo from '../../static/logo.png'\nimport { ShowToast } from '../interface.uts'\n\nconst test = arrayOf(1, 2, 3)\n\ntype GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n for (let i = 0; i < 10; i++) {\n console.log(i)\n }\n Log.info(logo)\n\n console.log('def android')\n\n\n\n\n\n\n\n\n console.log('ndef ios')\n\n\n console.log('def android || def ios')\n\n\n\n\n const a = -3\n console.log(~a)\n new XToast<XToast<unknown>>(getUniActivity())\n .setContentView(R.layout.toast_hint)\n .setDuration(1000)\n .setImageDrawable(android.R.id.icon, R.mipmap.ic_dialog_tip_finish)\n .setText(android.R.id.message, '点我消失')\n .show()\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {\n console.log(new TestClass())\n }\n}\nfunction login(name: string, callback: () => void) { }\n\n@Suppress(\"DEPRECATION\")\n export function register(name: string, callback: () => void) { }\nexport function offMemoryWarning(\n callback: null | ((level: number) => void) = null\n) {\n uni.showToast()\n uni.showToast()\n uni.showModel()\n}\nclass TestClass {\n\n}\nexport const showToast1: ShowToast = (msg) => { }\nexport const showToast2: ShowToast = function (msg) { }\nexport const showToast3: ShowToast = function showToast(msg) { }\n","export function test(){\n console.log('test')\n}\n","import { test } from \"./utils.uts\"\nexport function login(name: string, pwd: string) {\n console.log('login')\n test()\n return { name, pwd }\n}\n","export interface IUser {\n register(name: string): void\n}\n","export type ShowToast = (msg: string) => void\n"],"names":[],"mappings":";;;;;;;;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;ACF7B,IAAS,OAAM;IAClB,QAAQ,GAAG,CAAC;AAChB;ACDO,IAAS,MAAM,MAAM,MAAM,EAAE,KAAK,MAAM,iBAAE;IAC/C,QAAQ,GAAG,CAAC;IACZ;IACA,OAAO;QAAE,IAAA,OAAA;QAAM,IAAA,MAAA;KAAK;AACtB;UCLiB;QACf,SAAS,MAAM,MAAM,GAAG,IAAI;;cJAf,WAAW,eAAe,CAAC;UKD9B,aAAa,KAAK,MAAM,KAAK,IAAI;AJQ7C,IAAM,QAAO,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;AAOrB,WAAM;IACX,iBAAM,MAAM,MAAM,MAAM,EAAE,KAAK,MAAM,8CAAE;QACrC,WAAW,KAAM;YACf,QAAQ,GAAG,CAAC;QACd;UAAG,IAAI;QACP,MAAM,MAAM;YACZ;YAAK,IAAI,IAAI,CAAC;YAAd,MAAgB,IAAI,EAAE;gBACpB,QAAQ,GAAG,CAAC;gBADU;;QAExB;QACA,IAAI,IAAI;QAER,QAAQ,GAAG,CAAC;QASZ,QAAQ,GAAG,CAAC;QAGZ,QAAQ,GAAG,CAAC;QAMZ,QAAQ,GAAG,CAAC,CADF,EAAE,KACE;QACV,OAAO,OAAO,CAAO,GAAG,kBACzB,cAAc,CAAC,EAAE,MAAM,CAAC,UAAU,EAClC,WAAW,CAAC,IAAI,EAChB,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,oBAAoB,EACjE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,QAC9B,IAAI;IACT;IACA,aAAA,SAAS,MAAM,MAAM,EAAE,qBAAoB,EAAE;QAC3C,IAAI,IAAI,YAAS;IACnB;IACA,SAAA,KAAK,MAAM,IAAI,EAAE;QACf,QAAQ,GAAG,CAAC,AAAI;IAClB;AACF;AACA,UAAe,MAAM,MAAM,EAAE,gBAAgB,IAAI,EAAE,CAAE;AAErD,CAAC,SAAS;AAAc,IACN,SAAS,MAAM,MAAM,EAAE,qBAAoB,EAAE,CAAE;AAC1D,IAAS,iBACd,2BAA6C,IAAI,EACjD;IACI;IACA;IACA;AACN;AACA,WAAM;AAEN;AACO,IAAM,wBAAwB,IAAC,IAAQ,CAAE;AACzC,IAAM,wBAAwB,IAAU,GAAG,EAAE,CAAE;AAC/C,IAAM,wBAAwB,IAAmB,GAAG,EAAE,CAAE;qBAbpC,MAAM,MAAM,EAAE;oBAAd,6BAAc"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-uniplugin/utssdk/interface.uts","uni_modules/test-uniplugin/utssdk/app-ios/index.uts"],"sourcesContent":["export type ShowToast = (msg: string) => void\n","import { UIDevice } from 'UIKit'\nimport { CLLocationManager, CLAuthorizationStatus } from 'CoreLocation'\nimport { ShowToast } from '../interface.uts'\n\ntype GetBatteryInfoOptions = {\n name: string\n pwd: number\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\n\nexport default function getBatteryInfo(options: GetBatteryInfoOptions) {\n new UIAlertController(\n (title = title),\n (message = message),\n (preferredStyle = UIAlertController.Style.alert)\n )\n const res = {\n errMsg: 'getBatteryInfo:ok',\n level: UIDevice.current.batteryLevel * 100,\n isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,\n }\n if (options.success != null) {\n options.success!(res)\n }\n if (options.complete != null) {\n options.complete!(res)\n }\n}\n\nexport function test1(callback: () => void): string {\n console.log({ \"a\": \"b\" })\n console.log('test1')\n\n\n\n\n console.log('def ios')\n\n\n console.log('ndef android')\n\n\n\n\n\n console.log('def android || def ios')\n\n\n\n\n console.log(CLLocationManager, CLAuthorizationStatus)\n const a = -3\n console.log(~a)\n return 'test1'\n}\n\nclass Test1 { }\nexport class Test {\n constructor() {\n new Test1()\n }\n test(): string | null {\n if (UTSiOS.macros(\"swift(>=1)\")) {\n console.log(\"swift(>=1)\")\n }\n if (UTSiOS.macros(\"arch(i386) || arch(arm)\")) {\n console.log(\"arch(i386) || arch(arm)\")\n }\n if (UTSiOS.available(\"iOS 14, macOS 11.0, *\")) {\n console.log(\"iOS 14, macOS 11.0, *\")\n } else if (UTSiOS.available(\"iOS 13,*\")) {\n console.log(\"iOS 13,*\")\n } else if (UTSiOS.unavailable(\"tvOS 12\")) {\n console.log(\"tvOS 12\")\n }\n return null\n }\n}\n\nexport async function testAsync() {\n uni.showToast()\n uni.showToast()\n uni.showModel()\n return { a: 1 }\n}\n\nexport const showToast1: ShowToast = (msg) => { }\nexport const showToast2: ShowToast = function (msg) { }\nexport const showToast3: ShowToast = function showToast(msg) { }\n"],"names":[],"mappings":";;;;UAAY,eAAa,KAAK,MAAM,KAAK,IAAI;ACA7C,aAAgC;AAChC,oBAAuE;AAG1C;;aAAxB;IACH,WAAA,MAAM,MAAM,EAAA;IACZ,WAAA,KAAK,QAAM,EAAA;IACX,WAAA,SAAQ,aAA8B;IACtC,WAAA,MAAK,aAA8B;IACnC,WAAA,UAAS,aAA8B;AACzC;AAEe,YAAS,eAAe,EAAA,SAAS,qBAAqB,EAAE;IACjE,kBACD,OAAQ,OACR,SAAU,SACV,gBAAi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FG,KAAK,MAAM;eCwFvB,WDxFY;;sCAAA,KAAK,MAAM;eCyFvB,WDzFY;;sCAAA,KAAK,MAAM;eC0FvB,WD1FY"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-uniplugin/utssdk/interface.uts","uni_modules/test-uniplugin/utssdk/app-ios/index.uts"],"sourcesContent":["export type ShowToast = (msg: string) => void\n","import { UIDevice } from 'UIKit'\nimport { CLLocationManager, CLAuthorizationStatus } from 'CoreLocation'\nimport { ShowToast } from '../interface.uts'\n\ntype GetBatteryInfoOptions = {\n name: string\n pwd: number\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\n\nexport default function getBatteryInfo(options: GetBatteryInfoOptions) {\n new UIAlertController(\n (title = title),\n (message = message),\n (preferredStyle = UIAlertController.Style.alert)\n )\n const res = {\n errMsg: 'getBatteryInfo:ok',\n level: UIDevice.current.batteryLevel * 100,\n isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,\n }\n if (options.success != null) {\n options.success!(res)\n }\n if (options.complete != null) {\n options.complete!(res)\n }\n}\n\nexport function test1(callback: () => void): string {\n console.log({ \"a\": \"b\" })\n console.log('test1')\n\n\n\n\n console.log('def ios')\n\n\n console.log('ndef android')\n\n\n\n\n\n console.log('def android || def ios')\n\n\n\n\n console.log(CLLocationManager, CLAuthorizationStatus)\n const a = -3\n console.log(~a)\n return 'test1'\n}\n\nclass Test1 { }\nexport class Test {\n constructor() {\n new Test1()\n }\n test(): string | null {\n if (UTSiOS.macros(\"swift(>=1)\")) {\n console.log(\"swift(>=1)\")\n }\n if (UTSiOS.macros(\"arch(i386) || arch(arm)\")) {\n console.log(\"arch(i386) || arch(arm)\")\n }\n if (UTSiOS.available(\"iOS 14, macOS 11.0, *\")) {\n console.log(\"iOS 14, macOS 11.0, *\")\n } else if (UTSiOS.available(\"iOS 13,*\")) {\n console.log(\"iOS 13,*\")\n } else if (UTSiOS.unavailable(\"tvOS 12\")) {\n console.log(\"tvOS 12\")\n }\n return null\n }\n}\n\nexport async function testAsync() {\n uni.showToast()\n uni.showToast()\n uni.showModel()\n return { a: 1 }\n}\n\nexport const showToast1: ShowToast = (msg) => { }\nexport const showToast2: ShowToast = function (msg) { }\nexport const showToast3: ShowToast = function showToast(msg) { }\n"],"names":[],"mappings":";;;;iBAAY,eAAa,KAAK,MAAM,KAAK,IAAI;ACA7C,aAAgC;AAChC,oBAAuE;AAG1C;;aAAxB;IACH,WAAA,MAAM,MAAM,EAAA;IACZ,WAAA,KAAK,QAAM,EAAA;IACX,WAAA,SAAQ,aAA8B;IACtC,WAAA,MAAK,aAA8B;IACnC,WAAA,UAAS,aAA8B;;;;2CAF5B,KAAK,kBAAkB,IAAI;;2DAAtB;;;wCACR,KAAK,kBAAkB,IAAI;;wDAAtB;;;4CACD,KAAK,kBAAkB,IAAI;;4DAAtB;;;;;;AACnB;AAEe,YAAS,eAAe,EAAA,SAAS,qBAAqB,EAAE;IACjE,kBACD,OAAQ,OACR,SAAU,SACV,gBAAiB,kBAAkB,KAAK,CAAC,KAAK;IAEjD,IAAM,MAAM;QACV,CAAA,SAAQ;QACR,CAAA,QAAO,SAAS,OAAO,CAAC,YAAY,GAAG,GAAG;QAC1C,CAAA,aAAY,SAAS,OAAO,CAAC,YAAY,IAAI,SAAS,YAAY,CAAC,QAAQ;MAC5E;IACD,IAAI,QAAQ,OAAO,IAAI,GAAI;QACzB,QAAQ,OAAO,EAAE;;IAEnB,IAAI,QAAQ,QAAQ,IAAI,GAAI;QAC1B,QAAQ,QAAQ,EAAE;;AAEtB;AAEO,YAAS,MAAM,EAAA,qBAAoB,KAAG,MAAM,CAAC;IAClD,QAAQ,GAAG,CAAC;QAAE,KAAK;MAAK;IACxB,QAAQ,GAAG,CAAC;IAKZ,QAAQ,GAAG,CAAC;IAGZ,QAAQ,GAAG,CAAC;IAMZ,QAAQ,GAAG,CAAC;IAKZ,QAAQ,GAAG,CAAC,mBAAmB;IAC/B,IAAM,IAAI,EAAE;IACZ,QAAQ,GAAG,CAAC,CAAC;IACb,OAAO;AACT;AAEA;;aAAM;AAAQ;AACP;;aAAM;IACX,aAAc;QACR;IACN;IACA,YAAA,UAAQ,MAAM,EAAQ;QACpB;YACE,QAAQ,GAAG,CAAC;cACb;QACD;YACE,QAAQ,GAAG,CAAC;cACb;QACD;YACE,QAAQ,GAAG,CAAC;;YACP;gBACL,QAAQ,GAAG,CAAC;;gBACP;oBACL,QAAQ,GAAG,CAAC;;;;QAEd,OAAO,GAAI;IACb;AACF;AAEO;YAAe,mCAAY;IAC5B;IACA;IACA;IACJ,OAAO;QAAE,CAAA,IAAG,CAAC;MAAE;AACjB;AAEO,WAAM,wBAAwB;GAAC;;AAC/B,WAAM,wBAAwB;CAAU,EAAA,GAAG;;AAC3C,WAAM,wBAAwB;CAAmB,EAAA,GAAG;;;;;wCA9EpB,EAAA,SAAS,qBAAqB;eAA7C,eAAe;;+BAmBjB,EAAA,qBAAoB,KAAG,MAAM;eAAnC,MAAM;;;;qBAkDA;;sCDjFG,KAAK,MAAM;eCwFvB,WDxFY;;sCAAA,KAAK,MAAM;eCyFvB,WDzFY;;sCAAA,KAAK,MAAM;eC0FvB,WD1FY;;;qCCYc;6CAAA;;4BAmBjB,4BAAuB,MAAM;oCAA7B"}
\ No newline at end of file
{"version":3,"sources":["utssdk/test-uts/app-android/index.uts"],"sourcesContent":["export function test(): number {\n return 1\n}\n"],"names":[],"mappings":";;;;;;;AAAO,IAAS,QAAQ,MAAM,CAAC;IAC7B,OAAO,CAAC;AACV"}
\ No newline at end of file
{"version":3,"sources":["utssdk/test-uts/app-android/index.uts"],"sourcesContent":["export function test(): number {\n return 1\n}\n"],"names":[],"mappings":";;;;;;;AAAO,IAAS,QAAQ,MAAM,CAAC;IAC7B,OAAO,CAAC;AACV;oBAFwB,MAAM"}
\ No newline at end of file
{"version":3,"sources":["utssdk/test-uts/app-ios/index.uts"],"sourcesContent":["export function test(): string {\n return '1'\n}\n"],"names":[],"mappings":";AAAO,YAAS,UAAQ,MAAM,CAAC;IAC7B,OAAO;AACT;;;;mCAFwB,MAAM;eAAd"}
\ No newline at end of file
{"version":3,"sources":["utssdk/test-uts/app-ios/index.uts"],"sourcesContent":["export function test(): string {\n return '1'\n}\n"],"names":[],"mappings":";AAAO,YAAS,UAAQ,MAAM,CAAC;IAC7B,OAAO;AACT;;;;mCAFwB,MAAM;eAAd;;;8BAAQ,MAAM"}
\ No newline at end of file
......@@ -121,13 +121,10 @@ public class AnimationViewComponent : UTSComponent<UIView> {
switch(action){
case "play":
self.playAnimation();
break;
case "pause":
self.animationView.pause();
break;
case "stop":
self.animationView.stop();
break;
default:
break;
}
......
......@@ -69,3 +69,9 @@ open class TestClass {
val showToast1: ShowToast = fun(msg){};
val showToast2: ShowToast = fun(msg) {};
val showToast3: ShowToast = fun(msg) {};
fun registerWithJSON(name: String, callback: UTSJSONObject) {
return register(name, UTSAndroid.parseObject(callback));
}
fun offMemoryWarningWithJSON() {
return offMemoryWarning();
}
......@@ -2,17 +2,38 @@ import DCloudUTSExtAPI;
import DCloudUTSFoundation;
public var uni_showToast = DCloudUTSExtAPI.showToast;
public var uni_showModel = DCloudUTSExtAPI.showModel;
typealias ShowToast = (_ msg: String) -> Void;
public typealias ShowToast = (_ msg: String) -> Void;
import UIKit;
import CoreLocation;
@objc(UTSSDKModulesTestUniPluginGetBatteryInfoOptions)
@objcMembers
public class GetBatteryInfoOptions : NSObject {
public class GetBatteryInfoOptions : NSObject, UTSCallbackDelegate {
public var name: String!;
public var pwd: NSNumber!;
public var success: UTSCallback?;
public var fail: UTSCallback?;
public var complete: UTSCallback?;
public func callUTSNativeCallback(_ name: String, _ callback: Any, _ args: [Any]) {
switch(name){
case "success":
typealias successType = (_ res: UTSJSONObject) -> Void;
if (callback is successType) {
(callback as! successType)(args[0] as! UTSJSONObject);
}
case "fail":
typealias failType = (_ res: UTSJSONObject) -> Void;
if (callback is failType) {
(callback as! failType)(args[0] as! UTSJSONObject);
}
case "complete":
typealias completeType = (_ res: UTSJSONObject) -> Void;
if (callback is completeType) {
(callback as! completeType)(args[0] as! UTSJSONObject);
}
default:
break;
}
}
}
public func getBatteryInfo(_ options: GetBatteryInfoOptions) {
UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert);
......@@ -113,3 +134,12 @@ public class IndexSwift : NSObject {
return showToast3(msg);
}
}
public func getBatteryInfoWithJSON(_ options: UTSJSONObject) {
return getBatteryInfo(UTSiOS.parseObject(options));
}
public func test1WithJSON(_ callback: UTSJSONObject) -> String {
return test1(UTSiOS.parseObject(callback));
}
public func testAsyncWithJSON() -> UTSJSONObject {
return testAsync();
}
......@@ -8,3 +8,6 @@ import io.dcloud.uts.*;
fun test(): Number {
return 1;
}
fun testWithJSON(): Number {
return test();
}
......@@ -9,3 +9,6 @@ public class IndexSwift : NSObject {
return test();
}
}
public func testWithJSON() -> String {
return test();
}
......@@ -1166,11 +1166,6 @@ var shims = /*#__PURE__*/Object.freeze({
getProvider: getProvider
});
const chooseImage = {
args: {
sizeType: false,
},
};
const connectSocket = {
args: {
method: false,
......@@ -1234,7 +1229,6 @@ const getFileInfo = {
var protocols = /*#__PURE__*/Object.freeze({
__proto__: null,
chooseImage: chooseImage,
chooseVideo: chooseVideo,
connectSocket: connectSocket,
getFileInfo: getFileInfo,
......
......@@ -6,3 +6,6 @@ import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.Map;
import io.dcloud.uts.*;
fun test() {}
fun testWithJSON() {
return test();
}
......@@ -7,3 +7,6 @@ public class IndexSwift : NSObject {
return test();
}
}
public func testWithJSON() {
return test();
}
......@@ -183,7 +183,7 @@ describe('uts:sourceMap', () => {
)
const { line, column, source } = await originalPositionFor({
sourceMapFile,
line: 19,
line: 40,
column: 16,
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册