From 89734a909e3674c1c9c6bed8e4138f8eca00c30b Mon Sep 17 00:00:00 2001
From: "Ray.Hao" <1490493387@qq.com>
Date: Sun, 8 Nov 2026 00:40:32 +0800
Subject: [PATCH] =?UTF-8?q?chore(types):=20=E5=88=A0=E9=99=A4=E4=B8=8E=20u?=
=?UTF-8?q?ni-types=20=E9=87=8D=E5=A4=8D=E7=9A=84=E5=8E=9F=E7=94=9F?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A3=B0=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 原生组件类型由 @uni-helper/uni-types 提供,手写声明冗余
- 去掉由 types 数组统一加载的重复三斜线引用
---
src/types/global.d.ts | 6 -
src/types/uni-components.d.ts | 220 ----------------------------------
2 files changed, 226 deletions(-)
delete mode 100644 src/types/uni-components.d.ts
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index 57c2848..05507a2 100644
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -1,12 +1,6 @@
// 全局类型声明文件
-// 自动引入 virtual 模块类型
///
-///
-///
-
-// 如果需要其他 virtual 模块类型,可以在这里添加
-// 例如:///
declare global {
/**
diff --git a/src/types/uni-components.d.ts b/src/types/uni-components.d.ts
deleted file mode 100644
index e2a1902..0000000
--- a/src/types/uni-components.d.ts
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * uni-app 原生组件类型声明
- *
- * 解决 Volar 对原生组件属性的类型检查问题
- * 这些类型声明扩展了 @uni-helper/uni-types 的基础类型
- */
-
-// 扩展 uni-app 原生组件属性类型
-declare module "@vue/runtime-core" {
- export interface GlobalComponents {
- view: import("vue").DefineComponent<{
- class?: string;
- style?: string | Record;
- hoverClass?: string;
- hoverStartTime?: number;
- hoverStayTime?: number;
- hoverStopPropagation?: boolean;
- onClick?: (event: any) => void;
- }>;
- text: import("vue").DefineComponent<{
- class?: string;
- style?: string | Record;
- selectable?: boolean;
- userSelect?: boolean;
- space?: "ensp" | "emsp" | "nbsp";
- decode?: boolean;
- onClick?: (event: any) => void;
- }>;
- image: import("vue").DefineComponent<{
- class?: string;
- style?: string | Record;
- src?: string;
- mode?:
- | "scaleToFill"
- | "aspectFit"
- | "aspectFill"
- | "widthFix"
- | "heightFix"
- | "top"
- | "bottom"
- | "center"
- | "left"
- | "right"
- | "top left"
- | "top right"
- | "bottom left"
- | "bottom right";
- lazyLoad?: boolean;
- fadeShow?: boolean;
- webp?: boolean;
- showMenuByLongpress?: boolean;
- onClick?: (event: any) => void;
- }>;
- button: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- size?: "default" | "mini";
- type?: "primary" | "default" | "warn";
- plain?: boolean;
- disabled?: boolean;
- loading?: boolean;
- formType?: "submit" | "reset";
- openType?:
- | "feedback"
- | "share"
- | "getUserInfo"
- | "contact"
- | "getPhoneNumber"
- | "launchApp"
- | "openSetting"
- | "getAuthorize"
- | "contactShare"
- | "livestream"
- | "getRealnameAuthInfo";
- hoverClass?: string;
- hoverStartTime?: number;
- hoverStayTime?: number;
- lang?: "en" | "zh_CN" | "zh_TW";
- sessionFrom?: string;
- sendMessageTitle?: string;
- sendMessagePath?: string;
- sendMessageImg?: string;
- showMessageCard?: boolean;
- appParameter?: string;
- onClick?: (event: any) => void;
- onGetphonenumber?: (event: any) => void;
- onGetuserinfo?: (event: any) => void;
- onContact?: (event: any) => void;
- onError?: (event: any) => void;
- onOpensetting?: (event: any) => void;
- onLaunchapp?: (event: any) => void;
- };
- };
- input: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- value?: string;
- type?: "text" | "number" | "idcard" | "digit" | "safe-password" | "nickname";
- password?: boolean;
- placeholder?: string;
- placeholderStyle?: string;
- placeholderClass?: string;
- disabled?: boolean;
- maxlength?: number | string;
- cursorSpacing?: number;
- autoFocus?: boolean;
- focus?: boolean;
- cursor?: number;
- selectionStart?: number;
- selectionEnd?: number;
- adjustPosition?: boolean;
- holdKeyboard?: boolean;
- alwaysEmbed?: boolean;
- confirmType?: "send" | "search" | "next" | "go" | "done";
- confirmHold?: boolean;
- onInput?: (event: any) => void;
- onFocus?: (event: any) => void;
- onBlur?: (event: any) => void;
- onConfirm?: (event: any) => void;
- };
- };
- textarea: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- value?: string;
- placeholder?: string;
- placeholderStyle?: string;
- placeholderClass?: string;
- disabled?: boolean;
- maxlength?: number | string;
- autoFocus?: boolean;
- focus?: boolean;
- autoHeight?: boolean;
- fixed?: boolean;
- cursorSpacing?: number;
- cursor?: number;
- showConfirmBar?: boolean;
- selectionStart?: number;
- selectionEnd?: number;
- adjustPosition?: boolean;
- holdKeyboard?: boolean;
- disableDefaultPadding?: boolean;
- confirmType?: "send" | "search" | "next" | "go" | "done";
- confirmHold?: boolean;
- onInput?: (event: any) => void;
- onFocus?: (event: any) => void;
- onBlur?: (event: any) => void;
- onConfirm?: (event: any) => void;
- onLinechange?: (event: any) => void;
- };
- };
- scrollview: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- scrollX?: boolean;
- scrollY?: boolean;
- upperThreshold?: number;
- lowerThreshold?: number;
- scrollTop?: number | string;
- scrollLeft?: number | string;
- scrollIntoView?: string;
- scrollWithAnimation?: boolean;
- enableBackToTop?: boolean;
- enableFlex?: boolean;
- scrollAnchors?: boolean;
- refresherEnabled?: boolean;
- refresherThreshold?: number;
- refresherDefaultStyle?: "black" | "white" | "none";
- refresherBackground?: string;
- refresherTriggered?: boolean;
- enhanced?: boolean;
- bounces?: boolean;
- showScrollbar?: boolean;
- pagingEnabled?: boolean;
- fastDeceleration?: boolean;
- onScrolltoupper?: (event: any) => void;
- onScrolltolower?: (event: any) => void;
- onScroll?: (event: any) => void;
- onRefresherrefresh?: (event: any) => void;
- onRefresherrestore?: (event: any) => void;
- onRefresherabort?: (event: any) => void;
- };
- };
- swiper: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- indicatorDots?: boolean;
- indicatorColor?: string;
- indicatorActiveColor?: string;
- autoplay?: boolean;
- current?: number;
- interval?: number;
- duration?: number;
- circular?: boolean;
- vertical?: boolean;
- previousMargin?: string;
- nextMargin?: string;
- displayMultipleItems?: number;
- skipHiddenItemLayout?: boolean;
- easingFunction?: "default" | "linear" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic";
- onChange?: (event: any) => void;
- onTransition?: (event: any) => void;
- onAnimationfinish?: (event: any) => void;
- };
- };
- swiperitem: new () => {
- $props: {
- class?: string;
- style?: string | Record;
- };
- };
- }
-}
-
-export {};