From 42385c7a77da44680943acca9305f8ee0ff413fb Mon Sep 17 00:00:00 2001 From: PentaTea <2490445193@qq.com> Date: Sun, 30 Jan 2022 16:08:51 +0800 Subject: [PATCH] feat(preset): add uni-app --- src/presets/index.ts | 2 ++ src/presets/uni-app.ts | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/presets/uni-app.ts diff --git a/src/presets/index.ts b/src/presets/index.ts index a2f46a6b..6f0d59c7 100644 --- a/src/presets/index.ts +++ b/src/presets/index.ts @@ -25,6 +25,7 @@ import vueuseCore from './vueuse-core' import vueuseHead from './vueuse-head' import vuex from './vuex' import vitest from './vitest' +import uniApp from './uni-app' export const presets = { '@nuxtjs/composition-api': nuxtCompositionApi, @@ -51,6 +52,7 @@ export const presets = { 'vue': vue, 'vuex': vuex, 'vitest': vitest, + 'uni-app': uniApp, } export type PresetName = keyof typeof presets diff --git a/src/presets/uni-app.ts b/src/presets/uni-app.ts new file mode 100644 index 00000000..5d6346a2 --- /dev/null +++ b/src/presets/uni-app.ts @@ -0,0 +1,31 @@ +import type { ImportsMap } from "../types"; + +// @dcloudio/uni-app/dist/uni-app.d.ts +export default { + "@dcloudio/uni-app": [ + "onAddToFavorites", + "onBackPress", + "onError", + "onHide", + "onLaunch", + "onLoad", + "onNavigationBarButtonTap", + "onNavigationBarSearchInputChanged", + "onNavigationBarSearchInputClicked", + "onNavigationBarSearchInputConfirmed", + "onNavigationBarSearchInputFocusChanged", + "onPageNotFound", + "onPageScroll", + "onPullDownRefresh", + "onReachBottom", + "onReady", + "onResize", + "onShareAppMessage", + "onShareTimeline", + "onShow", + "onTabItemTap", + "onThemeChange", + "onUnhandledRejection", + "onUnload", + ], +};