Kaynağa Gözat

fix: ts config

wjc 1 hafta önce
ebeveyn
işleme
5b9f73958a
5 değiştirilmiş dosya ile 147 ekleme ve 134 silme
  1. 33 0
      components.d.ts
  2. 1 1
      tsconfig.json
  3. 90 105
      types/auto-import.d.ts
  4. 15 22
      types/components.d.ts
  5. 8 6
      uni-pages.d.ts

+ 33 - 0
components.d.ts

@@ -0,0 +1,33 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// Generated by vite-plugin-uni-components
+// Read more: https://github.com/vuejs/core/pull/3399
+export {}
+
+declare module 'vue' {
+  export interface GlobalComponents {
+    MCard: typeof import('./src/components/MCard/index.vue')['default']
+    MConfigProvider: typeof import('./src/components/MConfigProvider/index.vue')['default']
+    MContent: typeof import('./src/components/MContent/index.vue')['default']
+    MContentTitle: typeof import('./src/components/MContentTitle/index.vue')['default']
+    MDialog: typeof import('./src/components/MDialog/index.vue')['default']
+    MDivider: typeof import('./src/components/MDivider/index.vue')['default']
+    MFooter: typeof import('./src/components/MFooter/index.vue')['default']
+    MIcon: typeof import('./src/components/MIcon/index.vue')['default']
+    MImage: typeof import('./src/components/MImage/index.vue')['default']
+    MNavBar: typeof import('./src/components/MNavBar/index.vue')['default']
+    MPicker: typeof import('./src/components/MPicker/index.vue')['default']
+    MSafeAreaTop: typeof import('./src/components/MSafeAreaTop/index.vue')['default']
+    MTabBar: typeof import('./src/components/MTabBar/index.vue')['default']
+    NutButton: typeof import('nutui-uniapp/components/button/button.vue')['default']
+    NutCheckbox: typeof import('nutui-uniapp/components/checkbox/checkbox.vue')['default']
+    NutConfigProvider: typeof import('nutui-uniapp/components/configprovider/configprovider.vue')['default']
+    NutDivider: typeof import('nutui-uniapp/components/divider/divider.vue')['default']
+    NutForm: typeof import('nutui-uniapp/components/form/form.vue')['default']
+    NutFormItem: typeof import('nutui-uniapp/components/formitem/formitem.vue')['default']
+    NutInput: typeof import('nutui-uniapp/components/input/input.vue')['default']
+    NutTabbar: typeof import('nutui-uniapp/components/tabbar/tabbar.vue')['default']
+    NutTabbarItem: typeof import('nutui-uniapp/components/tabbaritem/tabbaritem.vue')['default']
+  }
+}

+ 1 - 1
tsconfig.json

@@ -13,7 +13,7 @@
     "jsxFactory": "h",
     "jsxFragmentFactory": "Fragment",
     "module": "ESNext",
-    "moduleResolution": "Node",
+    "moduleResolution": "bundler",
     "noImplicitThis": true,
     "allowSyntheticDefaultImports": true,
     "allowJs": true,

+ 90 - 105
types/auto-import.d.ts

@@ -5,114 +5,99 @@
 // Generated by unplugin-auto-import
 export {}
 declare global {
-  const EffectScope: (typeof import('vue'))['EffectScope']
-  const Theme: (typeof import('../src/utils/const'))['Theme']
-  const computed: (typeof import('vue'))['computed']
-  const createApp: (typeof import('../src/main'))['createApp']
-  const customRef: (typeof import('vue'))['customRef']
-  const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent']
-  const defineComponent: (typeof import('vue'))['defineComponent']
-  const effectScope: (typeof import('vue'))['effectScope']
-  const getAppVersion: (typeof import('../src/utils/index'))['getAppVersion']
-  const getCurrentInstance: (typeof import('vue'))['getCurrentInstance']
-  const getCurrentScope: (typeof import('vue'))['getCurrentScope']
-  const h: (typeof import('vue'))['h']
-  const icons: (typeof import('../src/utils/icons'))['default']
-  const inject: (typeof import('vue'))['inject']
-  const isProxy: (typeof import('vue'))['isProxy']
-  const isReactive: (typeof import('vue'))['isReactive']
-  const isReadonly: (typeof import('vue'))['isReadonly']
-  const isRef: (typeof import('vue'))['isRef']
-  const langs: (typeof import('../src/utils/const'))['langs']
-  const markRaw: (typeof import('vue'))['markRaw']
-  const nextTick: (typeof import('vue'))['nextTick']
-  const onActivated: (typeof import('vue'))['onActivated']
-  const onAddToFavorites: (typeof import('@dcloudio/uni-app'))['onAddToFavorites']
-  const onBackPress: (typeof import('@dcloudio/uni-app'))['onBackPress']
-  const onBeforeMount: (typeof import('vue'))['onBeforeMount']
-  const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount']
-  const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate']
-  const onDeactivated: (typeof import('vue'))['onDeactivated']
-  const onError: (typeof import('@dcloudio/uni-app'))['onError']
-  const onErrorCaptured: (typeof import('vue'))['onErrorCaptured']
-  const onHide: (typeof import('@dcloudio/uni-app'))['onHide']
-  const onLaunch: (typeof import('@dcloudio/uni-app'))['onLaunch']
-  const onLoad: (typeof import('@dcloudio/uni-app'))['onLoad']
-  const onMounted: (typeof import('vue'))['onMounted']
-  const onNavigationBarButtonTap: (typeof import('@dcloudio/uni-app'))['onNavigationBarButtonTap']
-  const onNavigationBarSearchInputChanged: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputChanged']
-  const onNavigationBarSearchInputClicked: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputClicked']
-  const onNavigationBarSearchInputConfirmed: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputConfirmed']
-  const onNavigationBarSearchInputFocusChanged: (typeof import('@dcloudio/uni-app'))['onNavigationBarSearchInputFocusChanged']
-  const onPageNotFound: (typeof import('@dcloudio/uni-app'))['onPageNotFound']
-  const onPageScroll: (typeof import('@dcloudio/uni-app'))['onPageScroll']
-  const onPullDownRefresh: (typeof import('@dcloudio/uni-app'))['onPullDownRefresh']
-  const onReachBottom: (typeof import('@dcloudio/uni-app'))['onReachBottom']
-  const onReady: (typeof import('@dcloudio/uni-app'))['onReady']
-  const onRenderTracked: (typeof import('vue'))['onRenderTracked']
-  const onRenderTriggered: (typeof import('vue'))['onRenderTriggered']
-  const onResize: (typeof import('@dcloudio/uni-app'))['onResize']
-  const onScopeDispose: (typeof import('vue'))['onScopeDispose']
-  const onServerPrefetch: (typeof import('vue'))['onServerPrefetch']
-  const onShareAppMessage: (typeof import('@dcloudio/uni-app'))['onShareAppMessage']
-  const onShareTimeline: (typeof import('@dcloudio/uni-app'))['onShareTimeline']
-  const onShow: (typeof import('@dcloudio/uni-app'))['onShow']
-  const onTabItemTap: (typeof import('@dcloudio/uni-app'))['onTabItemTap']
-  const onThemeChange: (typeof import('@dcloudio/uni-app'))['onThemeChange']
-  const onUnhandledRejection: (typeof import('@dcloudio/uni-app'))['onUnhandledRejection']
-  const onUnload: (typeof import('@dcloudio/uni-app'))['onUnload']
-  const onUnmounted: (typeof import('vue'))['onUnmounted']
-  const onUpdated: (typeof import('vue'))['onUpdated']
-  const onWatcherCleanup: (typeof import('vue'))['onWatcherCleanup']
-  const provide: (typeof import('vue'))['provide']
-  const reactive: (typeof import('vue'))['reactive']
-  const readonly: (typeof import('vue'))['readonly']
-  const ref: (typeof import('vue'))['ref']
-  const resolveComponent: (typeof import('vue'))['resolveComponent']
-  const shallowReactive: (typeof import('vue'))['shallowReactive']
-  const shallowReadonly: (typeof import('vue'))['shallowReadonly']
-  const shallowRef: (typeof import('vue'))['shallowRef']
-  const themes: (typeof import('../src/utils/const'))['themes']
-  const toRaw: (typeof import('vue'))['toRaw']
-  const toRef: (typeof import('vue'))['toRef']
-  const toRefs: (typeof import('vue'))['toRefs']
-  const toValue: (typeof import('vue'))['toValue']
-  const triggerRef: (typeof import('vue'))['triggerRef']
-  const unref: (typeof import('vue'))['unref']
-  const useAttrs: (typeof import('vue'))['useAttrs']
-  const useCssModule: (typeof import('vue'))['useCssModule']
-  const useCssVars: (typeof import('vue'))['useCssVars']
-  const useId: (typeof import('vue'))['useId']
-  const useModel: (typeof import('vue'))['useModel']
-  const useRouteParam: (typeof import('../src/hooks/useRouteParam'))['default']
-  const useSafeAreaInsetTop: (typeof import('../src/hooks/useSafeAreaInsetTop'))['useSafeAreaInsetTop']
-  const useSlots: (typeof import('vue'))['useSlots']
-  const useTemplateRef: (typeof import('vue'))['useTemplateRef']
-  const useToast: (typeof import('nutui-uniapp/composables'))['useToast']
-  const useUserStore: (typeof import('../src/stores/modules/userStore'))['useUserStore']
-  const watch: (typeof import('vue'))['watch']
-  const watchEffect: (typeof import('vue'))['watchEffect']
-  const watchPostEffect: (typeof import('vue'))['watchPostEffect']
-  const watchSyncEffect: (typeof import('vue'))['watchSyncEffect']
+  const EffectScope: typeof import('vue')['EffectScope']
+  const Theme: typeof import('../src/utils/const')['Theme']
+  const computed: typeof import('vue')['computed']
+  const createApp: typeof import('../src/main')['createApp']
+  const customRef: typeof import('vue')['customRef']
+  const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
+  const defineComponent: typeof import('vue')['defineComponent']
+  const effectScope: typeof import('vue')['effectScope']
+  const getAppVersion: typeof import('../src/utils/index')['getAppVersion']
+  const getCurrentInstance: typeof import('vue')['getCurrentInstance']
+  const getCurrentScope: typeof import('vue')['getCurrentScope']
+  const h: typeof import('vue')['h']
+  const icons: typeof import('../src/utils/icons')['default']
+  const inject: typeof import('vue')['inject']
+  const isProxy: typeof import('vue')['isProxy']
+  const isReactive: typeof import('vue')['isReactive']
+  const isReadonly: typeof import('vue')['isReadonly']
+  const isRef: typeof import('vue')['isRef']
+  const langs: typeof import('../src/utils/const')['langs']
+  const markRaw: typeof import('vue')['markRaw']
+  const nextTick: typeof import('vue')['nextTick']
+  const onActivated: typeof import('vue')['onActivated']
+  const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
+  const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress']
+  const onBeforeMount: typeof import('vue')['onBeforeMount']
+  const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
+  const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
+  const onDeactivated: typeof import('vue')['onDeactivated']
+  const onError: typeof import('@dcloudio/uni-app')['onError']
+  const onErrorCaptured: typeof import('vue')['onErrorCaptured']
+  const onHide: typeof import('@dcloudio/uni-app')['onHide']
+  const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch']
+  const onLoad: typeof import('@dcloudio/uni-app')['onLoad']
+  const onMounted: typeof import('vue')['onMounted']
+  const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']
+  const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']
+  const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']
+  const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']
+  const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']
+  const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound']
+  const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll']
+  const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh']
+  const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom']
+  const onReady: typeof import('@dcloudio/uni-app')['onReady']
+  const onRenderTracked: typeof import('vue')['onRenderTracked']
+  const onRenderTriggered: typeof import('vue')['onRenderTriggered']
+  const onResize: typeof import('@dcloudio/uni-app')['onResize']
+  const onScopeDispose: typeof import('vue')['onScopeDispose']
+  const onServerPrefetch: typeof import('vue')['onServerPrefetch']
+  const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
+  const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
+  const onShow: typeof import('@dcloudio/uni-app')['onShow']
+  const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap']
+  const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange']
+  const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection']
+  const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
+  const onUnmounted: typeof import('vue')['onUnmounted']
+  const onUpdated: typeof import('vue')['onUpdated']
+  const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
+  const provide: typeof import('vue')['provide']
+  const reactive: typeof import('vue')['reactive']
+  const readonly: typeof import('vue')['readonly']
+  const ref: typeof import('vue')['ref']
+  const resolveComponent: typeof import('vue')['resolveComponent']
+  const shallowReactive: typeof import('vue')['shallowReactive']
+  const shallowReadonly: typeof import('vue')['shallowReadonly']
+  const shallowRef: typeof import('vue')['shallowRef']
+  const themes: typeof import('../src/utils/const')['themes']
+  const toRaw: typeof import('vue')['toRaw']
+  const toRef: typeof import('vue')['toRef']
+  const toRefs: typeof import('vue')['toRefs']
+  const toValue: typeof import('vue')['toValue']
+  const triggerRef: typeof import('vue')['triggerRef']
+  const unref: typeof import('vue')['unref']
+  const useAttrs: typeof import('vue')['useAttrs']
+  const useCssModule: typeof import('vue')['useCssModule']
+  const useCssVars: typeof import('vue')['useCssVars']
+  const useId: typeof import('vue')['useId']
+  const useModel: typeof import('vue')['useModel']
+  const useRouteParam: typeof import('../src/hooks/useRouteParam')['default']
+  const useSafeAreaInsetTop: typeof import('../src/hooks/useSafeAreaInsetTop')['useSafeAreaInsetTop']
+  const useSlots: typeof import('vue')['useSlots']
+  const useTemplateRef: typeof import('vue')['useTemplateRef']
+  const useToast: typeof import('nutui-uniapp/composables')['useToast']
+  const useUserStore: typeof import('../src/stores/modules/userStore')['useUserStore']
+  const watch: typeof import('vue')['watch']
+  const watchEffect: typeof import('vue')['watchEffect']
+  const watchPostEffect: typeof import('vue')['watchPostEffect']
+  const watchSyncEffect: typeof import('vue')['watchSyncEffect']
 }
 // for type re-export
 declare global {
   // @ts-ignore
-  export type {
-    Component,
-    ComponentPublicInstance,
-    ComputedRef,
-    DirectiveBinding,
-    ExtractDefaultPropTypes,
-    ExtractPropTypes,
-    ExtractPublicPropTypes,
-    InjectionKey,
-    PropType,
-    Ref,
-    MaybeRef,
-    MaybeRefOrGetter,
-    VNode,
-    WritableComputedRef,
-  } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 15 - 22
types/components.d.ts

@@ -1,32 +1,25 @@
-/*
- * @Author: wjc
- * @Date: 2025-04-09 10:19:11
- * @LastEditors: wjc
- * @LastEditTime: 2026-01-16 14:59:41
- * @Description:
- */
 /* eslint-disable */
-/* prettier-ignore */
 // @ts-nocheck
-// Generated by vite-plugin-uni-components
+// Generated by unplugin-vue-components
 // Read more: https://github.com/vuejs/core/pull/3399
 export {}
 
+/* prettier-ignore */
 declare module 'vue' {
   export interface GlobalComponents {
-    MCard: (typeof import('./src/components/MCard/index.vue'))['default']
-    MConfigProvider: (typeof import('./src/components/MConfigProvider/index.vue'))['default']
-    MContent: (typeof import('./src/components/MContent/index.vue'))['default']
-    MContentTitle: (typeof import('./src/components/MContentTitle/index.vue'))['default']
-    MDialog: (typeof import('./src/components/MDialog/index.vue'))['default']
-    MDivider: (typeof import('./src/components/MDivider/index.vue'))['default']
-    MFooter: (typeof import('./src/components/MFooter/index.vue'))['default']
-    MIcon: (typeof import('./src/components/MIcon/index.vue'))['default']
-    MImage: (typeof import('./src/components/MImage/index.vue'))['default']
-    MNavBar: (typeof import('./src/components/MNavBar/index.vue'))['default']
-    MPicker: (typeof import('./src/components/MPicker/index.vue'))['default']
-    MSafeAreaTop: (typeof import('./src/components/MSafeAreaTop/index.vue'))['default']
-    MTabBar: (typeof import('./src/components/MTabBar/index.vue'))['default']
+    MCard: typeof import('./../src/components/MCard/index.vue')['default']
+    MConfigProvider: typeof import('./../src/components/MConfigProvider/index.vue')['default']
+    MContent: typeof import('./../src/components/MContent/index.vue')['default']
+    MContentTitle: typeof import('./../src/components/MContentTitle/index.vue')['default']
+    MDialog: typeof import('./../src/components/MDialog/index.vue')['default']
+    MDivider: typeof import('./../src/components/MDivider/index.vue')['default']
+    MFooter: typeof import('./../src/components/MFooter/index.vue')['default']
+    MIcon: typeof import('./../src/components/MIcon/index.vue')['default']
+    MImage: typeof import('./../src/components/MImage/index.vue')['default']
+    MNavBar: typeof import('./../src/components/MNavBar/index.vue')['default']
+    MPicker: typeof import('./../src/components/MPicker/index.vue')['default']
+    MSafeAreaTop: typeof import('./../src/components/MSafeAreaTop/index.vue')['default']
+    MTabBar: typeof import('./../src/components/MTabBar/index.vue')['default']
     NutButton: (typeof import('nutui-uniapp/components/button/button.vue'))['default']
     NutCheckbox: (typeof import('nutui-uniapp/components/checkbox/checkbox.vue'))['default']
     NutConfigProvider: (typeof import('nutui-uniapp/components/configprovider/configprovider.vue'))['default']

+ 8 - 6
uni-pages.d.ts

@@ -15,13 +15,15 @@ interface NavigateToOptions {
 }
 interface RedirectToOptions extends NavigateToOptions {}
 
-interface SwitchTabOptions {}
+interface SwitchTabOptions {
+  
+}
 
-type ReLaunchOptions = NavigateToOptions | SwitchTabOptions
+type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;
 
 declare interface Uni {
-  navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void
-  redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void
-  switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void
-  reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void
+  navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
+  redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
+  switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
+  reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
 }