@bettergi/types 0.0.11 → 0.0.13

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 (73) hide show
  1. package/README.md +8 -0
  2. package/csharp/BetterGenshinImpact/Core/Recognition/OcrEngineTypes.d.ts +13 -7
  3. package/csharp/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts +151 -142
  4. package/csharp/BetterGenshinImpact/Core/Recognition/RecognitionTypes.d.ts +20 -14
  5. package/csharp/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer.d.ts +20 -14
  6. package/csharp/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask.d.ts +12 -7
  7. package/csharp/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam.d.ts +72 -0
  8. package/csharp/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.d.ts +40 -0
  9. package/csharp/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam.d.ts +113 -0
  10. package/csharp/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.d.ts +40 -0
  11. package/csharp/BetterGenshinImpact/GameTask/ISoloTask.d.ts +13 -0
  12. package/csharp/BetterGenshinImpact/GameTask/Model/Area/Converter/INodeConverter.d.ts +8 -2
  13. package/csharp/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts +65 -52
  14. package/csharp/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts +190 -136
  15. package/csharp/BetterGenshinImpact/GameTask/Model/BaseTaskParam.d.ts +13 -0
  16. package/csharp/BetterGenshinImpact/View/Drawable/DrawContent.d.ts +45 -0
  17. package/csharp/BetterGenshinImpact/View/Drawable/LineDrawable.d.ts +17 -9
  18. package/csharp/BetterGenshinImpact/View/Drawable/RectDrawable.d.ts +20 -10
  19. package/csharp/Microsoft/Extensions/Localization/IStringLocalizer.d.ts +16 -0
  20. package/csharp/Microsoft/Extensions/Localization/LocalizedString.d.ts +26 -0
  21. package/csharp/SixLabors/ImageSharp/Image.d.ts +9 -0
  22. package/csharp/System/Collections/DictionaryEntry.d.ts +14 -0
  23. package/csharp/System/Collections/Generic/Dictionary.d.ts +193 -34
  24. package/csharp/System/Collections/Generic/ICollection.d.ts +15 -9
  25. package/csharp/System/Collections/Generic/IDictionary.d.ts +11 -22
  26. package/csharp/System/Collections/Generic/IEnumerable.d.ts +10 -3
  27. package/csharp/System/Collections/Generic/IEnumerator.d.ts +10 -5
  28. package/csharp/System/Collections/Generic/IEqualityComparer.d.ts +9 -3
  29. package/csharp/System/Collections/Generic/IList.d.ts +16 -7
  30. package/csharp/System/Collections/Generic/IReadOnlyCollection.d.ts +9 -3
  31. package/csharp/System/Collections/Generic/IReadOnlyDictionary.d.ts +15 -10
  32. package/csharp/System/Collections/Generic/IReadOnlyList.d.ts +9 -3
  33. package/csharp/System/Collections/Generic/KeyValuePair.d.ts +15 -8
  34. package/csharp/System/Collections/Generic/List.d.ts +149 -77
  35. package/csharp/System/Collections/ICollection.d.ts +17 -0
  36. package/csharp/System/Collections/IDictionary.d.ts +29 -0
  37. package/csharp/System/Collections/IDictionaryEnumerator.d.ts +14 -0
  38. package/csharp/System/Collections/IEnumerable.d.ts +9 -0
  39. package/csharp/System/Collections/IEnumerator.d.ts +13 -0
  40. package/csharp/System/Collections/IList.d.ts +30 -0
  41. package/csharp/System/DateTimeOffset.d.ts +8 -0
  42. package/csharp/System/Drawing/Bitmap.d.ts +8 -2
  43. package/csharp/System/Drawing/Color.d.ts +341 -2
  44. package/csharp/System/Drawing/Image.d.ts +8 -2
  45. package/csharp/System/Drawing/KnownColor.d.ts +357 -0
  46. package/csharp/System/Drawing/Pen.d.ts +8 -2
  47. package/csharp/System/Globalization/CultureInfo.d.ts +9 -0
  48. package/csharp/System/IAsyncDisposable.d.ts +10 -0
  49. package/csharp/System/IDisposable.d.ts +9 -0
  50. package/csharp/System/IEquatable.d.ts +8 -0
  51. package/csharp/System/Runtime/Serialization/IDeserializationCallback.d.ts +9 -0
  52. package/csharp/System/Runtime/Serialization/ISerializable.d.ts +9 -0
  53. package/csharp/System/Threading/CancellationToken.d.ts +58 -0
  54. package/csharp/System/Threading/CancellationTokenRegistration.d.ts +27 -0
  55. package/csharp/System/Threading/CancellationTokenSource.d.ts +51 -0
  56. package/csharp/System/Threading/ITimer.d.ts +12 -0
  57. package/csharp/System/Threading/Tasks/ValueTask.d.ts +12 -0
  58. package/csharp/System/Threading/WaitHandle.d.ts +8 -0
  59. package/csharp/System/TimeProvider.d.ts +31 -0
  60. package/csharp/System/TimeSpan.d.ts +8 -0
  61. package/csharp/System/Windows/Media/Matrix.d.ts +80 -0
  62. package/csharp/System/Windows/Point.d.ts +39 -5
  63. package/csharp/System/Windows/Vector.d.ts +51 -0
  64. package/modules/dispatcher.d.ts +54 -3
  65. package/modules/file.d.ts +3 -3
  66. package/modules/genshin.d.ts +18 -1
  67. package/modules/globalMethod.d.ts +9 -5
  68. package/modules/http.d.ts +23 -21
  69. package/package.json +1 -1
  70. package/csharp/Vanara/PInvoke/POINT.d.ts +0 -23
  71. package/csharp/Vanara/PInvoke/RECT.d.ts +0 -37
  72. package/csharp/Vanara/PInvoke/SIZE.d.ts +0 -19
  73. package/enums/wood.d.ts +0 -27
@@ -0,0 +1,10 @@
1
+ import "./Threading/Tasks/ValueTask";
2
+
3
+ declare global {
4
+ namespace System {
5
+ interface IAsyncDisposable {
6
+ disposeAsync(): System.Threading.Tasks.ValueTask;
7
+ }
8
+ }
9
+ }
10
+ export {};
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace System {
3
+ interface IDisposable {
4
+ dispose(): void;
5
+ }
6
+ }
7
+ }
8
+
9
+ export {};
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ namespace System {
3
+ interface IEquatable<T> {
4
+ equals(other: T | null): boolean;
5
+ }
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace System.Runtime.Serialization {
3
+ interface IDeserializationCallback {
4
+ onDeserialization(sender: any): void;
5
+ }
6
+ }
7
+ }
8
+
9
+ export {};
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace System.Runtime.Serialization {
3
+ interface ISerializable {
4
+ // TODO: 待补充(如果有必要)
5
+ }
6
+ }
7
+ }
8
+
9
+ export {};
@@ -0,0 +1,58 @@
1
+ import "../IEquatable";
2
+ import "./CancellationTokenRegistration";
3
+ import "./WaitHandle";
4
+
5
+ declare global {
6
+ namespace System.Threading {
7
+ class CancellationToken implements System.IEquatable<CancellationToken> {
8
+ isCancellationRequested: boolean;
9
+
10
+ canBeCanceled: boolean;
11
+
12
+ waitHandle: System.Threading.WaitHandle;
13
+
14
+ register(callback: () => void): System.Threading.CancellationTokenRegistration;
15
+
16
+ register(
17
+ callback: () => void,
18
+ useSynchronizationContext: boolean
19
+ ): System.Threading.CancellationTokenRegistration;
20
+
21
+ register(
22
+ callback: (obj: any) => void,
23
+ state: any
24
+ ): System.Threading.CancellationTokenRegistration;
25
+
26
+ register(
27
+ callback: (obj: any) => System.Threading.CancellationToken,
28
+ state: any
29
+ ): System.Threading.CancellationTokenRegistration;
30
+
31
+ register(
32
+ callback: (obj: any) => void,
33
+ state: any,
34
+ useSynchronizationContext: boolean
35
+ ): System.Threading.CancellationTokenRegistration;
36
+
37
+ unsafeRegister(
38
+ callback: (obj: any) => void,
39
+ state: any
40
+ ): System.Threading.CancellationTokenRegistration;
41
+
42
+ unsafeRegister(
43
+ callback: (obj: any) => System.Threading.CancellationToken,
44
+ state: any
45
+ ): System.Threading.CancellationTokenRegistration;
46
+
47
+ equals(other: CancellationToken | null): boolean;
48
+
49
+ throwIfCancellationRequested(): void;
50
+
51
+ static readonly none: System.Threading.CancellationToken;
52
+
53
+ constructor(canceled: boolean);
54
+ }
55
+ }
56
+ export import CancellationToken = System.Threading.CancellationToken;
57
+ }
58
+ export {};
@@ -0,0 +1,27 @@
1
+ import "../IAsyncDisposable";
2
+ import "../IDisposable";
3
+ import "../IEquatable";
4
+
5
+ declare global {
6
+ namespace System.Threading {
7
+ class CancellationTokenRegistration
8
+ implements
9
+ System.IEquatable<CancellationTokenRegistration>,
10
+ System.IDisposable,
11
+ System.IAsyncDisposable
12
+ {
13
+ dispose(): void;
14
+
15
+ disposeAsync(): System.Threading.Tasks.ValueTask;
16
+
17
+ token: System.Threading.CancellationToken;
18
+
19
+ unregister(): boolean;
20
+
21
+ equals(other: CancellationTokenRegistration | null): boolean;
22
+
23
+ equals(other: System.Threading.CancellationTokenRegistration | null): boolean;
24
+ }
25
+ }
26
+ }
27
+ export {};
@@ -0,0 +1,51 @@
1
+ import "../IDisposable";
2
+ import "../TimeProvider";
3
+ import "../TimeSpan";
4
+ import "./CancellationToken";
5
+
6
+ declare global {
7
+ namespace System.Threading {
8
+ class CancellationTokenSource implements System.IDisposable {
9
+ isCancellationRequested: boolean;
10
+
11
+ token: System.Threading.CancellationToken;
12
+
13
+ cancel(): void;
14
+
15
+ cancel(throwOnFirstException: boolean): void;
16
+
17
+ cancelAsync(): Promise<void>;
18
+
19
+ cancelAfter(delay: System.TimeSpan): void;
20
+
21
+ cancelAfter(millisecondsDelay: number): void;
22
+
23
+ tryReset(): boolean;
24
+
25
+ dispose(): void;
26
+
27
+ static createLinkedTokenSource(
28
+ token1: System.Threading.CancellationToken,
29
+ token2: System.Threading.CancellationToken
30
+ ): System.Threading.CancellationTokenSource;
31
+
32
+ static createLinkedTokenSource(
33
+ token: System.Threading.CancellationToken
34
+ ): System.Threading.CancellationTokenSource;
35
+
36
+ static createLinkedTokenSource(
37
+ tokens: System.Threading.CancellationToken[]
38
+ ): System.Threading.CancellationTokenSource;
39
+
40
+ constructor();
41
+
42
+ constructor(delay: System.TimeSpan);
43
+
44
+ constructor(delay: System.TimeSpan, timeProvider: System.TimeProvider);
45
+
46
+ constructor(millisecondsDelay: number);
47
+ }
48
+ }
49
+ export import CancellationTokenSource = System.Threading.CancellationTokenSource;
50
+ }
51
+ export {};
@@ -0,0 +1,12 @@
1
+ import "../IAsyncDisposable";
2
+ import "../IDisposable";
3
+ import "../TimeSpan";
4
+
5
+ declare global {
6
+ namespace System.Threading {
7
+ interface ITimer extends System.IDisposable, System.IAsyncDisposable {
8
+ change(dueTime: System.TimeSpan, period: System.TimeSpan): boolean;
9
+ }
10
+ }
11
+ }
12
+ export {};
@@ -0,0 +1,12 @@
1
+ import "../../IEquatable";
2
+
3
+ declare global {
4
+ namespace System.Threading.Tasks {
5
+ class ValueTask implements IEquatable<ValueTask> {
6
+ equals(other: System.Threading.Tasks.ValueTask | null): boolean;
7
+
8
+ // TODO: 待补充(如果有必要)
9
+ }
10
+ }
11
+ }
12
+ export {};
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ namespace System.Threading {
3
+ abstract class WaitHandle {
4
+ // TODO: 待补充(如果有必要)
5
+ }
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,31 @@
1
+ import "../System/Threading/ITimer";
2
+ import "./DateTimeOffset";
3
+ import "./TimeSpan";
4
+
5
+ declare global {
6
+ namespace System {
7
+ abstract class TimeProvider {
8
+ abstract getUtcNow(): System.DateTimeOffset;
9
+
10
+ abstract getLocalNow(): System.DateTimeOffset;
11
+
12
+ abstract timestampFrequency: bigint;
13
+
14
+ abstract getTimestamp(): bigint;
15
+
16
+ getElapsedTime(startingTimestamp: bigint, endingTimestamp: bigint): System.TimeSpan;
17
+
18
+ getElapsedTime(startingTimestamp: bigint): System.TimeSpan;
19
+
20
+ createTimer(
21
+ callback: (state: any) => void,
22
+ state: any,
23
+ dueTime: System.TimeSpan,
24
+ period: System.TimeSpan
25
+ ): System.Threading.ITimer;
26
+
27
+ static system: System.TimeProvider;
28
+ }
29
+ }
30
+ }
31
+ export {};
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ namespace System {
3
+ class TimeSpan {
4
+ // TODO: 待补充(如果有必要)
5
+ }
6
+ }
7
+ }
8
+ export {};
@@ -0,0 +1,80 @@
1
+ import "../Vector";
2
+
3
+ declare global {
4
+ namespace System.Windows.Media {
5
+ class Matrix {
6
+ identity: Matrix;
7
+
8
+ readonly determinant: number;
9
+
10
+ readonly hasInverse: boolean;
11
+
12
+ readonly isIdentity: boolean;
13
+
14
+ m11: number;
15
+
16
+ m12: number;
17
+
18
+ m21: number;
19
+
20
+ m22: number;
21
+
22
+ offsetX: number;
23
+
24
+ offsetY: number;
25
+
26
+ append(matrix: Matrix): void;
27
+
28
+ prepend(matrix: Matrix): void;
29
+
30
+ rotate(angle: number): void;
31
+
32
+ rotatePrepend(angle: number): void;
33
+
34
+ rotateAt(angle: number, centerX: number, centerY: number): void;
35
+
36
+ rotateAtPrepend(angle: number, centerX: number, centerY: number): void;
37
+
38
+ scale(scaleX: number, scaleY: number): void;
39
+
40
+ scalePrepend(scaleX: number, scaleY: number): void;
41
+
42
+ scaleAt(scaleX: number, scaleY: number, centerX: number, centerY: number): void;
43
+
44
+ scaleAtPrepend(scaleX: number, scaleY: number, centerX: number, centerY: number): void;
45
+
46
+ skew(skewX: number, skewY: number): void;
47
+
48
+ skewPrepend(skewX: number, skewY: number): void;
49
+
50
+ translate(offsetX: number, offsetY: number): void;
51
+
52
+ translatePrepend(offsetX: number, offsetY: number): void;
53
+
54
+ transform(point: System.Windows.Point): System.Windows.Point;
55
+
56
+ transform(points: System.Windows.Point[]): void;
57
+
58
+ transform(vector: System.Windows.Vector): System.Windows.Vector;
59
+
60
+ transform(vectors: System.Windows.Vector[]): void;
61
+
62
+ invert(): void;
63
+
64
+ setIdentity(): void;
65
+
66
+ multiply(trans1: Matrix, trans2: Matrix): Matrix;
67
+
68
+ constructor(
69
+ m11: number,
70
+ m12: number,
71
+ m21: number,
72
+ m22: number,
73
+ offsetX: number,
74
+ offsetY: number
75
+ );
76
+ }
77
+ }
78
+ }
79
+
80
+ export {};
@@ -1,7 +1,41 @@
1
- export interface Point {
2
- /** 目标水平位置(像素) */
3
- x: number;
1
+ import "./Media/Matrix";
2
+ import "./Vector";
4
3
 
5
- /** 目标垂直位置(像素) */
6
- y: number;
4
+ declare global {
5
+ namespace System.Windows {
6
+ class Point {
7
+ x: number;
8
+
9
+ y: number;
10
+
11
+ offset(offsetX: number, offsetY: number): void;
12
+
13
+ multiply(
14
+ point: System.Windows.Point,
15
+ matrix: System.Windows.Media.Matrix
16
+ ): System.Windows.Point;
17
+
18
+ equals(point: System.Windows.Point): boolean;
19
+
20
+ static add(point: System.Windows.Point, vector: System.Windows.Vector): System.Windows.Point;
21
+
22
+ static subtract(
23
+ point: System.Windows.Point,
24
+ vector: System.Windows.Vector
25
+ ): System.Windows.Point;
26
+
27
+ static subtract(
28
+ point1: System.Windows.Point,
29
+ point2: System.Windows.Point
30
+ ): System.Windows.Vector;
31
+
32
+ static equals(point1: System.Windows.Point, point2: System.Windows.Point): boolean;
33
+
34
+ static parse(source: string): System.Windows.Point;
35
+
36
+ constructor(x: number, y: number);
37
+ }
38
+ }
7
39
  }
40
+
41
+ export {};
@@ -0,0 +1,51 @@
1
+ import "./Media/Matrix";
2
+ import "./Point";
3
+
4
+ declare global {
5
+ namespace System.Windows {
6
+ class Vector {
7
+ length: number;
8
+
9
+ lengthSquared: number;
10
+
11
+ normalize(): void;
12
+
13
+ negate(): void;
14
+
15
+ static crossProduct(vector1: System.Windows.Vector, vector2: System.Windows.Vector): number;
16
+
17
+ static angleBetween(vector1: System.Windows.Vector, vector2: System.Windows.Vector): number;
18
+
19
+ static add(
20
+ vector1: System.Windows.Vector,
21
+ vector2: System.Windows.Vector
22
+ ): System.Windows.Vector;
23
+
24
+ static subtract(
25
+ vector1: System.Windows.Vector,
26
+ vector2: System.Windows.Vector
27
+ ): System.Windows.Vector;
28
+
29
+ static add(vector: System.Windows.Vector, point: System.Windows.Point): System.Windows.Point;
30
+
31
+ static multiply(vector: System.Windows.Vector, scalar: number): System.Windows.Vector;
32
+
33
+ static multiply(scalar: number, vector: System.Windows.Vector): System.Windows.Vector;
34
+
35
+ static divide(vector: System.Windows.Vector, scalar: number): System.Windows.Vector;
36
+
37
+ static multiply(
38
+ vector: System.Windows.Vector,
39
+ matrix: System.Windows.Media.Matrix
40
+ ): System.Windows.Vector;
41
+
42
+ static multiply(vector1: System.Windows.Vector, vector2: System.Windows.Vector): number;
43
+
44
+ static determinant(vector1: System.Windows.Vector, vector2: System.Windows.Vector): number;
45
+
46
+ constructor(x: number, y: number);
47
+ }
48
+ }
49
+ }
50
+
51
+ export {};
@@ -1,5 +1,9 @@
1
1
  import "../csharp/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer";
2
2
  import "../csharp/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask";
3
+ import "../csharp/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam";
4
+ import "../csharp/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam";
5
+ import "../csharp/System/Threading/CancellationToken";
6
+ import "../csharp/System/Threading/CancellationTokenSource";
3
7
 
4
8
  declare global {
5
9
  /** @since 0.32.5 */
@@ -15,21 +19,68 @@ declare global {
15
19
  * @param timer 实时任务触发器
16
20
  * @since 0.32.5
17
21
  */
18
- function addTimer(timer: RealtimeTimer): void;
22
+ function addTimer(timer: BetterGenshinImpact.Core.Script.Dependence.Model.RealtimeTimer): void;
19
23
 
20
24
  /**
21
25
  * 添加实时任务(不会清理之前的任务)
22
26
  * @param timer 实时任务触发器
23
27
  * @since 0.43.5
24
28
  */
25
- function addTrigger(timer: RealtimeTimer): void;
29
+ function addTrigger(
30
+ timer: BetterGenshinImpact.Core.Script.Dependence.Model.RealtimeTimer
31
+ ): void;
26
32
 
27
33
  /**
28
34
  * 运行独立任务
29
35
  * @param soloTask 独立任务
30
36
  * @since 0.34.5
31
37
  */
32
- function runTask(soloTask: SoloTask): Promise<void>;
38
+ function runTask(
39
+ soloTask: BetterGenshinImpact.Core.Script.Dependence.Model.SoloTask,
40
+ customCts: System.Threading.CancellationTokenSource
41
+ ): Promise<void>;
42
+
43
+ /**
44
+ * 运行独立任务
45
+ * @param soloTask 独立任务
46
+ * @since 0.45.1
47
+ */
48
+ function runTask(
49
+ soloTask: BetterGenshinImpact.Core.Script.Dependence.Model.SoloTask,
50
+ customCt?: System.Threading.CancellationToken
51
+ ): Promise<void>;
52
+
53
+ /**
54
+ * 获取关联的取消令牌源
55
+ * @since 0.46.0
56
+ */
57
+ function getLinkedCancellationTokenSource(): System.Threading.CancellationTokenSource;
58
+
59
+ /**
60
+ * 获取关联的取消令牌
61
+ * @since 0.46.0
62
+ */
63
+ function getLinkedCancellationToken(): System.Threading.CancellationToken;
64
+
65
+ /**
66
+ * 运行自动秘境任务
67
+ * @param param 秘境任务参数
68
+ * @since 0.52.0
69
+ */
70
+ function runAutoDomainTask(
71
+ param: BetterGenshinImpact.GameTask.AutoDomain.AutoDomainParam,
72
+ customCt?: System.Threading.CancellationToken
73
+ ): Promise<void>;
74
+
75
+ /**
76
+ * 运行自动战斗任务
77
+ * @param param 战斗任务参数
78
+ * @since 0.52.0
79
+ */
80
+ function runAutoFightTask(
81
+ param: BetterGenshinImpact.GameTask.AutoFight.AutoFightParam,
82
+ customCt?: System.Threading.CancellationToken
83
+ ): Promise<void>;
33
84
  }
34
85
  }
35
86
 
package/modules/file.d.ts CHANGED
@@ -18,21 +18,21 @@ declare global {
18
18
  function isFolder(path: string): boolean;
19
19
 
20
20
  /**
21
- * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`)
21
+ * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`, `.png`, `.jpg`, `.jpeg`, `.bmp`, `.tiff`, `.webp`)
22
22
  * @param path 文件路径(相对于脚本根目录)
23
23
  * @since 0.32.3
24
24
  */
25
25
  function readTextSync(path: string): string;
26
26
 
27
27
  /**
28
- * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`)
28
+ * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`, `.png`, `.jpg`, `.jpeg`, `.bmp`, `.tiff`, `.webp`)
29
29
  * @param path 文件路径(相对于脚本根目录)
30
30
  * @since 0.32.3
31
31
  */
32
32
  function readText(path: string): Promise<string>;
33
33
 
34
34
  /**
35
- * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`)
35
+ * 读取文件文本(支持文件扩展名:`.txt`, `.json`, `.log`, `.csv`, `.xml`, `.html`, `.css`, `.png`, `.jpg`, `.jpeg`, `.bmp`, `.tiff`, `.webp`)
36
36
  * @param path 文件路径(相对于脚本根目录)
37
37
  * @param callbackFunc 回调函数
38
38
  * @since 0.32.3
@@ -132,15 +132,26 @@ declare global {
132
132
  /**
133
133
  * 获取当前在小地图上的 [Teyvat大地图] 位置坐标
134
134
  * @since 0.44.3
135
+ * @deprecated 已弃用
135
136
  */
136
137
  function getPositionFromMap(): Point2f;
137
138
 
138
139
  /**
139
140
  * 获取当前在小地图上的 [指定大地图] 位置坐标
140
141
  * @param mapName 大地图名称
142
+ * @param cacheTimeMs 缓存时间(毫秒,默认值:900)
141
143
  * @since 0.44.9
142
144
  */
143
- function getPositionFromMap(mapName: BigMap): Point2f;
145
+ function getPositionFromMap(mapName: BigMap, cacheTimeMs?: number): Point2f;
146
+
147
+ /**
148
+ * 获取当前在小地图上的 [指定大地图] 位置坐标(仅在给定坐标附近匹配)
149
+ * @param mapName 大地图名称
150
+ * @param x 大地图坐标水平位置(像素)
151
+ * @param y 大地图坐标垂直位置(像素)
152
+ * @since 0.48.0
153
+ */
154
+ function getPositionFromMap(mapName: BigMap, x: number, y: number): Point2f;
144
155
 
145
156
  /**
146
157
  * 切换队伍
@@ -149,6 +160,12 @@ declare global {
149
160
  */
150
161
  function switchParty(partyName: string): Promise<boolean>;
151
162
 
163
+ /**
164
+ * 清除当前调度器的队伍缓存
165
+ * @since 0.48.0
166
+ */
167
+ function clearPartyCache(): void;
168
+
152
169
  /**
153
170
  * 点击空月祝福
154
171
  * @since 0.37.4
@@ -1,9 +1,7 @@
1
- import { ImageRegion } from "../csharp/BetterGenshinImpact/GameTask/Model/Area/ImageRegion";
2
- import { KeyCode } from "../csharp/BetterGenshinImpact/Helpers/User32Helper";
1
+ import { KeyCode } from "@/csharp/BetterGenshinImpact/Helpers/User32Helper";
2
+ import "../csharp/BetterGenshinImpact/GameTask/Model/Area/ImageRegion";
3
3
 
4
4
  declare global {
5
- var global: typeof globalThis;
6
-
7
5
  /**
8
6
  * 休眠执行指定时长
9
7
  * @param duration - 休眠时长(毫秒)
@@ -130,7 +128,13 @@ declare global {
130
128
  * 捕获当前游戏窗口内容
131
129
  * @since 0.34.5
132
130
  */
133
- function captureGameRegion(): ImageRegion;
131
+ function captureGameRegion(): BetterGenshinImpact.GameTask.Model.Area.ImageRegion;
132
+
133
+ /**
134
+ * 当前队伍 角色名称 数组
135
+ * @since 0.48.0
136
+ */
137
+ function getAvatars(): string[];
134
138
 
135
139
  /**
136
140
  * 模拟输入文本
package/modules/http.d.ts CHANGED
@@ -1,14 +1,3 @@
1
- type HttpReponse = {
2
- /** 状态码 */
3
- status_code: number;
4
-
5
- /** 响应头 */
6
- headers: Record<string, string>;
7
-
8
- /** 响应体 */
9
- body: string;
10
- };
11
-
12
1
  declare global {
13
2
  /** @since 0.52.0 */
14
3
  namespace http {
@@ -21,16 +10,7 @@ declare global {
21
10
  * @since 0.52.0
22
11
  */
23
12
  function request(
24
- method:
25
- | "GET"
26
- | "PUT"
27
- | "POST"
28
- | "DELETE"
29
- | "HEAD"
30
- | "OPTIONS"
31
- | "TRACE"
32
- | "PATCH"
33
- | "CONNECT",
13
+ method: HttpMethod,
34
14
  url: string,
35
15
  body?: string,
36
16
  headersJson?: string
@@ -38,4 +18,26 @@ declare global {
38
18
  }
39
19
  }
40
20
 
21
+ type HttpMethod =
22
+ | "GET"
23
+ | "PUT"
24
+ | "POST"
25
+ | "DELETE"
26
+ | "HEAD"
27
+ | "OPTIONS"
28
+ | "TRACE"
29
+ | "PATCH"
30
+ | "CONNECT";
31
+
32
+ type HttpReponse = {
33
+ /** 状态码 */
34
+ status_code: number;
35
+
36
+ /** 响应头 */
37
+ headers: Record<string, string>;
38
+
39
+ /** 响应体 */
40
+ body: string;
41
+ };
42
+
41
43
  export {};