koishi-plugin-warframe 1.6.6 → 1.6.7
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.
- package/lib/index.d.ts +158 -129
- package/lib/index.js +229 -192
- package/lib/index.tsbuildinfo +1 -1
- package/package.json +1 -1
- /package/lib/{assets → warframe/assets}/arbyRewards.json +0 -0
- /package/lib/{assets → warframe/assets}/arbys.txt +0 -0
- /package/lib/{assets → warframe/assets}/baro.txt +0 -0
- /package/lib/{assets → warframe/assets}/baroParsed.json +0 -0
- /package/lib/{assets → warframe/assets}/circuitRewards.json +0 -0
- /package/lib/{assets → warframe/assets}/en.json +0 -0
- /package/lib/{assets → warframe/assets}/rivenAttrValues.json +0 -0
- /package/lib/{assets → warframe/assets}/rivencalc.json +0 -0
- /package/lib/{assets → warframe/assets}/warframeAlias.json +0 -0
- /package/lib/{assets → warframe/assets}/zh.json +0 -0
package/lib/index.d.ts
CHANGED
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
declare module "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
declare module "warframe/types/warframe-result" {
|
|
2
|
+
export const warframeErrorCodes: readonly ["common.fetchFailed", "relic.invalidName", "relic.dataLoading", "relic.notFound", "arbitration.invalidDayRange", "voidTrader.drifting", "voidTrader.arriving", "riven.imageFetchFailed", "riven.imageParseFailed", "riven.weaponNotFound", "riven.dispositionError", "riven.weaponTypeError", "riven.statTypeError", "wfm.inputItemName", "wfm.itemNotFound", "wfm.orderFetchFailed", "wfm.noOnlineSeller", "wfm.rivenWeaponNotFound", "wfm.rivenOrderFetchFailed", "wfm.noOnlineRivenSeller", "miscs.hotRiven.noData", "miscs.hotRiven.fetchFailed"];
|
|
3
|
+
export type WarframeErrorCode = typeof warframeErrorCodes[number];
|
|
4
|
+
export type WarframeErrorParams = Record<string, string | number>;
|
|
5
|
+
export interface WarframeError {
|
|
6
|
+
code: WarframeErrorCode;
|
|
7
|
+
retryable: boolean;
|
|
8
|
+
params?: WarframeErrorParams;
|
|
9
|
+
}
|
|
10
|
+
export interface WarframeFailure {
|
|
9
11
|
ok: false;
|
|
10
|
-
|
|
11
|
-
params?: MessageParams;
|
|
12
|
+
error: WarframeError;
|
|
12
13
|
}
|
|
13
|
-
export type
|
|
14
|
+
export type WarframeResult<TData> = {
|
|
14
15
|
ok: true;
|
|
15
16
|
data: TData;
|
|
16
|
-
} |
|
|
17
|
+
} | WarframeFailure;
|
|
18
|
+
export function failure(code: WarframeErrorCode, retryable?: boolean, params?: WarframeErrorParams): WarframeFailure;
|
|
17
19
|
}
|
|
18
|
-
declare module "
|
|
19
|
-
import type { ServiceFailure } from "types/result";
|
|
20
|
-
export const messages: {
|
|
21
|
-
readonly 'common.fetchFailed': "内部错误,获取最新信息失败";
|
|
22
|
-
readonly 'relic.invalidName': "请提供正确的遗物名称";
|
|
23
|
-
readonly 'relic.dataLoading': "遗物数据未加载完成,请稍后再试";
|
|
24
|
-
readonly 'relic.notFound': "未找到对应遗物信息";
|
|
25
|
-
readonly 'arbitration.invalidDayRange': "天数需小于等于14且大于0";
|
|
26
|
-
readonly 'voidTrader.drifting': "虚空商人仍在未知地带漂流...";
|
|
27
|
-
readonly 'voidTrader.arriving': "距离虚空商人到达还有: {time}";
|
|
28
|
-
readonly 'riven.imageNotFound': "未检测到图片";
|
|
29
|
-
readonly 'riven.ocrNotConfigured': "未配置 OCR,请在插件设置中配置。";
|
|
30
|
-
readonly 'riven.imageFetchFailed': "获取图片失败";
|
|
31
|
-
readonly 'riven.imageParseFailed': "解析图片失败";
|
|
32
|
-
readonly 'riven.weaponNotFound': "未找到武器: {weapon}";
|
|
33
|
-
readonly 'riven.dispositionError': "裂罅倾向错误";
|
|
34
|
-
readonly 'riven.weaponTypeError': "武器类型错误";
|
|
35
|
-
readonly 'riven.statTypeError': "词条类型错误";
|
|
36
|
-
readonly 'riven.invalidParams': "请输入正确参数";
|
|
37
|
-
readonly 'riven.noWeeklyData': "没有找到符合条件的紫卡参考数据";
|
|
38
|
-
readonly 'wfm.inputItemName': "请输入物品名称";
|
|
39
|
-
readonly 'wfm.itemNotFound': "未找到物品: {input}";
|
|
40
|
-
readonly 'wfm.orderFetchFailed': "订单获取失败,请稍后重试";
|
|
41
|
-
readonly 'wfm.noOnlineSeller': "当前没有在线游戏中的卖家";
|
|
42
|
-
readonly 'wfm.rivenWeaponNotFound': "未找到紫卡武器: {input}";
|
|
43
|
-
readonly 'wfm.rivenOrderFetchFailed': "紫卡订单获取失败,请稍后重试";
|
|
44
|
-
readonly 'wfm.noOnlineRivenSeller': "当前没有在线出售的紫卡";
|
|
45
|
-
readonly 'miscs.hotRiven.noData': "暂无热门紫卡数据";
|
|
46
|
-
readonly 'miscs.hotRiven.fetchFailed': "获取热门紫卡数据失败";
|
|
47
|
-
readonly 'miscs.inDevelopment': "功能暂未开放";
|
|
48
|
-
};
|
|
49
|
-
export type MessageKey = keyof typeof messages;
|
|
50
|
-
export type MessageParams = Record<string, string | number>;
|
|
51
|
-
export function t(message: MessageKey, params?: MessageParams): string;
|
|
52
|
-
export function t(result: ServiceFailure): string;
|
|
53
|
-
}
|
|
54
|
-
declare module "utils/assets" {
|
|
20
|
+
declare module "warframe/utils/assets" {
|
|
55
21
|
export function loadAssetJson<T>(path: string): T;
|
|
56
22
|
export function loadAssetText(path: string): string;
|
|
57
23
|
}
|
|
58
|
-
declare module "utils/cache" {
|
|
24
|
+
declare module "warframe/utils/cache" {
|
|
59
25
|
/**
|
|
60
26
|
* Creates an async cache with a time-to-live (TTL).
|
|
61
27
|
* @param factory Function to fetch fresh data.
|
|
@@ -64,31 +30,18 @@ declare module "utils/cache" {
|
|
|
64
30
|
*/
|
|
65
31
|
export function createAsyncCache<T>(factory: AsyncCacheFactory<T>, ttlMs?: number): AsyncCache<T>;
|
|
66
32
|
}
|
|
67
|
-
declare module "utils/collection" {
|
|
33
|
+
declare module "warframe/utils/collection" {
|
|
68
34
|
export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => Record<string, T>;
|
|
69
35
|
export const listToDictSpec: <TObj, TValue>(dict: TObj[], predict: (obj: TObj) => string[], value: (obj: TObj) => TValue) => Record<string, TValue>;
|
|
70
36
|
export const dictToKeyDict: <T>(dict: Record<string, T>, predict: (obj: T) => string[]) => Record<string, string>;
|
|
71
37
|
}
|
|
72
|
-
declare module "utils/
|
|
73
|
-
export function lerp(start: number, end: number, t: number): number;
|
|
74
|
-
export function hexToRgb(hex: string): {
|
|
75
|
-
r: number;
|
|
76
|
-
g: number;
|
|
77
|
-
b: number;
|
|
78
|
-
};
|
|
79
|
-
export function rgbToHex(r: number, g: number, b: number): string;
|
|
80
|
-
}
|
|
81
|
-
declare module "utils/logger" {
|
|
82
|
-
import { Logger } from 'koishi';
|
|
83
|
-
export const logger: Logger;
|
|
84
|
-
}
|
|
85
|
-
declare module "utils/http" {
|
|
38
|
+
declare module "warframe/utils/http" {
|
|
86
39
|
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
87
40
|
export function fetchAsyncText(url: string, method?: HttpMethod): Promise<string | undefined>;
|
|
88
41
|
export function fetchAsyncData<T>(url: string, method?: HttpMethod): Promise<T | undefined>;
|
|
89
42
|
export function fetchAsyncImage(url: string, method?: HttpMethod): Promise<Blob | undefined>;
|
|
90
43
|
}
|
|
91
|
-
declare module "utils/text" {
|
|
44
|
+
declare module "warframe/utils/text" {
|
|
92
45
|
export function normalizeName(text: string): string;
|
|
93
46
|
export function fullWidthToHalfWidth(text: string): string;
|
|
94
47
|
export const removeSpace: (text: string) => string;
|
|
@@ -97,7 +50,7 @@ declare module "utils/text" {
|
|
|
97
50
|
export function normalSimilarity(a: string, b: string): number;
|
|
98
51
|
export function tokenSimilarity(a: string, b: string): number;
|
|
99
52
|
}
|
|
100
|
-
declare module "utils/time" {
|
|
53
|
+
declare module "warframe/utils/time" {
|
|
101
54
|
export function toTimeStamp(timeStr: string): number;
|
|
102
55
|
/**
|
|
103
56
|
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
@@ -115,29 +68,33 @@ declare module "utils/time" {
|
|
|
115
68
|
export function msToHumanReadable(ms: number): string;
|
|
116
69
|
export function sleep(ms: number): Promise<void>;
|
|
117
70
|
}
|
|
118
|
-
declare module "utils/index" {
|
|
119
|
-
export * from "utils/assets";
|
|
120
|
-
export * from "utils/cache";
|
|
121
|
-
export * from "utils/collection";
|
|
122
|
-
export * from "utils/
|
|
123
|
-
export * from "utils/
|
|
124
|
-
export * from "utils/
|
|
125
|
-
export * from "utils/text";
|
|
126
|
-
export * from "utils/time";
|
|
71
|
+
declare module "warframe/utils/index" {
|
|
72
|
+
export * from "warframe/utils/assets";
|
|
73
|
+
export * from "warframe/utils/cache";
|
|
74
|
+
export * from "warframe/utils/collection";
|
|
75
|
+
export * from "warframe/utils/http";
|
|
76
|
+
export * from "warframe/utils/text";
|
|
77
|
+
export * from "warframe/utils/time";
|
|
127
78
|
}
|
|
128
|
-
declare module "infrastructure/miscs/lab-api" {
|
|
79
|
+
declare module "warframe/infrastructure/miscs/lab-api" {
|
|
129
80
|
import type { RivenWeaponItem } from '../../types/miscs/lab';
|
|
130
81
|
export function getHotRivenWeapons(num?: number): Promise<RivenWeaponItem[] | undefined>;
|
|
131
82
|
}
|
|
132
|
-
declare module "data/miscs/lab" {
|
|
133
|
-
export const globalHotRivenWeapons: AsyncCache<import("
|
|
83
|
+
declare module "warframe/data/miscs/lab" {
|
|
84
|
+
export const globalHotRivenWeapons: AsyncCache<import("warframe").RivenWeaponItem[]>;
|
|
134
85
|
}
|
|
135
|
-
declare module "services/miscs-service" {
|
|
86
|
+
declare module "warframe/services/miscs-service" {
|
|
136
87
|
import type { RivenWeaponItem } from '../types/miscs/lab';
|
|
137
|
-
import type {
|
|
138
|
-
export function getHotRivenWeapons(): Promise<
|
|
88
|
+
import type { WarframeResult } from "warframe/types/warframe-result";
|
|
89
|
+
export function getHotRivenWeapons(): Promise<WarframeResult<RivenWeaponItem[]>>;
|
|
139
90
|
}
|
|
140
|
-
declare module "
|
|
91
|
+
declare module "warframe/types/ocr" {
|
|
92
|
+
export interface OcrAPISecret {
|
|
93
|
+
id: string;
|
|
94
|
+
key: string;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
declare module "warframe/assets/index" {
|
|
141
98
|
import type { RivenWeaponDisposition } from '../types/wf/riven';
|
|
142
99
|
export interface BaroParsedItem {
|
|
143
100
|
name: string;
|
|
@@ -158,10 +115,10 @@ declare module "assets/index" {
|
|
|
158
115
|
export const BaroParsed: BaroParsedItem[];
|
|
159
116
|
export const warframeAlias: Record<string, string[]>;
|
|
160
117
|
}
|
|
161
|
-
declare module "data/wf/arbitrationSchedule" {
|
|
118
|
+
declare module "warframe/data/wf/arbitrationSchedule" {
|
|
162
119
|
export const arbitrationSchedule: ArbitrationShort[];
|
|
163
120
|
}
|
|
164
|
-
declare module "infrastructure/wf/wf-api" {
|
|
121
|
+
declare module "warframe/infrastructure/wf/wf-api" {
|
|
165
122
|
import type WorldState from 'warframe-worldstate-parser';
|
|
166
123
|
export function getWorldState(json?: string): Promise<WorldState>;
|
|
167
124
|
export function getVoidTraderHistory(data?: string): Promise<VoidTraderData | undefined>;
|
|
@@ -180,7 +137,7 @@ declare module "infrastructure/wf/wf-api" {
|
|
|
180
137
|
[itemName: string]: VoidTraderItem;
|
|
181
138
|
}
|
|
182
139
|
}
|
|
183
|
-
declare module "infrastructure/wf/wf-export-adapter" {
|
|
140
|
+
declare module "warframe/infrastructure/wf/wf-export-adapter" {
|
|
184
141
|
import type { IRegion } from 'warframe-public-export-plus';
|
|
185
142
|
export function regionToShort(region: IRegion, dict: Record<string, string>): WFRegionShort;
|
|
186
143
|
export function relicQualityToName(quality: string): RelicQuality;
|
|
@@ -200,7 +157,7 @@ declare module "infrastructure/wf/wf-export-adapter" {
|
|
|
200
157
|
export function relicEraToTransKey(era: string): string;
|
|
201
158
|
export function fixRelicRewardKey(item: string): string;
|
|
202
159
|
}
|
|
203
|
-
declare module "infrastructure/wf/wfcd-adapter" {
|
|
160
|
+
declare module "warframe/infrastructure/wf/wfcd-adapter" {
|
|
204
161
|
import type { TMissionType } from 'warframe-public-export-plus';
|
|
205
162
|
export function getSolNodeKey(name: string): Promise<string>;
|
|
206
163
|
export function getMissionTypeKey(name: string): Promise<TMissionType>;
|
|
@@ -221,7 +178,7 @@ declare module "infrastructure/wf/wfcd-adapter" {
|
|
|
221
178
|
credits: number;
|
|
222
179
|
}): VoidTraderItem;
|
|
223
180
|
}
|
|
224
|
-
declare module "data/wf/globalWorldState" {
|
|
181
|
+
declare module "warframe/data/wf/globalWorldState" {
|
|
225
182
|
export const globalWorldState: AsyncCache<{
|
|
226
183
|
raw: import("warframe-worldstate-parser").WorldState;
|
|
227
184
|
fissures: Fissure[];
|
|
@@ -229,21 +186,21 @@ declare module "data/wf/globalWorldState" {
|
|
|
229
186
|
rjFissures: Fissure[];
|
|
230
187
|
}>;
|
|
231
188
|
}
|
|
232
|
-
declare module "data/wf/relics" {
|
|
189
|
+
declare module "warframe/data/wf/relics" {
|
|
233
190
|
export const relics: Record<string, Relic>;
|
|
234
191
|
}
|
|
235
|
-
declare module "data/wf/rivenBaseValues" {
|
|
192
|
+
declare module "warframe/data/wf/rivenBaseValues" {
|
|
236
193
|
export const rivenAttrValueDict: Record<string, Record<string, number>>;
|
|
237
194
|
}
|
|
238
|
-
declare module "data/wf/rivenDisposition" {
|
|
195
|
+
declare module "warframe/data/wf/rivenDisposition" {
|
|
239
196
|
import type { RivenWeaponDisposition } from '../../types/wf/riven';
|
|
240
197
|
export const weaponRivenDispositionDict: Record<string, RivenWeaponDisposition>;
|
|
241
198
|
}
|
|
242
|
-
declare module "data/wf/rivenStatData" {
|
|
199
|
+
declare module "warframe/data/wf/rivenStatData" {
|
|
243
200
|
import type { RivenStatFixFactorMap } from '../../types/wf/riven';
|
|
244
201
|
export const rivenStatFixFactor: RivenStatFixFactorMap;
|
|
245
202
|
}
|
|
246
|
-
declare module "infrastructure/wfm-client" {
|
|
203
|
+
declare module "warframe/infrastructure/wfm-client" {
|
|
247
204
|
export const wfmClient: {
|
|
248
205
|
items: {
|
|
249
206
|
getList: () => Promise<import("wfm-api-client").ItemShort[] | undefined>;
|
|
@@ -263,7 +220,7 @@ declare module "infrastructure/wfm-client" {
|
|
|
263
220
|
};
|
|
264
221
|
};
|
|
265
222
|
}
|
|
266
|
-
declare module "data/wfm/globalRivenAttribute" {
|
|
223
|
+
declare module "warframe/data/wfm/globalRivenAttribute" {
|
|
267
224
|
import type { RivenAttribute } from '../../types/wfm';
|
|
268
225
|
export function globalRivenAttributeFactory(rivenAttributeData?: RivenAttribute[]): Promise<{
|
|
269
226
|
globalRivenAttributeList: RivenAttribute[];
|
|
@@ -280,7 +237,7 @@ declare module "data/wfm/globalRivenAttribute" {
|
|
|
280
237
|
};
|
|
281
238
|
}>): void;
|
|
282
239
|
}
|
|
283
|
-
declare module "data/wfm/globalRivenItem" {
|
|
240
|
+
declare module "warframe/data/wfm/globalRivenItem" {
|
|
284
241
|
import type { RivenItem } from '../../types/wfm';
|
|
285
242
|
export interface GlobalRivenItemWordPrefixCandidate {
|
|
286
243
|
item: RivenItem;
|
|
@@ -300,20 +257,20 @@ declare module "data/wfm/globalRivenItem" {
|
|
|
300
257
|
globalRivenItemWordPrefixCandidates: GlobalRivenItemWordPrefixCandidate[];
|
|
301
258
|
}>;
|
|
302
259
|
}
|
|
303
|
-
declare module "infrastructure/ocr-api" {
|
|
304
|
-
import type { OcrAPISecret } from
|
|
260
|
+
declare module "warframe/infrastructure/ocr-api" {
|
|
261
|
+
import type { OcrAPISecret } from "warframe/types/ocr";
|
|
305
262
|
export function extractTextFromImage(image: string | Blob, secret: OcrAPISecret): Promise<string[] | undefined>;
|
|
306
263
|
}
|
|
307
|
-
declare module "services/wf-service" {
|
|
264
|
+
declare module "warframe/services/wf-service" {
|
|
308
265
|
import type { WeeklyRiven } from 'warframe-weekly-rivens';
|
|
309
|
-
import type { OcrAPISecret } from
|
|
310
|
-
import type {
|
|
266
|
+
import type { OcrAPISecret } from "warframe/types/ocr";
|
|
267
|
+
import type { WarframeResult } from "warframe/types/warframe-result";
|
|
311
268
|
import type { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
|
|
312
269
|
import type { RivenAttribute } from '../types/wfm';
|
|
313
|
-
import { weaponRivenDispositionDict } from "data/wf/rivenDisposition";
|
|
314
|
-
export function getRelic(input: string): Promise<
|
|
315
|
-
export function getArbitrations(day?: number):
|
|
316
|
-
export function getWeekly(): Promise<
|
|
270
|
+
import { weaponRivenDispositionDict } from "warframe/data/wf/rivenDisposition";
|
|
271
|
+
export function getRelic(input: string): Promise<WarframeResult<Relic>>;
|
|
272
|
+
export function getArbitrations(day?: number): WarframeResult<Arbitration[]>;
|
|
273
|
+
export function getWeekly(): Promise<WarframeResult<{
|
|
317
274
|
archonHunt: ArchonHunt;
|
|
318
275
|
deepArchimedea: ArchiMedea;
|
|
319
276
|
temporalArchimedea: ArchiMedea;
|
|
@@ -325,14 +282,14 @@ declare module "services/wf-service" {
|
|
|
325
282
|
allIncarnons: string[][];
|
|
326
283
|
allWarframes: string[][];
|
|
327
284
|
};
|
|
328
|
-
export function getFissures(): Promise<
|
|
329
|
-
export function getSteelPathFissures(): Promise<
|
|
330
|
-
export function getRailjackFissures(): Promise<
|
|
331
|
-
export function getAnalyzedRiven(secret: OcrAPISecret, url: string): Promise<
|
|
332
|
-
export function getVoidTrader(): Promise<
|
|
285
|
+
export function getFissures(): Promise<WarframeResult<Fissure[]>>;
|
|
286
|
+
export function getSteelPathFissures(): Promise<WarframeResult<Fissure[]>>;
|
|
287
|
+
export function getRailjackFissures(): Promise<WarframeResult<Fissure[]>>;
|
|
288
|
+
export function getAnalyzedRiven(secret: OcrAPISecret, url: string): Promise<WarframeResult<RivenStatAnalyzeResult>>;
|
|
289
|
+
export function getVoidTrader(): Promise<WarframeResult<VoidTrader>>;
|
|
333
290
|
export function filterWeeklyRivens(data: WeeklyRiven[], minPrice: number, minPop?: number): WeeklyRiven[];
|
|
334
291
|
export function getWeeklyRivens(minPrice: number): Promise<WeeklyRiven[]>;
|
|
335
|
-
export function getStaticRivenStats(weaponType: string, statType: string, disposition: number): Promise<
|
|
292
|
+
export function getStaticRivenStats(weaponType: string, statType: string, disposition: number): Promise<WarframeResult<RivenStatResult>>;
|
|
336
293
|
export function getWeaponRivenDisposition(name: string): (typeof weaponRivenDispositionDict)[string] | undefined;
|
|
337
294
|
export function parseOCRResult(ocrResult: string[]): Promise<{
|
|
338
295
|
name: string;
|
|
@@ -349,12 +306,12 @@ declare module "services/wf-service" {
|
|
|
349
306
|
value: number;
|
|
350
307
|
prefix: string;
|
|
351
308
|
}[];
|
|
352
|
-
}):
|
|
309
|
+
}): WarframeResult<RivenStatAnalyzeResult>;
|
|
353
310
|
}
|
|
354
|
-
declare module "data/wfm/globalDucatnator" {
|
|
311
|
+
declare module "warframe/data/wfm/globalDucatnator" {
|
|
355
312
|
export const globalDucatnatorIDDict: AsyncCache<Record<string, import("wfm-api-client").Ducatnator> | undefined>;
|
|
356
313
|
}
|
|
357
|
-
declare module "data/wfm/globalItem" {
|
|
314
|
+
declare module "warframe/data/wfm/globalItem" {
|
|
358
315
|
import type { ItemShort } from '../../types/wfm';
|
|
359
316
|
export interface GlobalItemWordPrefixCandidate {
|
|
360
317
|
item: ItemShort;
|
|
@@ -383,8 +340,8 @@ declare module "data/wfm/globalItem" {
|
|
|
383
340
|
globalItemWordPrefixCandidates: GlobalItemWordPrefixCandidate[];
|
|
384
341
|
}>): void;
|
|
385
342
|
}
|
|
386
|
-
declare module "services/wfm-service/wfm-service.item-matcher" {
|
|
387
|
-
import type { GlobalItemWordPrefixCandidate } from "data/wfm/globalItem";
|
|
343
|
+
declare module "warframe/services/wfm-service/wfm-service.item-matcher" {
|
|
344
|
+
import type { GlobalItemWordPrefixCandidate } from "warframe/data/wfm/globalItem";
|
|
388
345
|
import type { ItemShort } from '../../types/wfm';
|
|
389
346
|
interface WFMItemLookupData {
|
|
390
347
|
globalItemDict: Record<string, ItemShort>;
|
|
@@ -425,8 +382,8 @@ declare module "services/wfm-service/wfm-service.item-matcher" {
|
|
|
425
382
|
export const stringToWFMItem: (input: string) => Promise<ItemShort | undefined>;
|
|
426
383
|
export const transformByWarframeAlias: (input: string) => string | undefined;
|
|
427
384
|
}
|
|
428
|
-
declare module "services/wfm-service/wfm-service.riven-item-matcher" {
|
|
429
|
-
import type { GlobalRivenItemWordPrefixCandidate } from "data/wfm/globalRivenItem";
|
|
385
|
+
declare module "warframe/services/wfm-service/wfm-service.riven-item-matcher" {
|
|
386
|
+
import type { GlobalRivenItemWordPrefixCandidate } from "warframe/data/wfm/globalRivenItem";
|
|
430
387
|
import type { RivenItem } from '../../types/wfm';
|
|
431
388
|
interface WFMRivenItemLookupData {
|
|
432
389
|
globalRivenItemDict: Record<string, RivenItem>;
|
|
@@ -442,27 +399,78 @@ declare module "services/wfm-service/wfm-service.riven-item-matcher" {
|
|
|
442
399
|
export const matchByShortHand: typeof shortHandProcess;
|
|
443
400
|
export const stringToWFMItem: typeof findRivenItemByName;
|
|
444
401
|
}
|
|
445
|
-
declare module "services/wfm-service/index" {
|
|
446
|
-
import type {
|
|
402
|
+
declare module "warframe/services/wfm-service/index" {
|
|
403
|
+
import type { WarframeResult } from "warframe/types/warframe-result";
|
|
447
404
|
import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from '../../types/wfm';
|
|
448
|
-
import { stringToWFMItem } from "services/wfm-service/wfm-service.item-matcher";
|
|
405
|
+
import { stringToWFMItem } from "warframe/services/wfm-service/wfm-service.item-matcher";
|
|
449
406
|
export { stringToWFMItem };
|
|
450
407
|
export function updateCache(): Promise<string>;
|
|
451
|
-
export function getItemOrders(input: string): Promise<
|
|
408
|
+
export function getItemOrders(input: string): Promise<WarframeResult<{
|
|
452
409
|
item: ItemShort;
|
|
453
410
|
orders: OrderWithUser[];
|
|
454
411
|
}>>;
|
|
455
|
-
export function getRivenOrders(input: string): Promise<
|
|
412
|
+
export function getRivenOrders(input: string): Promise<WarframeResult<{
|
|
456
413
|
item: RivenItem;
|
|
457
414
|
orders: RivenOrderInternal[];
|
|
458
415
|
}>>;
|
|
459
416
|
export function applyRelicData(relic: Relic): Promise<OutputRelic>;
|
|
460
417
|
export const primedModHistory: AsyncCache<PrimedModHistoryItem[]>;
|
|
461
418
|
}
|
|
462
|
-
declare module "services/index" {
|
|
463
|
-
export * from "services/miscs-service";
|
|
464
|
-
export * from "services/wf-service";
|
|
465
|
-
export * from "services/wfm-service/index";
|
|
419
|
+
declare module "warframe/services/index" {
|
|
420
|
+
export * from "warframe/services/miscs-service";
|
|
421
|
+
export * from "warframe/services/wf-service";
|
|
422
|
+
export * from "warframe/services/wfm-service/index";
|
|
423
|
+
}
|
|
424
|
+
declare module "warframe/index" {
|
|
425
|
+
export * from "warframe/services/index";
|
|
426
|
+
export type { RivenWeaponItem } from './types/miscs/lab';
|
|
427
|
+
export type { OcrAPISecret } from "warframe/types/ocr";
|
|
428
|
+
export { failure } from "warframe/types/warframe-result";
|
|
429
|
+
export type { WarframeError, WarframeErrorCode, WarframeErrorParams, WarframeFailure, WarframeResult, } from "warframe/types/warframe-result";
|
|
430
|
+
export type { RivenStatAnalyzeResult, RivenStatResult, } from './types/wf/riven';
|
|
431
|
+
export type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenAttributeShortInternal, RivenAttributeUnit, RivenItem, RivenOrderInternal, } from './types/wfm';
|
|
432
|
+
export { msToHumanReadable } from "warframe/utils/time";
|
|
433
|
+
}
|
|
434
|
+
declare module "components/miscs" {
|
|
435
|
+
import type { Element } from 'koishi';
|
|
436
|
+
import type { RivenWeaponItem } from "warframe/index";
|
|
437
|
+
export function HotRivenComponent(data: RivenWeaponItem[]): Element;
|
|
438
|
+
}
|
|
439
|
+
declare module "messages" {
|
|
440
|
+
import type { WarframeFailure } from "warframe/index";
|
|
441
|
+
export const messages: {
|
|
442
|
+
readonly 'common.fetchFailed': "内部错误,获取最新信息失败";
|
|
443
|
+
readonly 'relic.invalidName': "请提供正确的遗物名称";
|
|
444
|
+
readonly 'relic.dataLoading': "遗物数据未加载完成,请稍后再试";
|
|
445
|
+
readonly 'relic.notFound': "未找到对应遗物信息";
|
|
446
|
+
readonly 'arbitration.invalidDayRange': "天数需小于等于14且大于0";
|
|
447
|
+
readonly 'voidTrader.drifting': "虚空商人仍在未知地带漂流...";
|
|
448
|
+
readonly 'voidTrader.arriving': "距离虚空商人到达还有: {time}";
|
|
449
|
+
readonly 'riven.imageNotFound': "未检测到图片";
|
|
450
|
+
readonly 'riven.ocrNotConfigured': "未配置 OCR,请在插件设置中配置。";
|
|
451
|
+
readonly 'riven.imageFetchFailed': "获取图片失败";
|
|
452
|
+
readonly 'riven.imageParseFailed': "解析图片失败";
|
|
453
|
+
readonly 'riven.weaponNotFound': "未找到武器: {weapon}";
|
|
454
|
+
readonly 'riven.dispositionError': "裂罅倾向错误";
|
|
455
|
+
readonly 'riven.weaponTypeError': "武器类型错误";
|
|
456
|
+
readonly 'riven.statTypeError': "词条类型错误";
|
|
457
|
+
readonly 'riven.invalidParams': "请输入正确参数";
|
|
458
|
+
readonly 'riven.noWeeklyData': "没有找到符合条件的紫卡参考数据";
|
|
459
|
+
readonly 'wfm.inputItemName': "请输入物品名称";
|
|
460
|
+
readonly 'wfm.itemNotFound': "未找到物品: {input}";
|
|
461
|
+
readonly 'wfm.orderFetchFailed': "订单获取失败,请稍后重试";
|
|
462
|
+
readonly 'wfm.noOnlineSeller': "当前没有在线游戏中的卖家";
|
|
463
|
+
readonly 'wfm.rivenWeaponNotFound': "未找到紫卡武器: {input}";
|
|
464
|
+
readonly 'wfm.rivenOrderFetchFailed': "紫卡订单获取失败,请稍后重试";
|
|
465
|
+
readonly 'wfm.noOnlineRivenSeller': "当前没有在线出售的紫卡";
|
|
466
|
+
readonly 'miscs.hotRiven.noData': "暂无热门紫卡数据";
|
|
467
|
+
readonly 'miscs.hotRiven.fetchFailed': "获取热门紫卡数据失败";
|
|
468
|
+
readonly 'miscs.inDevelopment': "功能暂未开放";
|
|
469
|
+
};
|
|
470
|
+
export type MessageKey = keyof typeof messages;
|
|
471
|
+
export type MessageParams = Record<string, string | number>;
|
|
472
|
+
export function t(message: MessageKey, params?: MessageParams): string;
|
|
473
|
+
export function t(result: WarframeFailure): string;
|
|
466
474
|
}
|
|
467
475
|
declare module "commands/miscs" {
|
|
468
476
|
import type { PluginDependencies } from '../types/config';
|
|
@@ -472,10 +480,27 @@ declare module "commands/miscs" {
|
|
|
472
480
|
inDevelopment: () => string;
|
|
473
481
|
};
|
|
474
482
|
}
|
|
483
|
+
declare module "utils/assets" {
|
|
484
|
+
export function loadAssetJson<T>(path: string): T;
|
|
485
|
+
export function loadAssetText(path: string): string;
|
|
486
|
+
}
|
|
487
|
+
declare module "utils/color" {
|
|
488
|
+
export function lerp(start: number, end: number, t: number): number;
|
|
489
|
+
export function hexToRgb(hex: string): {
|
|
490
|
+
r: number;
|
|
491
|
+
g: number;
|
|
492
|
+
b: number;
|
|
493
|
+
};
|
|
494
|
+
export function rgbToHex(r: number, g: number, b: number): string;
|
|
495
|
+
}
|
|
496
|
+
declare module "utils/index" {
|
|
497
|
+
export * from "utils/assets";
|
|
498
|
+
export * from "utils/color";
|
|
499
|
+
}
|
|
475
500
|
declare module "components/wf" {
|
|
476
501
|
import type { Element } from 'koishi';
|
|
477
502
|
import type { WeeklyRiven } from 'warframe-weekly-rivens';
|
|
478
|
-
import type { RivenStatAnalyzeResult, RivenStatResult } from
|
|
503
|
+
import type { RivenStatAnalyzeResult, RivenStatResult } from "warframe/index";
|
|
479
504
|
export function ArbitrationComponent(arbi: Arbitration[]): Element;
|
|
480
505
|
export function CircuitComponent(currentIncarnons: number, currentWarframes: number, allIncarnons: string[][], allWarframes: string[][]): Element;
|
|
481
506
|
export function FissureComponent(fissures: Fissure[], type: 'fissure' | 'sp-fissure' | 'rj-fissure'): Element;
|
|
@@ -512,14 +537,14 @@ declare module "components/render" {
|
|
|
512
537
|
}
|
|
513
538
|
declare module "components/wfm" {
|
|
514
539
|
import type Element from '@satorijs/element';
|
|
515
|
-
import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from
|
|
540
|
+
import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from "warframe/index";
|
|
516
541
|
export function ItemOrderComponent(item: ItemShort, orders: OrderWithUser[]): Element;
|
|
517
542
|
export function RivenOrderComponent(item: RivenItem, orders: RivenOrderInternal[]): Element;
|
|
518
543
|
export function PrimedModHistoryComponent(history: PrimedModHistoryItem[]): Element;
|
|
519
544
|
}
|
|
520
545
|
declare module "messages/wfm" {
|
|
521
546
|
import type { Element } from 'koishi';
|
|
522
|
-
import type { ItemShort, OrderWithUser } from
|
|
547
|
+
import type { ItemShort, OrderWithUser } from "warframe/index";
|
|
523
548
|
export function wmMessage(img: Element, item: ItemShort, orders: OrderWithUser[]): Element;
|
|
524
549
|
}
|
|
525
550
|
declare module "commands/wfm" {
|
|
@@ -549,3 +574,7 @@ declare module "index" {
|
|
|
549
574
|
export const Config: Schema<PluginConfig>;
|
|
550
575
|
export function apply(ctx: Context): void;
|
|
551
576
|
}
|
|
577
|
+
declare module "warframe/types/result" {
|
|
578
|
+
export { failure, type WarframeError, type WarframeErrorCode, type WarframeErrorParams, type WarframeFailure, type WarframeResult, } from "warframe/types/warframe-result";
|
|
579
|
+
export type { WarframeResult as ServiceResult } from "warframe/types/warframe-result";
|
|
580
|
+
}
|