koishi-plugin-warframe 1.6.6 → 1.7.0

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 CHANGED
@@ -1,61 +1,27 @@
1
- declare module "components/miscs" {
2
- import type { Element } from 'koishi';
3
- import type { RivenWeaponItem } from '../types/miscs/lab';
4
- export function HotRivenComponent(data: RivenWeaponItem[]): Element;
5
- }
6
- declare module "types/result" {
7
- import type { MessageKey, MessageParams } from "messages";
8
- export interface ServiceFailure {
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
- message: MessageKey;
11
- params?: MessageParams;
12
+ error: WarframeError;
12
13
  }
13
- export type ServiceResult<TData> = {
14
+ export type WarframeResult<TData> = {
14
15
  ok: true;
15
16
  data: TData;
16
- } | ServiceFailure;
17
+ } | WarframeFailure;
18
+ export function failure(code: WarframeErrorCode, retryable?: boolean, params?: WarframeErrorParams): WarframeFailure;
17
19
  }
18
- declare module "messages" {
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/color" {
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/color";
123
- export * from "utils/http";
124
- export * from "utils/logger";
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("types/miscs/lab").RivenWeaponItem[]>;
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 { ServiceResult } from "types/result";
138
- export function getHotRivenWeapons(): Promise<ServiceResult<RivenWeaponItem[]>>;
88
+ import type { WarframeResult } from "warframe/types/warframe-result";
89
+ export function getHotRivenWeapons(): Promise<WarframeResult<RivenWeaponItem[]>>;
90
+ }
91
+ declare module "warframe/types/ocr" {
92
+ export interface OcrAPISecret {
93
+ id: string;
94
+ key: string;
95
+ }
139
96
  }
140
- declare module "assets/index" {
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,29 +178,32 @@ 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" {
182
+ import type WorldState from 'warframe-worldstate-parser';
183
+ type ParsedFissure = WorldState['fissures'][number];
184
+ export function adaptFissure(fissure: ParsedFissure): Promise<Fissure>;
225
185
  export const globalWorldState: AsyncCache<{
226
- raw: import("warframe-worldstate-parser").WorldState;
186
+ raw: WorldState;
227
187
  fissures: Fissure[];
228
188
  spFissures: Fissure[];
229
189
  rjFissures: Fissure[];
230
190
  }>;
231
191
  }
232
- declare module "data/wf/relics" {
192
+ declare module "warframe/data/wf/relics" {
233
193
  export const relics: Record<string, Relic>;
234
194
  }
235
- declare module "data/wf/rivenBaseValues" {
195
+ declare module "warframe/data/wf/rivenBaseValues" {
236
196
  export const rivenAttrValueDict: Record<string, Record<string, number>>;
237
197
  }
238
- declare module "data/wf/rivenDisposition" {
198
+ declare module "warframe/data/wf/rivenDisposition" {
239
199
  import type { RivenWeaponDisposition } from '../../types/wf/riven';
240
200
  export const weaponRivenDispositionDict: Record<string, RivenWeaponDisposition>;
241
201
  }
242
- declare module "data/wf/rivenStatData" {
202
+ declare module "warframe/data/wf/rivenStatData" {
243
203
  import type { RivenStatFixFactorMap } from '../../types/wf/riven';
244
204
  export const rivenStatFixFactor: RivenStatFixFactorMap;
245
205
  }
246
- declare module "infrastructure/wfm-client" {
206
+ declare module "warframe/infrastructure/wfm-client" {
247
207
  export const wfmClient: {
248
208
  items: {
249
209
  getList: () => Promise<import("wfm-api-client").ItemShort[] | undefined>;
@@ -263,7 +223,7 @@ declare module "infrastructure/wfm-client" {
263
223
  };
264
224
  };
265
225
  }
266
- declare module "data/wfm/globalRivenAttribute" {
226
+ declare module "warframe/data/wfm/globalRivenAttribute" {
267
227
  import type { RivenAttribute } from '../../types/wfm';
268
228
  export function globalRivenAttributeFactory(rivenAttributeData?: RivenAttribute[]): Promise<{
269
229
  globalRivenAttributeList: RivenAttribute[];
@@ -280,7 +240,7 @@ declare module "data/wfm/globalRivenAttribute" {
280
240
  };
281
241
  }>): void;
282
242
  }
283
- declare module "data/wfm/globalRivenItem" {
243
+ declare module "warframe/data/wfm/globalRivenItem" {
284
244
  import type { RivenItem } from '../../types/wfm';
285
245
  export interface GlobalRivenItemWordPrefixCandidate {
286
246
  item: RivenItem;
@@ -300,20 +260,20 @@ declare module "data/wfm/globalRivenItem" {
300
260
  globalRivenItemWordPrefixCandidates: GlobalRivenItemWordPrefixCandidate[];
301
261
  }>;
302
262
  }
303
- declare module "infrastructure/ocr-api" {
304
- import type { OcrAPISecret } from '../types/config';
263
+ declare module "warframe/infrastructure/ocr-api" {
264
+ import type { OcrAPISecret } from "warframe/types/ocr";
305
265
  export function extractTextFromImage(image: string | Blob, secret: OcrAPISecret): Promise<string[] | undefined>;
306
266
  }
307
- declare module "services/wf-service" {
267
+ declare module "warframe/services/wf-service" {
308
268
  import type { WeeklyRiven } from 'warframe-weekly-rivens';
309
- import type { OcrAPISecret } from '../types/config';
310
- import type { ServiceResult } from "types/result";
269
+ import type { OcrAPISecret } from "warframe/types/ocr";
270
+ import type { WarframeResult } from "warframe/types/warframe-result";
311
271
  import type { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
312
272
  import type { RivenAttribute } from '../types/wfm';
313
- import { weaponRivenDispositionDict } from "data/wf/rivenDisposition";
314
- export function getRelic(input: string): Promise<ServiceResult<Relic>>;
315
- export function getArbitrations(day?: number): ServiceResult<Arbitration[]>;
316
- export function getWeekly(): Promise<ServiceResult<{
273
+ import { weaponRivenDispositionDict } from "warframe/data/wf/rivenDisposition";
274
+ export function getRelic(input: string): Promise<WarframeResult<Relic>>;
275
+ export function getArbitrations(day?: number): WarframeResult<Arbitration[]>;
276
+ export function getWeekly(): Promise<WarframeResult<{
317
277
  archonHunt: ArchonHunt;
318
278
  deepArchimedea: ArchiMedea;
319
279
  temporalArchimedea: ArchiMedea;
@@ -325,14 +285,14 @@ declare module "services/wf-service" {
325
285
  allIncarnons: string[][];
326
286
  allWarframes: string[][];
327
287
  };
328
- export function getFissures(): Promise<ServiceResult<Fissure[]>>;
329
- export function getSteelPathFissures(): Promise<ServiceResult<Fissure[]>>;
330
- export function getRailjackFissures(): Promise<ServiceResult<Fissure[]>>;
331
- export function getAnalyzedRiven(secret: OcrAPISecret, url: string): Promise<ServiceResult<RivenStatAnalyzeResult>>;
332
- export function getVoidTrader(): Promise<ServiceResult<VoidTrader>>;
288
+ export function getFissures(): Promise<WarframeResult<Fissure[]>>;
289
+ export function getSteelPathFissures(): Promise<WarframeResult<Fissure[]>>;
290
+ export function getRailjackFissures(): Promise<WarframeResult<Fissure[]>>;
291
+ export function getAnalyzedRiven(secret: OcrAPISecret, url: string): Promise<WarframeResult<RivenStatAnalyzeResult>>;
292
+ export function getVoidTrader(): Promise<WarframeResult<VoidTrader>>;
333
293
  export function filterWeeklyRivens(data: WeeklyRiven[], minPrice: number, minPop?: number): WeeklyRiven[];
334
294
  export function getWeeklyRivens(minPrice: number): Promise<WeeklyRiven[]>;
335
- export function getStaticRivenStats(weaponType: string, statType: string, disposition: number): Promise<ServiceResult<RivenStatResult>>;
295
+ export function getStaticRivenStats(weaponType: string, statType: string, disposition: number): Promise<WarframeResult<RivenStatResult>>;
336
296
  export function getWeaponRivenDisposition(name: string): (typeof weaponRivenDispositionDict)[string] | undefined;
337
297
  export function parseOCRResult(ocrResult: string[]): Promise<{
338
298
  name: string;
@@ -349,12 +309,12 @@ declare module "services/wf-service" {
349
309
  value: number;
350
310
  prefix: string;
351
311
  }[];
352
- }): ServiceResult<RivenStatAnalyzeResult>;
312
+ }): WarframeResult<RivenStatAnalyzeResult>;
353
313
  }
354
- declare module "data/wfm/globalDucatnator" {
314
+ declare module "warframe/data/wfm/globalDucatnator" {
355
315
  export const globalDucatnatorIDDict: AsyncCache<Record<string, import("wfm-api-client").Ducatnator> | undefined>;
356
316
  }
357
- declare module "data/wfm/globalItem" {
317
+ declare module "warframe/data/wfm/globalItem" {
358
318
  import type { ItemShort } from '../../types/wfm';
359
319
  export interface GlobalItemWordPrefixCandidate {
360
320
  item: ItemShort;
@@ -383,8 +343,8 @@ declare module "data/wfm/globalItem" {
383
343
  globalItemWordPrefixCandidates: GlobalItemWordPrefixCandidate[];
384
344
  }>): void;
385
345
  }
386
- declare module "services/wfm-service/wfm-service.item-matcher" {
387
- import type { GlobalItemWordPrefixCandidate } from "data/wfm/globalItem";
346
+ declare module "warframe/services/wfm-service/wfm-service.item-matcher" {
347
+ import type { GlobalItemWordPrefixCandidate } from "warframe/data/wfm/globalItem";
388
348
  import type { ItemShort } from '../../types/wfm';
389
349
  interface WFMItemLookupData {
390
350
  globalItemDict: Record<string, ItemShort>;
@@ -425,8 +385,8 @@ declare module "services/wfm-service/wfm-service.item-matcher" {
425
385
  export const stringToWFMItem: (input: string) => Promise<ItemShort | undefined>;
426
386
  export const transformByWarframeAlias: (input: string) => string | undefined;
427
387
  }
428
- declare module "services/wfm-service/wfm-service.riven-item-matcher" {
429
- import type { GlobalRivenItemWordPrefixCandidate } from "data/wfm/globalRivenItem";
388
+ declare module "warframe/services/wfm-service/wfm-service.riven-item-matcher" {
389
+ import type { GlobalRivenItemWordPrefixCandidate } from "warframe/data/wfm/globalRivenItem";
430
390
  import type { RivenItem } from '../../types/wfm';
431
391
  interface WFMRivenItemLookupData {
432
392
  globalRivenItemDict: Record<string, RivenItem>;
@@ -442,27 +402,121 @@ declare module "services/wfm-service/wfm-service.riven-item-matcher" {
442
402
  export const matchByShortHand: typeof shortHandProcess;
443
403
  export const stringToWFMItem: typeof findRivenItemByName;
444
404
  }
445
- declare module "services/wfm-service/index" {
446
- import type { ServiceResult } from "types/result";
405
+ declare module "warframe/services/wfm-service/index" {
406
+ import type { WarframeResult } from "warframe/types/warframe-result";
447
407
  import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from '../../types/wfm';
448
- import { stringToWFMItem } from "services/wfm-service/wfm-service.item-matcher";
408
+ import { stringToWFMItem } from "warframe/services/wfm-service/wfm-service.item-matcher";
449
409
  export { stringToWFMItem };
450
410
  export function updateCache(): Promise<string>;
451
- export function getItemOrders(input: string): Promise<ServiceResult<{
411
+ export function getItemOrders(input: string): Promise<WarframeResult<{
452
412
  item: ItemShort;
453
413
  orders: OrderWithUser[];
454
414
  }>>;
455
- export function getRivenOrders(input: string): Promise<ServiceResult<{
415
+ export function getRivenOrders(input: string): Promise<WarframeResult<{
456
416
  item: RivenItem;
457
417
  orders: RivenOrderInternal[];
458
418
  }>>;
459
419
  export function applyRelicData(relic: Relic): Promise<OutputRelic>;
460
420
  export const primedModHistory: AsyncCache<PrimedModHistoryItem[]>;
461
421
  }
462
- declare module "services/index" {
463
- export * from "services/miscs-service";
464
- export * from "services/wf-service";
465
- export * from "services/wfm-service/index";
422
+ declare module "warframe/services/world-state-refresh" {
423
+ import { globalWorldState } from "warframe/data/wf/globalWorldState";
424
+ export type WorldStateSnapshot = Awaited<ReturnType<typeof globalWorldState.get>>;
425
+ export type WorldStateNotification = {
426
+ type: 'fissure';
427
+ id: string;
428
+ tier: string;
429
+ tierNum: number;
430
+ node: WFRegionShort;
431
+ hard: boolean;
432
+ category: 'normal' | 'steel-path' | 'railjack';
433
+ expiry: number;
434
+ } | {
435
+ type: 'void-trader';
436
+ id: string;
437
+ character: string;
438
+ location: string;
439
+ expiry: number;
440
+ } | {
441
+ type: 'daily-deal';
442
+ id: string;
443
+ item: string;
444
+ originalPrice: number;
445
+ salePrice: number;
446
+ discount: number;
447
+ expiry: number;
448
+ } | {
449
+ type: 'alert';
450
+ id: string;
451
+ description: string;
452
+ node: string;
453
+ missionType: string;
454
+ reward: string;
455
+ expiry: number;
456
+ };
457
+ export function diffWorldStates(previous: WorldStateSnapshot, current: WorldStateSnapshot): Promise<WorldStateNotification[]>;
458
+ export interface WorldStateSource {
459
+ update: () => Promise<WorldStateSnapshot>;
460
+ }
461
+ export function createWorldStateRefresher(source?: WorldStateSource): () => Promise<WorldStateNotification[]>;
462
+ export const refreshWorldState: () => Promise<WorldStateNotification[]>;
463
+ }
464
+ declare module "warframe/services/index" {
465
+ export * from "warframe/services/miscs-service";
466
+ export * from "warframe/services/wf-service";
467
+ export * from "warframe/services/wfm-service/index";
468
+ export * from "warframe/services/world-state-refresh";
469
+ }
470
+ declare module "warframe/index" {
471
+ export * from "warframe/services/index";
472
+ export type { RivenWeaponItem } from './types/miscs/lab';
473
+ export type { OcrAPISecret } from "warframe/types/ocr";
474
+ export { failure } from "warframe/types/warframe-result";
475
+ export type { WarframeError, WarframeErrorCode, WarframeErrorParams, WarframeFailure, WarframeResult, } from "warframe/types/warframe-result";
476
+ export type { RivenStatAnalyzeResult, RivenStatResult, } from './types/wf/riven';
477
+ export type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenAttributeShortInternal, RivenAttributeUnit, RivenItem, RivenOrderInternal, } from './types/wfm';
478
+ export { msToHumanReadable } from "warframe/utils/time";
479
+ }
480
+ declare module "components/miscs" {
481
+ import type { Element } from 'koishi';
482
+ import type { RivenWeaponItem } from "warframe/index";
483
+ export function HotRivenComponent(data: RivenWeaponItem[]): Element;
484
+ }
485
+ declare module "messages" {
486
+ import type { WarframeFailure } from "warframe/index";
487
+ export const messages: {
488
+ readonly 'common.fetchFailed': "内部错误,获取最新信息失败";
489
+ readonly 'relic.invalidName': "请提供正确的遗物名称";
490
+ readonly 'relic.dataLoading': "遗物数据未加载完成,请稍后再试";
491
+ readonly 'relic.notFound': "未找到对应遗物信息";
492
+ readonly 'arbitration.invalidDayRange': "天数需小于等于14且大于0";
493
+ readonly 'voidTrader.drifting': "虚空商人仍在未知地带漂流...";
494
+ readonly 'voidTrader.arriving': "距离虚空商人到达还有: {time}";
495
+ readonly 'riven.imageNotFound': "未检测到图片";
496
+ readonly 'riven.ocrNotConfigured': "未配置 OCR,请在插件设置中配置。";
497
+ readonly 'riven.imageFetchFailed': "获取图片失败";
498
+ readonly 'riven.imageParseFailed': "解析图片失败";
499
+ readonly 'riven.weaponNotFound': "未找到武器: {weapon}";
500
+ readonly 'riven.dispositionError': "裂罅倾向错误";
501
+ readonly 'riven.weaponTypeError': "武器类型错误";
502
+ readonly 'riven.statTypeError': "词条类型错误";
503
+ readonly 'riven.invalidParams': "请输入正确参数";
504
+ readonly 'riven.noWeeklyData': "没有找到符合条件的紫卡参考数据";
505
+ readonly 'wfm.inputItemName': "请输入物品名称";
506
+ readonly 'wfm.itemNotFound': "未找到物品: {input}";
507
+ readonly 'wfm.orderFetchFailed': "订单获取失败,请稍后重试";
508
+ readonly 'wfm.noOnlineSeller': "当前没有在线游戏中的卖家";
509
+ readonly 'wfm.rivenWeaponNotFound': "未找到紫卡武器: {input}";
510
+ readonly 'wfm.rivenOrderFetchFailed': "紫卡订单获取失败,请稍后重试";
511
+ readonly 'wfm.noOnlineRivenSeller': "当前没有在线出售的紫卡";
512
+ readonly 'miscs.hotRiven.noData': "暂无热门紫卡数据";
513
+ readonly 'miscs.hotRiven.fetchFailed': "获取热门紫卡数据失败";
514
+ readonly 'miscs.inDevelopment': "功能暂未开放";
515
+ };
516
+ export type MessageKey = keyof typeof messages;
517
+ export type MessageParams = Record<string, string | number>;
518
+ export function t(message: MessageKey, params?: MessageParams): string;
519
+ export function t(result: WarframeFailure): string;
466
520
  }
467
521
  declare module "commands/miscs" {
468
522
  import type { PluginDependencies } from '../types/config';
@@ -472,10 +526,27 @@ declare module "commands/miscs" {
472
526
  inDevelopment: () => string;
473
527
  };
474
528
  }
529
+ declare module "utils/assets" {
530
+ export function loadAssetJson<T>(path: string): T;
531
+ export function loadAssetText(path: string): string;
532
+ }
533
+ declare module "utils/color" {
534
+ export function lerp(start: number, end: number, t: number): number;
535
+ export function hexToRgb(hex: string): {
536
+ r: number;
537
+ g: number;
538
+ b: number;
539
+ };
540
+ export function rgbToHex(r: number, g: number, b: number): string;
541
+ }
542
+ declare module "utils/index" {
543
+ export * from "utils/assets";
544
+ export * from "utils/color";
545
+ }
475
546
  declare module "components/wf" {
476
547
  import type { Element } from 'koishi';
477
548
  import type { WeeklyRiven } from 'warframe-weekly-rivens';
478
- import type { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
549
+ import type { RivenStatAnalyzeResult, RivenStatResult } from "warframe/index";
479
550
  export function ArbitrationComponent(arbi: Arbitration[]): Element;
480
551
  export function CircuitComponent(currentIncarnons: number, currentWarframes: number, allIncarnons: string[][], allWarframes: string[][]): Element;
481
552
  export function FissureComponent(fissures: Fissure[], type: 'fissure' | 'sp-fissure' | 'rj-fissure'): Element;
@@ -512,14 +583,14 @@ declare module "components/render" {
512
583
  }
513
584
  declare module "components/wfm" {
514
585
  import type Element from '@satorijs/element';
515
- import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from '../types/wfm';
586
+ import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from "warframe/index";
516
587
  export function ItemOrderComponent(item: ItemShort, orders: OrderWithUser[]): Element;
517
588
  export function RivenOrderComponent(item: RivenItem, orders: RivenOrderInternal[]): Element;
518
589
  export function PrimedModHistoryComponent(history: PrimedModHistoryItem[]): Element;
519
590
  }
520
591
  declare module "messages/wfm" {
521
592
  import type { Element } from 'koishi';
522
- import type { ItemShort, OrderWithUser } from '../types/wfm';
593
+ import type { ItemShort, OrderWithUser } from "warframe/index";
523
594
  export function wmMessage(img: Element, item: ItemShort, orders: OrderWithUser[]): Element;
524
595
  }
525
596
  declare module "commands/wfm" {
@@ -537,6 +608,23 @@ declare module "commands/index" {
537
608
  export * from "commands/wf";
538
609
  export * from "commands/wfm";
539
610
  }
611
+ declare module "messages/world-state" {
612
+ import type { Element } from 'koishi';
613
+ import type { WorldStateNotification } from "warframe/index";
614
+ export function createWorldStateMessages(items: WorldStateNotification[]): Promise<Element[]>;
615
+ }
616
+ declare module "schedules/world-state" {
617
+ import type { Context } from 'koishi';
618
+ import type { PluginDependencies } from '../types/config';
619
+ import type { WorldStateNotification } from "warframe/index";
620
+ type Refresh = () => Promise<WorldStateNotification[]>;
621
+ export function setupWorldStateSchedule(ctx: Context, deps: PluginDependencies, refresh?: Refresh): void;
622
+ }
623
+ declare module "schedules/index" {
624
+ import type { Context } from 'koishi';
625
+ import type { PluginDependencies } from '../types/config';
626
+ export function setupSchedules(ctx: Context, deps: PluginDependencies): void;
627
+ }
540
628
  declare module "index" {
541
629
  import type { Context } from 'koishi';
542
630
  import type { Config as PluginConfig } from './types/config';
@@ -549,3 +637,7 @@ declare module "index" {
549
637
  export const Config: Schema<PluginConfig>;
550
638
  export function apply(ctx: Context): void;
551
639
  }
640
+ declare module "warframe/types/result" {
641
+ export { failure, type WarframeError, type WarframeErrorCode, type WarframeErrorParams, type WarframeFailure, type WarframeResult, } from "warframe/types/warframe-result";
642
+ export type { WarframeResult as ServiceResult } from "warframe/types/warframe-result";
643
+ }