Skip to content

Commit 2b03b3e

Browse files
committed
feat!: remove redundant types and reduce dependency on uni-app-types
1 parent 0d0c7bf commit 2b03b3e

File tree

112 files changed

+262
-294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+262
-294
lines changed

packages/uni-app-types/src/ad/ad-content-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdContentPageOnLoadEvent = BaseEvent;
@@ -142,7 +142,7 @@ type _AdContentPageProps = Partial<{
142142
}>;
143143

144144
/** 短视频内容联盟广告 */
145-
type _AdContentPage = Component<_AdContentPageProps>;
145+
type _AdContentPage = DefineComponent<_AdContentPageProps>;
146146

147147
/** 短视频内容联盟广告实例 */
148148
type _AdContentPageInstance = InstanceType<_AdContentPage>;

packages/uni-app-types/src/ad/ad-draw.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AnyRecord, Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdDrawOnLoadEvent = BaseEvent;
@@ -23,15 +23,15 @@ type _AdDrawProps = Partial<{
2323
/** APP 广告位 id */
2424
adpid: string;
2525
/** 广告数据 */
26-
data: AnyRecord;
26+
data: Record<string, any>;
2727
/** 广告加载成功的回调 */
2828
onLoad: _AdDrawOnLoad;
2929
/** 广告加载失败的回调 */
3030
onError: _AdDrawOnError;
3131
}>;
3232

3333
/** 沉浸视频流广告 */
34-
type _AdDraw = Component<_AdDrawProps>;
34+
type _AdDraw = DefineComponent<_AdDrawProps>;
3535

3636
/** 沉浸视频流广告实例 */
3737
type _AdDrawInstance = InstanceType<_AdDraw>;

packages/uni-app-types/src/ad/ad-fullscreen-video.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdFullscreenVideoOnLoadEvent = BaseEvent;
@@ -53,7 +53,7 @@ type _AdFullscreenVideoProps = Partial<{
5353
}>;
5454

5555
/** 全屏视频广告 */
56-
type _AdFullscreenVideo = Component<_AdFullscreenVideoProps>;
56+
type _AdFullscreenVideo = DefineComponent<_AdFullscreenVideoProps>;
5757

5858
/** 全屏视频广告实例 */
5959
type _AdFullscreenVideoInstance = InstanceType<_AdFullscreenVideo>;

packages/uni-app-types/src/ad/ad-interactive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdInteractiveOnLoadEvent = BaseEvent;
@@ -31,7 +31,7 @@ type _AdInteractiveProps = Partial<{
3131
}>;
3232

3333
/** 互动广告 */
34-
type _AdInteractive = Component<_AdInteractiveProps>;
34+
type _AdInteractive = DefineComponent<_AdInteractiveProps>;
3535

3636
/** 互动广告实例 */
3737
type _AdInteractiveInstance = InstanceType<_AdInteractive>;

packages/uni-app-types/src/ad/ad-interstitial.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdInterstitialOnLoadEvent = BaseEvent;
@@ -48,7 +48,7 @@ type _AdInterstitialProps = Partial<{
4848
}>;
4949

5050
/** 插屏广告 */
51-
type _AdInterstitial = Component<_AdInterstitialProps>;
51+
type _AdInterstitial = DefineComponent<_AdInterstitialProps>;
5252

5353
/** 插屏广告实例 */
5454
type _AdInterstitialInstance = InstanceType<_AdInterstitial>;

packages/uni-app-types/src/ad/ad-rewarded-video.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
/** 服务器回调透传数据 */
@@ -56,7 +56,7 @@ type _AdRewardedVideoProps = Partial<{
5656
}>;
5757

5858
/** 激励视频广告 */
59-
type _AdRewardedVideo = Component<_AdRewardedVideoProps>;
59+
type _AdRewardedVideo = DefineComponent<_AdRewardedVideoProps>;
6060

6161
/** 激励视频广告实例 */
6262
type _AdRewardedVideoInstance = InstanceType<_AdRewardedVideo>;

packages/uni-app-types/src/ad/ad.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AnyRecord, Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent, CustomEvent } from "../events";
33

44
type _AdOnLoadEvent = BaseEvent;
@@ -38,7 +38,7 @@ type _AdProps = Partial<{
3838
*/
3939
adIntervals: number;
4040
/** 广告数据,优先级高于 adpid */
41-
data: AnyRecord;
41+
data: Record<string, any>;
4242
/** 小程序应用 ID */
4343
appid: string;
4444
/** 小程序广告位 ID */
@@ -80,7 +80,7 @@ type _AdProps = Partial<{
8080
}>;
8181

8282
/** 信息流广告 */
83-
type _Ad = Component<_AdProps>;
83+
type _Ad = DefineComponent<_AdProps>;
8484

8585
/** 信息流广告实例 */
8686
type _AdInstance = InstanceType<_Ad>;

packages/uni-app-types/src/basic-components/icon.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22

33
/** 图标属性 */
44
type _IconProps = Partial<{
@@ -17,7 +17,7 @@ type _IconProps = Partial<{
1717
}>;
1818

1919
/** 图标 */
20-
type _Icon = Component<_IconProps>;
20+
type _Icon = DefineComponent<_IconProps>;
2121

2222
/** 图标实例 */
2323
type _IconInstance = InstanceType<_Icon>;

packages/uni-app-types/src/basic-components/progress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { BaseEvent } from "../events";
33

44
/**
@@ -92,7 +92,7 @@ type _ProgressProps = Partial<{
9292
}>;
9393

9494
/** 进度条 */
95-
type _Progress = Component<_ProgressProps>;
95+
type _Progress = DefineComponent<_ProgressProps>;
9696

9797
/** 进度条实例 */
9898
type _ProgressInstance = InstanceType<_Progress>;

packages/uni-app-types/src/basic-components/rich-text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AnyRecord, Component } from "../component";
1+
import type { DefineComponent } from "vue";
22
import type { CustomEvent } from "../events";
33

44
/** 显示连续空格 */
@@ -14,7 +14,7 @@ interface _RichTextTextNode {
1414
interface _RichTextNodeNode {
1515
type?: "node";
1616
name: string;
17-
attrs?: AnyRecord;
17+
attrs?: Record<string, any>;
1818
children?: Array<_RichTextTextNode | _RichTextNodeNode>;
1919
}
2020

@@ -66,7 +66,7 @@ type _RichTextProps = Partial<{
6666
}>;
6767

6868
/** 富文本 */
69-
type _RichText = Component<_RichTextProps>;
69+
type _RichText = DefineComponent<_RichTextProps>;
7070

7171
/** 富文本实例 */
7272
type _RichTextInstance = InstanceType<_RichText>;

0 commit comments

Comments
 (0)