@bettergi/types 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/bindings/Color.d.ts +12 -0
  2. package/bindings/Pen.d.ts +12 -0
  3. package/bindings/RealtimeTimer.d.ts +1 -1
  4. package/bindings/characterDevelopmentTask.d.ts +11 -0
  5. package/bindings/getAvatars.d.ts +3 -2
  6. package/index.d.ts +3 -0
  7. package/package.json +1 -1
  8. package/types/BetterGenshinImpact/Core/BgiVision/BvFlow.d.ts +243 -0
  9. package/types/BetterGenshinImpact/Core/BgiVision/BvFlowAction.d.ts +249 -0
  10. package/types/BetterGenshinImpact/Core/BgiVision/BvLocator.d.ts +16 -21
  11. package/types/BetterGenshinImpact/Core/BgiVision/BvPage.d.ts +22 -0
  12. package/types/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts +3 -3
  13. package/types/BetterGenshinImpact/Core/Script/Dependence/AutoPathingScript.d.ts +1 -1
  14. package/types/BetterGenshinImpact/Core/Script/Dependence/Dispatcher.d.ts +5 -4
  15. package/types/BetterGenshinImpact/Core/Script/Dependence/Genshin.d.ts +29 -11
  16. package/types/BetterGenshinImpact/Core/Script/Dependence/Http.d.ts +1 -0
  17. package/types/BetterGenshinImpact/Core/Script/Dependence/KeyMouseHook.d.ts +1 -0
  18. package/types/BetterGenshinImpact/Core/Script/Dependence/LimitedFile.d.ts +12 -5
  19. package/types/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer.d.ts +63 -8
  20. package/types/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask.d.ts +4 -1
  21. package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossConfig.d.ts +68 -3
  22. package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossParam.d.ts +12 -4
  23. package/types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam.d.ts +11 -9
  24. package/types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.d.ts +61 -0
  25. package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.d.ts +102 -2
  26. package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam.d.ts +49 -6
  27. package/types/BetterGenshinImpact/GameTask/AutoFight/Config/CombatAvatar.d.ts +153 -5
  28. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar.d.ts +137 -31
  29. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/CombatScenes.d.ts +13 -13
  30. package/types/BetterGenshinImpact/GameTask/AutoFight/Script/CombatCommand.d.ts +3 -3
  31. package/types/BetterGenshinImpact/GameTask/AutoFight/Script/CombatScript.d.ts +3 -2
  32. package/types/BetterGenshinImpact/GameTask/AutoFight/Script/Method.d.ts +63 -3
  33. package/types/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropFightConfig.d.ts +4 -3
  34. package/types/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropParam.d.ts +1 -0
  35. package/types/BetterGenshinImpact/GameTask/AutoPathing/PathingScriptNames.d.ts +50 -0
  36. package/types/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipConfig.d.ts +2 -0
  37. package/types/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtConfig.d.ts +5 -3
  38. package/types/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtParam.d.ts +6 -4
  39. package/types/BetterGenshinImpact/GameTask/CharacterDevelopment/CharacterDevelopmentTask.d.ts +158 -0
  40. package/types/BetterGenshinImpact/GameTask/Common/Job/CraftMaterialTask.d.ts +19 -2
  41. package/types/BetterGenshinImpact/GameTask/Common/Map/MapScriptNames.d.ts +9 -0
  42. package/types/BetterGenshinImpact/GameTask/Model/Area/GameCaptureRegion.d.ts +6 -7
  43. package/types/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts +18 -15
  44. package/types/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts +5 -0
  45. package/types/BetterGenshinImpact/GameTask/Model/GameUI/GridScreenName.d.ts +1 -1
  46. package/types/BetterGenshinImpact/Helpers/User32Helper.d.ts +7 -0
@@ -0,0 +1,158 @@
1
+ import type {
2
+ ClrHostValue,
3
+ HostType,
4
+ PublicDefaultConstructorTrait,
5
+ ReferenceTypeTrait
6
+ } from "../../../Microsoft/ClearScript/HostType";
7
+ import "../../../System/Collections/Generic/IEnumerable";
8
+ import "../../../System/Collections/Generic/List";
9
+ import type { AvatarName } from "../AutoFight/Model/Avatar";
10
+
11
+ /**
12
+ * 角色元素类型
13
+ * 来源:上游 `Assets/Model/AvatarGridIcon/avatar.csv` 的 `element_type`
14
+ * @since 0.63.0
15
+ */
16
+ export type CharacterElementType = "火" | "水" | "雷" | "冰" | "风" | "岩" | "草" | (string & {});
17
+
18
+ /**
19
+ * 单个角色的养成信息识别结果;未请求或未识别的字段为 null
20
+ * @since 0.63.0
21
+ */
22
+ declare const characterDevelopmentResultBrand: unique symbol;
23
+ export interface CharacterDevelopmentResult extends ClrHostValue {
24
+ readonly [characterDevelopmentResultBrand]: true;
25
+ /**
26
+ * 调用方传入并规范化后的角色名称
27
+ * @since 0.63.0
28
+ */
29
+ characterName: AvatarName;
30
+ /**
31
+ * 角色元素类型;旅行者和奇偶由模型识别,其余角色来自头像原型表
32
+ * @since 0.63.0
33
+ */
34
+ elementType: CharacterElementType | null;
35
+ /**
36
+ * 角色当前等级
37
+ * @since 0.63.0
38
+ */
39
+ level: number | null;
40
+ /**
41
+ * 角色当前等级上限
42
+ * @since 0.63.0
43
+ */
44
+ levelLimit: number | null;
45
+ /**
46
+ * 经物品原型表编辑距离纠错后的标准武器名称
47
+ * @since 0.63.0
48
+ */
49
+ weaponName: string | null;
50
+ /**
51
+ * 武器当前等级
52
+ * @since 0.63.0
53
+ */
54
+ weaponLevel: number | null;
55
+ /**
56
+ * 武器当前等级上限
57
+ * @since 0.63.0
58
+ */
59
+ weaponLevelLimit: number | null;
60
+ /**
61
+ * 普通攻击的界面显示等级
62
+ * @since 0.63.0
63
+ */
64
+ attackLevel: number | null;
65
+ /**
66
+ * 普通攻击是否显示命座带来的固定等级加成
67
+ * @since 0.63.0
68
+ */
69
+ attackHasBonus: boolean | null;
70
+ /**
71
+ * 元素战技的界面显示等级
72
+ * @since 0.63.0
73
+ */
74
+ skillLevel: number | null;
75
+ /**
76
+ * 元素战技是否显示命座带来的固定等级加成
77
+ * @since 0.63.0
78
+ */
79
+ skillHasBonus: boolean | null;
80
+ /**
81
+ * 元素爆发的界面显示等级
82
+ * @since 0.63.0
83
+ */
84
+ burstLevel: number | null;
85
+ /**
86
+ * 元素爆发是否显示命座带来的固定等级加成
87
+ * @since 0.63.0
88
+ */
89
+ burstHasBonus: boolean | null;
90
+ }
91
+
92
+ /**
93
+ * 角色养成信息识别任务入口
94
+ * @since 0.63.0
95
+ */
96
+ declare const characterDevelopmentTaskBrand: unique symbol;
97
+ export interface CharacterDevelopmentTask extends ClrHostValue {
98
+ readonly [characterDevelopmentTaskBrand]: true;
99
+ /**
100
+ * 识别单个角色的养成信息
101
+ * @param characterName 目标角色名称或已有别名
102
+ * @param categories 以分号分隔的 `属性`、`武器`、`天赋` 分类,null 表示全部
103
+ * @returns 在任务完成后兑现识别结果的 Promise
104
+ * @since 0.63.0
105
+ */
106
+ getCharacter(characterName: AvatarName): Promise<CharacterDevelopmentResult>;
107
+ getCharacter(
108
+ characterName: AvatarName,
109
+ categories: string | null
110
+ ): Promise<CharacterDevelopmentResult>;
111
+ /**
112
+ * 识别多个角色的养成信息
113
+ * @param characterNames 字符串集合或 ClearScript JS Array;不得为空或传入单个字符串
114
+ * @param categories 以分号分隔的 `属性`、`武器`、`天赋` 分类,null 表示全部
115
+ * @returns 在任务完成后兑现识别结果列表的 Promise
116
+ * @since 0.63.0
117
+ */
118
+ getMultiCharacters(
119
+ characterNames: readonly AvatarName[] | System.Collections.Generic.IEnumerableInput<AvatarName>
120
+ ): Promise<System.Collections.Generic.List<CharacterDevelopmentResult>>;
121
+ getMultiCharacters(
122
+ characterNames: readonly AvatarName[] | System.Collections.Generic.IEnumerableInput<AvatarName>,
123
+ categories: string | null
124
+ ): Promise<System.Collections.Generic.List<CharacterDevelopmentResult>>;
125
+ }
126
+
127
+ declare global {
128
+ namespace BetterGenshinImpact.GameTask.CharacterDevelopment {
129
+ type CharacterElementType = import("./CharacterDevelopmentTask").CharacterElementType;
130
+ type CharacterDevelopmentResult =
131
+ import("./CharacterDevelopmentTask").CharacterDevelopmentResult;
132
+ type CharacterDevelopmentTask = import("./CharacterDevelopmentTask").CharacterDevelopmentTask;
133
+ }
134
+ }
135
+
136
+ export interface CharacterDevelopmentResultHostType extends HostType<
137
+ CharacterDevelopmentResult,
138
+ ReferenceTypeTrait & PublicDefaultConstructorTrait
139
+ > {
140
+ /**
141
+ * 构造空识别结果
142
+ * @since 0.63.0
143
+ */
144
+ new (): CharacterDevelopmentResult;
145
+ }
146
+
147
+ export interface CharacterDevelopmentTaskHostType extends HostType<
148
+ CharacterDevelopmentTask,
149
+ ReferenceTypeTrait & PublicDefaultConstructorTrait
150
+ > {
151
+ /**
152
+ * 构造角色养成信息识别任务
153
+ * @since 0.63.0
154
+ */
155
+ new (): CharacterDevelopmentTask;
156
+ }
157
+
158
+ export {};
@@ -9,6 +9,22 @@ import type {
9
9
  import "../../../../System/Collections/Generic/List";
10
10
  import "../Reward/RewardItem";
11
11
 
12
+ /**
13
+ * 合成台材料筛选类型
14
+ * 来源:`Assets/Model/ItemV2/item.csv` 的 `material_type` 去重集合
15
+ * @since 0.62.0
16
+ */
17
+ export type CraftMaterialType =
18
+ | "武器突破素材"
19
+ | "消耗品"
20
+ | "药剂"
21
+ | "角色与武器培养素材"
22
+ | "角色天赋素材"
23
+ | "角色突破素材"
24
+ | "食物"
25
+ | "鱼饵"
26
+ | (string & {});
27
+
12
28
  /**
13
29
  * 合成指定材料的执行结果
14
30
  * @since 0.62.0
@@ -40,7 +56,7 @@ export interface CraftMaterialResult extends ClrHostValue {
40
56
  * 本次使用的材料筛选类型
41
57
  * @since 0.62.0
42
58
  */
43
- materialType: string;
59
+ materialType: CraftMaterialType;
44
60
  /**
45
61
  * 本次合成产物汇总
46
62
  * @since 0.62.0
@@ -51,6 +67,7 @@ export interface CraftMaterialResult extends ClrHostValue {
51
67
  declare global {
52
68
  namespace BetterGenshinImpact.GameTask.Common.Job {
53
69
  type CraftMaterialResult = import("./CraftMaterialTask").CraftMaterialResult;
70
+ type CraftMaterialType = import("./CraftMaterialTask").CraftMaterialType;
54
71
  }
55
72
  }
56
73
 
@@ -77,7 +94,7 @@ export interface CraftMaterialResultHostType extends HostType<
77
94
  materialName: string,
78
95
  targetQuantity: number | StrongNumeric<Int32Host>,
79
96
  actualQuantity: number | StrongNumeric<Int32Host>,
80
- materialType: string,
97
+ materialType: CraftMaterialType,
81
98
  rewards: System.Collections.Generic.List<BetterGenshinImpact.GameTask.Common.Reward.RewardItem>
82
99
  ): BetterGenshinImpact.GameTask.Common.Job.CraftMaterialResult;
83
100
  }
@@ -43,4 +43,13 @@ export type MapMatchMethod =
43
43
  | "SIFT" // SIFT 特征匹配
44
44
  | (string & {});
45
45
 
46
+ declare global {
47
+ namespace BetterGenshinImpact.GameTask.Common.Map {
48
+ type Area = import("./MapScriptNames").Area;
49
+ type CountryName = import("./MapScriptNames").CountryName;
50
+ type MapMatchMethod = import("./MapScriptNames").MapMatchMethod;
51
+ type MapName = import("./MapScriptNames").MapName;
52
+ }
53
+ }
54
+
46
55
  export {};
@@ -9,7 +9,6 @@ import type { VoidResult } from "../../../../Microsoft/ClearScript/VoidResult";
9
9
  import "../../../../OpenCvSharp/Mat";
10
10
  import "../../../../OpenCvSharp/Size";
11
11
  import "../../../../System/Drawing/Pen";
12
- import "../../../../System/Func";
13
12
  import "../../../../System/IDisposable";
14
13
  import "../../../../System/ValueTuple";
15
14
  import "../../../View/Drawable/DrawContent";
@@ -146,30 +145,30 @@ export interface GameCaptureRegionHostType extends HostType<GameCaptureRegion, R
146
145
  ): GameCaptureRegion;
147
146
  /**
148
147
  * 在游戏截图坐标系点击;回调参数为当前捕获尺寸与到 1080P 的缩放比,魔法数字须按 1080P 编写
149
- * @param posFunc 根据捕获尺寸与 1080P 缩放比计算点击坐标的回调
148
+ * @param posFunc 根据捕获尺寸与 1080P 缩放比计算点击坐标的脚本回调,返回坐标 ValueTuple 宿主对象
150
149
  * @returns ClearScript 宿主空结果
151
150
  * @since 0.43.1
152
151
  */
153
152
  gameRegionClick(
154
- posFunc: System.Func<OpenCvSharp.Size, number, System.ValueTuple<number, number>>
153
+ posFunc: (size: OpenCvSharp.Size, scale: number) => System.ValueTuple<number, number>
155
154
  ): VoidResult;
156
155
  /**
157
156
  * 在游戏截图坐标系移动鼠标;回调参数为当前捕获尺寸与到 1080P 的缩放比
158
- * @param posFunc 根据捕获尺寸与 1080P 缩放比计算目标坐标的回调
157
+ * @param posFunc 根据捕获尺寸与 1080P 缩放比计算目标坐标的脚本回调,返回坐标 ValueTuple 宿主对象
159
158
  * @returns ClearScript 宿主空结果
160
159
  * @since 0.43.1
161
160
  */
162
161
  gameRegionMove(
163
- posFunc: System.Func<OpenCvSharp.Size, number, System.ValueTuple<number, number>>
162
+ posFunc: (size: OpenCvSharp.Size, scale: number) => System.ValueTuple<number, number>
164
163
  ): VoidResult;
165
164
  /**
166
165
  * 在游戏截图坐标系按偏移移动鼠标;回调参数为当前捕获尺寸与到 1080P 的缩放比
167
- * @param deltaFunc 根据捕获尺寸与 1080P 缩放比计算偏移量的回调
166
+ * @param deltaFunc 根据捕获尺寸与 1080P 缩放比计算偏移量的脚本回调,返回偏移 ValueTuple 宿主对象
168
167
  * @returns ClearScript 宿主空结果
169
168
  * @since 0.43.1
170
169
  */
171
170
  gameRegionMoveBy(
172
- deltaFunc: System.Func<OpenCvSharp.Size, number, System.ValueTuple<number, number>>
171
+ deltaFunc: (size: OpenCvSharp.Size, scale: number) => System.ValueTuple<number, number>
173
172
  ): VoidResult;
174
173
  /**
175
174
  * 按 1080P 坐标点击,自动换算到当前捕获分辨率
@@ -10,7 +10,6 @@ import "../../../../OpenCvSharp/Mat";
10
10
  import "../../../../OpenCvSharp/Rect";
11
11
  import "../../../../SixLabors/ImageSharp/Image";
12
12
  import "../../../../SixLabors/ImageSharp/PixelFormats/Rgb24";
13
- import "../../../../System/Action";
14
13
  import "../../../../System/Collections/Generic/List";
15
14
  import "../../../../System/IDisposable";
16
15
  import "../../../Core/Recognition/RecognitionObject";
@@ -83,8 +82,8 @@ export interface ImageRegion
83
82
  /**
84
83
  * 在本区域内查找最优识别结果;支持模板匹配、OCR 匹配与 OCR 识别
85
84
  * @param ro 识别对象
86
- * @param successAction 找到时的回调
87
- * @param failAction 未找到时的回调
85
+ * @param successAction 找到时的脚本回调
86
+ * @param failAction 未找到时的脚本回调
88
87
  * @returns 最优识别区域;未找到时为空区域
89
88
  * @since 0.43.1
90
89
  */
@@ -93,18 +92,18 @@ export interface ImageRegion
93
92
  ): BetterGenshinImpact.GameTask.Model.Area.Region;
94
93
  find(
95
94
  ro: BetterGenshinImpact.Core.Recognition.RecognitionObject,
96
- successAction: System.Action<BetterGenshinImpact.GameTask.Model.Area.Region> | null
95
+ successAction: ((region: BetterGenshinImpact.GameTask.Model.Area.Region) => void) | null
97
96
  ): BetterGenshinImpact.GameTask.Model.Area.Region;
98
97
  find(
99
98
  ro: BetterGenshinImpact.Core.Recognition.RecognitionObject,
100
- successAction: System.Action<BetterGenshinImpact.GameTask.Model.Area.Region> | null,
101
- failAction: System.Action | null
99
+ successAction: ((region: BetterGenshinImpact.GameTask.Model.Area.Region) => void) | null,
100
+ failAction: (() => void) | null
102
101
  ): BetterGenshinImpact.GameTask.Model.Area.Region;
103
102
  /**
104
103
  * 在本区域内查找全部识别结果;仅支持模板匹配与 OCR
105
104
  * @param ro 识别对象
106
- * @param successAction 找到时的回调
107
- * @param failAction 未找到时的回调
105
+ * @param successAction 找到时的脚本回调
106
+ * @param failAction 未找到时的脚本回调
108
107
  * @returns 识别区域列表,不含内嵌图像
109
108
  * @since 0.43.1
110
109
  */
@@ -113,16 +112,20 @@ export interface ImageRegion
113
112
  ): System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>;
114
113
  findMulti(
115
114
  ro: BetterGenshinImpact.Core.Recognition.RecognitionObject,
116
- successAction: System.Action<
117
- System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
118
- > | null
115
+ successAction:
116
+ | ((
117
+ regions: System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
118
+ ) => void)
119
+ | null
119
120
  ): System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>;
120
121
  findMulti(
121
122
  ro: BetterGenshinImpact.Core.Recognition.RecognitionObject,
122
- successAction: System.Action<
123
- System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
124
- > | null,
125
- failAction: System.Action | null
123
+ successAction:
124
+ | ((
125
+ regions: System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
126
+ ) => void)
127
+ | null,
128
+ failAction: (() => void) | null
126
129
  ): System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>;
127
130
  /**
128
131
  * 释放资源
@@ -70,6 +70,11 @@ export interface Region extends ClrHostValue, System.IDisposableInput {
70
70
  * @since 0.43.1
71
71
  */
72
72
  text: string;
73
+ /**
74
+ * 模板匹配得分,值越大表示匹配程度越高;非模板匹配结果为 null
75
+ * @since 0.63.0
76
+ */
77
+ matchScore: number | null;
73
78
  /**
74
79
  * 上一层区域节点
75
80
  * @since 0.43.1
@@ -87,7 +87,7 @@ export interface GridScreenNameHostType extends HostType<GridScreenName, EnumTyp
87
87
  readonly crafting: GridScreenName;
88
88
  /**
89
89
  * 队伍配置快速编队界面的左侧角色头像网格
90
- * @since unreleased
90
+ * @since 0.63.0
91
91
  */
92
92
  readonly partySetupCharacters: GridScreenName;
93
93
  }
@@ -223,4 +223,11 @@ export type Key =
223
223
  export type KeyCode =
224
224
  Uppercase<Key> | Lowercase<Key> | Uppercase<`VK_${Key}`> | Lowercase<`VK_${Key}`> | (string & {});
225
225
 
226
+ declare global {
227
+ namespace BetterGenshinImpact.Helpers {
228
+ type Key = import("./User32Helper").Key;
229
+ type KeyCode = import("./User32Helper").KeyCode;
230
+ }
231
+ }
232
+
226
233
  export {};