koishi-plugin-warframe 1.6.0 → 1.6.2
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 +418 -290
- package/lib/index.js +3359 -3351
- package/lib/index.tsbuildinfo +1 -1
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,294 +1,422 @@
|
|
|
1
|
-
|
|
2
|
-
import { Element
|
|
3
|
-
import { RivenWeaponItem } from '../types/miscs/lab';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import Element from '@satorijs/element';
|
|
14
|
-
import Puppeteer from 'koishi-plugin-puppeteer';
|
|
15
|
-
import { Config as PluginConfig } from './types/config';
|
|
16
|
-
export function HotRivenComponent(data: RivenWeaponItem[]): Element;
|
|
17
|
-
export function loadAssetJson<T>(path: string): T;
|
|
18
|
-
export function loadAssetText(path: string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Creates an async cache with a time-to-live (TTL).
|
|
21
|
-
* @param factory Function to fetch fresh data.
|
|
22
|
-
* @param ttlMs Time-to-live in milliseconds. Defaults to 60_000 meaning 1 minute. Set to -1 for infinity duration.
|
|
23
|
-
* @returns A cache instance.
|
|
24
|
-
*/
|
|
25
|
-
export function createAsyncCache<T>(factory: AsyncCacheFactory<T>, ttlMs?: number): AsyncCache<T>;
|
|
26
|
-
export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => Record<string, T>;
|
|
27
|
-
export const listToDictSpec: <TObj, TValue>(dict: TObj[], predict: (obj: TObj) => string[], value: (obj: TObj) => TValue) => Record<string, TValue>;
|
|
28
|
-
export const dictToKeyDict: <T>(dict: Record<string, T>, predict: (obj: T) => string[]) => Record<string, string>;
|
|
29
|
-
export function lerp(start: number, end: number, t: number): number;
|
|
30
|
-
export function hexToRgb(hex: string): {
|
|
31
|
-
r: number;
|
|
32
|
-
g: number;
|
|
33
|
-
b: number;
|
|
34
|
-
};
|
|
35
|
-
export function rgbToHex(r: number, g: number, b: number): string;
|
|
36
|
-
export const logger: Logger;
|
|
37
|
-
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
38
|
-
export function fetchAsyncText(url: string, method?: HttpMethod): Promise<string | undefined>;
|
|
39
|
-
export function fetchAsyncData<T>(url: string, method?: HttpMethod): Promise<T | undefined>;
|
|
40
|
-
export function fetchAsyncImage(url: string, method?: HttpMethod): Promise<Blob | undefined>;
|
|
41
|
-
export function normalizeName(text: string): string;
|
|
42
|
-
export function fullWidthToHalfWidth(text: string): string;
|
|
43
|
-
export const removeSpace: (text: string) => string;
|
|
44
|
-
export function pascalToSpaced(text: string): string;
|
|
45
|
-
export function toPascalCase(text: string): string;
|
|
46
|
-
export function normalSimilarity(a: string, b: string): number;
|
|
47
|
-
export function tokenSimilarity(a: string, b: string): number;
|
|
48
|
-
export function toTimeStamp(timeStr: string): number;
|
|
49
|
-
/**
|
|
50
|
-
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
51
|
-
* @param {number} ms - 待转换的毫秒数(非负)
|
|
52
|
-
* @returns {string} 示例:
|
|
53
|
-
*
|
|
54
|
-
* 90061000ms → "1天1小时1分钟1秒"
|
|
55
|
-
*
|
|
56
|
-
* 3661000ms → "1小时1分钟1秒"
|
|
57
|
-
*
|
|
58
|
-
* 61000ms → "1分钟1秒"
|
|
59
|
-
*
|
|
60
|
-
* 500ms → "0秒"
|
|
61
|
-
*/
|
|
62
|
-
export function msToHumanReadable(ms: number): string;
|
|
63
|
-
export function sleep(ms: number): Promise<void>;
|
|
64
|
-
export function getHotRivenWeapons(num?: number): Promise<RivenWeaponItem[] | undefined>;
|
|
65
|
-
export const globalHotRivenWeapons: AsyncCache<import("types/miscs/lab").RivenWeaponItem[]>;
|
|
66
|
-
export function createMiscsCommands(deps: PluginDependencies): {
|
|
67
|
-
hotRivenCommand: () => Promise<string>;
|
|
68
|
-
};
|
|
69
|
-
export function ArbitrationComponent(arbi: Arbitration[]): Element;
|
|
70
|
-
export function CircuitComponent(currentIncarnons: number, currentWarframes: number, allIncarnons: string[][], allWarframes: string[][]): Element;
|
|
71
|
-
export function FissureComponent(fissures: Fissure[], type: 'fissure' | 'sp-fissure' | 'rj-fissure'): Element;
|
|
72
|
-
export function WeeklyRivenComponent(items: WeeklyRiven[], minPrice: number): Element;
|
|
73
|
-
export function WeeklyComponent(archon: ArchonHunt, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea): Element;
|
|
74
|
-
export function RelicComponent(relic: OutputRelic): Element;
|
|
75
|
-
export function RivenComponent(data: RivenStatAnalyzeResult): Element;
|
|
76
|
-
export function RivenStatComponent(data: RivenStatResult): Element;
|
|
77
|
-
export function VoidTraderComponent(data: VoidTrader): Element;
|
|
78
|
-
export interface BaroParsedItem {
|
|
79
|
-
name: string;
|
|
80
|
-
last: string;
|
|
81
|
-
plats: number;
|
|
82
|
-
}
|
|
83
|
-
export type ArbyRewards = Record<string, number>;
|
|
84
|
-
export const incarnons: string[][], warframes: string[][];
|
|
85
|
-
export const rivenAttrValues: Record<string, Record<string, number>>;
|
|
86
|
-
export const rivenCalc: {
|
|
87
|
-
weapons: RivenWeaponDisposition["calc"][];
|
|
88
|
-
};
|
|
89
|
-
export const dictEnExtra: Record<string, string>;
|
|
90
|
-
export const dictZhExtra: Record<string, string>;
|
|
91
|
-
export const arbitrationScheduleText: string;
|
|
92
|
-
export const arbyRewards: ArbyRewards;
|
|
93
|
-
export const Baro: string;
|
|
94
|
-
export const BaroParsed: BaroParsedItem[];
|
|
95
|
-
export const arbitrationSchedule: ArbitrationShort[];
|
|
96
|
-
export function getWorldState(json?: string): Promise<WorldState>;
|
|
97
|
-
export function getVoidTraderHistory(data?: string): Promise<VoidTraderData | undefined>;
|
|
98
|
-
declare interface VoidTraderItem {
|
|
99
|
-
Name: string;
|
|
100
|
-
Type: string;
|
|
101
|
-
DucatCost: number;
|
|
102
|
-
CreditCost: number;
|
|
103
|
-
Image: string;
|
|
104
|
-
Link: string;
|
|
105
|
-
OfferingDates?: string[];
|
|
106
|
-
PcOfferingDates?: string[];
|
|
107
|
-
ConsoleOfferingDates?: string[];
|
|
108
|
-
}
|
|
109
|
-
declare interface VoidTraderData {
|
|
110
|
-
[itemName: string]: VoidTraderItem;
|
|
111
|
-
}
|
|
112
|
-
export function regionToShort(region: IRegion, dict: Record<string, string>): WFRegionShort;
|
|
113
|
-
export function relicQualityToName(quality: string): RelicQuality;
|
|
114
|
-
/**
|
|
115
|
-
* transform relic quality to translation key, return original if not matched.
|
|
116
|
-
*
|
|
117
|
-
* eg. "VPQ_BRONZE" => "/Lotus/Language/Relics/VoidProjectionQuality_Bronze".
|
|
118
|
-
* @param quality directly provided from `IRelic.quality` expected to start with "VPQ_".
|
|
119
|
-
*/
|
|
120
|
-
export function relicQualityToTransKey(quality: string): string;
|
|
121
|
-
/**
|
|
122
|
-
* transform relic era to translation key.
|
|
123
|
-
*
|
|
124
|
-
* eg. "Lith" => "/Lotus/Language/Relics/Era_LITH".
|
|
125
|
-
* @param era directly provided from `IRelic.era`.
|
|
126
|
-
*/
|
|
127
|
-
export function relicEraToTransKey(era: string): string;
|
|
128
|
-
export function fixRelicRewardKey(item: string): string;
|
|
129
|
-
export function getSolNodeKey(name: string): Promise<string>;
|
|
130
|
-
export function getMissionTypeKey(name: string): Promise<TMissionType>;
|
|
131
|
-
export const fissureTierName: {
|
|
132
|
-
1: string;
|
|
133
|
-
2: string;
|
|
134
|
-
3: string;
|
|
135
|
-
4: string;
|
|
136
|
-
5: string;
|
|
137
|
-
6: string;
|
|
138
|
-
7: string;
|
|
139
|
-
};
|
|
140
|
-
export function fissureTierNumToNumber(a: number | string): number;
|
|
141
|
-
export function getVoidTraderItem(i: {
|
|
142
|
-
item: string;
|
|
143
|
-
uniqueName: string;
|
|
144
|
-
ducats: number;
|
|
145
|
-
credits: number;
|
|
146
|
-
}): VoidTraderItem;
|
|
147
|
-
export const globalWorldState: AsyncCache<{
|
|
148
|
-
raw: import("warframe-worldstate-parser").WorldState;
|
|
149
|
-
fissures: Fissure[];
|
|
150
|
-
spFissures: Fissure[];
|
|
151
|
-
rjFissures: Fissure[];
|
|
152
|
-
}>;
|
|
153
|
-
export const relics: Record<string, Relic>;
|
|
154
|
-
export const rivenAttrValueDict: Record<string, Record<string, number>>;
|
|
155
|
-
export const weaponRivenDispositionDict: Record<string, RivenWeaponDisposition>;
|
|
156
|
-
export const rivenStatFixFactor: RivenStatFixFactorMap;
|
|
157
|
-
export const wfmClient: {
|
|
158
|
-
items: {
|
|
159
|
-
getList: () => Promise<import("wfm-api-client").ItemShort[] | undefined>;
|
|
160
|
-
getStatistics: (itemId: string) => Promise<import("wfm-api-client").StatisticsCollection | undefined>;
|
|
161
|
-
getOrders: (itemId: string) => Promise<import("wfm-api-client").OrderWithUser[] | undefined>;
|
|
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
|
+
export type ServiceResult<TData> = {
|
|
8
|
+
ok: true;
|
|
9
|
+
data: TData;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
message: string;
|
|
162
13
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
14
|
+
}
|
|
15
|
+
declare module "utils/assets" {
|
|
16
|
+
export function loadAssetJson<T>(path: string): T;
|
|
17
|
+
export function loadAssetText(path: string): string;
|
|
18
|
+
}
|
|
19
|
+
declare module "utils/cache" {
|
|
20
|
+
/**
|
|
21
|
+
* Creates an async cache with a time-to-live (TTL).
|
|
22
|
+
* @param factory Function to fetch fresh data.
|
|
23
|
+
* @param ttlMs Time-to-live in milliseconds. Defaults to 60_000 meaning 1 minute. Set to -1 for infinity duration.
|
|
24
|
+
* @returns A cache instance.
|
|
25
|
+
*/
|
|
26
|
+
export function createAsyncCache<T>(factory: AsyncCacheFactory<T>, ttlMs?: number): AsyncCache<T>;
|
|
27
|
+
}
|
|
28
|
+
declare module "utils/collection" {
|
|
29
|
+
export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => Record<string, T>;
|
|
30
|
+
export const listToDictSpec: <TObj, TValue>(dict: TObj[], predict: (obj: TObj) => string[], value: (obj: TObj) => TValue) => Record<string, TValue>;
|
|
31
|
+
export const dictToKeyDict: <T>(dict: Record<string, T>, predict: (obj: T) => string[]) => Record<string, string>;
|
|
32
|
+
}
|
|
33
|
+
declare module "utils/color" {
|
|
34
|
+
export function lerp(start: number, end: number, t: number): number;
|
|
35
|
+
export function hexToRgb(hex: string): {
|
|
36
|
+
r: number;
|
|
37
|
+
g: number;
|
|
38
|
+
b: number;
|
|
167
39
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
40
|
+
export function rgbToHex(r: number, g: number, b: number): string;
|
|
41
|
+
}
|
|
42
|
+
declare module "utils/logger" {
|
|
43
|
+
import { Logger } from 'koishi';
|
|
44
|
+
export const logger: Logger;
|
|
45
|
+
}
|
|
46
|
+
declare module "utils/http" {
|
|
47
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
|
|
48
|
+
export function fetchAsyncText(url: string, method?: HttpMethod): Promise<string | undefined>;
|
|
49
|
+
export function fetchAsyncData<T>(url: string, method?: HttpMethod): Promise<T | undefined>;
|
|
50
|
+
export function fetchAsyncImage(url: string, method?: HttpMethod): Promise<Blob | undefined>;
|
|
51
|
+
}
|
|
52
|
+
declare module "utils/text" {
|
|
53
|
+
export function normalizeName(text: string): string;
|
|
54
|
+
export function fullWidthToHalfWidth(text: string): string;
|
|
55
|
+
export const removeSpace: (text: string) => string;
|
|
56
|
+
export function pascalToSpaced(text: string): string;
|
|
57
|
+
export function toPascalCase(text: string): string;
|
|
58
|
+
export function normalSimilarity(a: string, b: string): number;
|
|
59
|
+
export function tokenSimilarity(a: string, b: string): number;
|
|
60
|
+
}
|
|
61
|
+
declare module "utils/time" {
|
|
62
|
+
export function toTimeStamp(timeStr: string): number;
|
|
63
|
+
/**
|
|
64
|
+
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
65
|
+
* @param {number} ms - 待转换的毫秒数(非负)
|
|
66
|
+
* @returns {string} 示例:
|
|
67
|
+
*
|
|
68
|
+
* 90061000ms → "1天1小时1分钟1秒"
|
|
69
|
+
*
|
|
70
|
+
* 3661000ms → "1小时1分钟1秒"
|
|
71
|
+
*
|
|
72
|
+
* 61000ms → "1分钟1秒"
|
|
73
|
+
*
|
|
74
|
+
* 500ms → "0秒"
|
|
75
|
+
*/
|
|
76
|
+
export function msToHumanReadable(ms: number): string;
|
|
77
|
+
export function sleep(ms: number): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
declare module "utils/index" {
|
|
80
|
+
export * from "utils/assets";
|
|
81
|
+
export * from "utils/cache";
|
|
82
|
+
export * from "utils/collection";
|
|
83
|
+
export * from "utils/color";
|
|
84
|
+
export * from "utils/http";
|
|
85
|
+
export * from "utils/logger";
|
|
86
|
+
export * from "utils/text";
|
|
87
|
+
export * from "utils/time";
|
|
88
|
+
}
|
|
89
|
+
declare module "infrastructure/miscs/lab-api" {
|
|
90
|
+
import type { RivenWeaponItem } from '../../types/miscs/lab';
|
|
91
|
+
export function getHotRivenWeapons(num?: number): Promise<RivenWeaponItem[] | undefined>;
|
|
92
|
+
}
|
|
93
|
+
declare module "data/miscs/lab" {
|
|
94
|
+
export const globalHotRivenWeapons: AsyncCache<import("types/miscs/lab").RivenWeaponItem[]>;
|
|
95
|
+
}
|
|
96
|
+
declare module "services/miscs-service" {
|
|
97
|
+
import type { RivenWeaponItem } from '../types/miscs/lab';
|
|
98
|
+
import type { ServiceResult } from "types/result";
|
|
99
|
+
export function getHotRivenWeapons(): Promise<ServiceResult<RivenWeaponItem[]>>;
|
|
100
|
+
}
|
|
101
|
+
declare module "assets/index" {
|
|
102
|
+
import type { RivenWeaponDisposition } from '../types/wf/riven';
|
|
103
|
+
export interface BaroParsedItem {
|
|
104
|
+
name: string;
|
|
105
|
+
last: string;
|
|
106
|
+
plats: number;
|
|
107
|
+
}
|
|
108
|
+
export type ArbyRewards = Record<string, number>;
|
|
109
|
+
export const incarnons: string[][], warframes: string[][];
|
|
110
|
+
export const rivenAttrValues: Record<string, Record<string, number>>;
|
|
111
|
+
export const rivenCalc: {
|
|
112
|
+
weapons: RivenWeaponDisposition["calc"][];
|
|
173
113
|
};
|
|
174
|
-
|
|
175
|
-
export
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
export
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
114
|
+
export const dictEnExtra: Record<string, string>;
|
|
115
|
+
export const dictZhExtra: Record<string, string>;
|
|
116
|
+
export const arbitrationScheduleText: string;
|
|
117
|
+
export const arbyRewards: ArbyRewards;
|
|
118
|
+
export const Baro: string;
|
|
119
|
+
export const BaroParsed: BaroParsedItem[];
|
|
120
|
+
}
|
|
121
|
+
declare module "data/wf/arbitrationSchedule" {
|
|
122
|
+
export const arbitrationSchedule: ArbitrationShort[];
|
|
123
|
+
}
|
|
124
|
+
declare module "infrastructure/wf/wf-api" {
|
|
125
|
+
import type WorldState from 'warframe-worldstate-parser';
|
|
126
|
+
export function getWorldState(json?: string): Promise<WorldState>;
|
|
127
|
+
export function getVoidTraderHistory(data?: string): Promise<VoidTraderData | undefined>;
|
|
128
|
+
interface VoidTraderItem {
|
|
129
|
+
Name: string;
|
|
130
|
+
Type: string;
|
|
131
|
+
DucatCost: number;
|
|
132
|
+
CreditCost: number;
|
|
133
|
+
Image: string;
|
|
134
|
+
Link: string;
|
|
135
|
+
OfferingDates?: string[];
|
|
136
|
+
PcOfferingDates?: string[];
|
|
137
|
+
ConsoleOfferingDates?: string[];
|
|
138
|
+
}
|
|
139
|
+
interface VoidTraderData {
|
|
140
|
+
[itemName: string]: VoidTraderItem;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
declare module "infrastructure/wf/wf-export-adapter" {
|
|
144
|
+
import type { IRegion } from 'warframe-public-export-plus';
|
|
145
|
+
export function regionToShort(region: IRegion, dict: Record<string, string>): WFRegionShort;
|
|
146
|
+
export function relicQualityToName(quality: string): RelicQuality;
|
|
147
|
+
/**
|
|
148
|
+
* transform relic quality to translation key, return original if not matched.
|
|
149
|
+
*
|
|
150
|
+
* eg. "VPQ_BRONZE" => "/Lotus/Language/Relics/VoidProjectionQuality_Bronze".
|
|
151
|
+
* @param quality directly provided from `IRelic.quality` expected to start with "VPQ_".
|
|
152
|
+
*/
|
|
153
|
+
export function relicQualityToTransKey(quality: string): string;
|
|
154
|
+
/**
|
|
155
|
+
* transform relic era to translation key.
|
|
156
|
+
*
|
|
157
|
+
* eg. "Lith" => "/Lotus/Language/Relics/Era_LITH".
|
|
158
|
+
* @param era directly provided from `IRelic.era`.
|
|
159
|
+
*/
|
|
160
|
+
export function relicEraToTransKey(era: string): string;
|
|
161
|
+
export function fixRelicRewardKey(item: string): string;
|
|
162
|
+
}
|
|
163
|
+
declare module "infrastructure/wf/wfcd-adapter" {
|
|
164
|
+
import type { TMissionType } from 'warframe-public-export-plus';
|
|
165
|
+
export function getSolNodeKey(name: string): Promise<string>;
|
|
166
|
+
export function getMissionTypeKey(name: string): Promise<TMissionType>;
|
|
167
|
+
export const fissureTierName: {
|
|
168
|
+
1: string;
|
|
169
|
+
2: string;
|
|
170
|
+
3: string;
|
|
171
|
+
4: string;
|
|
172
|
+
5: string;
|
|
173
|
+
6: string;
|
|
174
|
+
7: string;
|
|
187
175
|
};
|
|
188
|
-
|
|
189
|
-
export
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
export
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
export
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
export
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
export function
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
export function
|
|
281
|
-
export function
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
export function
|
|
289
|
-
export
|
|
290
|
-
export
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
export
|
|
294
|
-
export function
|
|
176
|
+
export function fissureTierNumToNumber(a: number | string): number;
|
|
177
|
+
export function getVoidTraderItem(i: {
|
|
178
|
+
item: string;
|
|
179
|
+
uniqueName: string;
|
|
180
|
+
ducats: number;
|
|
181
|
+
credits: number;
|
|
182
|
+
}): VoidTraderItem;
|
|
183
|
+
}
|
|
184
|
+
declare module "data/wf/globalWorldState" {
|
|
185
|
+
export const globalWorldState: AsyncCache<{
|
|
186
|
+
raw: import("warframe-worldstate-parser").WorldState;
|
|
187
|
+
fissures: Fissure[];
|
|
188
|
+
spFissures: Fissure[];
|
|
189
|
+
rjFissures: Fissure[];
|
|
190
|
+
}>;
|
|
191
|
+
}
|
|
192
|
+
declare module "data/wf/relics" {
|
|
193
|
+
export const relics: Record<string, Relic>;
|
|
194
|
+
}
|
|
195
|
+
declare module "data/wf/rivenBaseValues" {
|
|
196
|
+
export const rivenAttrValueDict: Record<string, Record<string, number>>;
|
|
197
|
+
}
|
|
198
|
+
declare module "data/wf/rivenDisposition" {
|
|
199
|
+
import type { RivenWeaponDisposition } from '../../types/wf/riven';
|
|
200
|
+
export const weaponRivenDispositionDict: Record<string, RivenWeaponDisposition>;
|
|
201
|
+
}
|
|
202
|
+
declare module "data/wf/rivenStatData" {
|
|
203
|
+
import type { RivenStatFixFactorMap } from '../../types/wf/riven';
|
|
204
|
+
export const rivenStatFixFactor: RivenStatFixFactorMap;
|
|
205
|
+
}
|
|
206
|
+
declare module "infrastructure/wfm-client" {
|
|
207
|
+
export const wfmClient: {
|
|
208
|
+
items: {
|
|
209
|
+
getList: () => Promise<import("wfm-api-client").ItemShort[] | undefined>;
|
|
210
|
+
getStatistics: (itemId: string) => Promise<import("wfm-api-client").StatisticsCollection | undefined>;
|
|
211
|
+
getOrders: (itemId: string) => Promise<import("wfm-api-client").OrderWithUser[] | undefined>;
|
|
212
|
+
};
|
|
213
|
+
rivens: {
|
|
214
|
+
getItems: () => Promise<import("wfm-api-client").RivenItem[] | undefined>;
|
|
215
|
+
getOrders: (itemId: string) => Promise<import("wfm-api-client").RivenOrder[] | undefined>;
|
|
216
|
+
getAttributes: () => Promise<import("wfm-api-client").RivenAttribute[] | undefined>;
|
|
217
|
+
};
|
|
218
|
+
tools: {
|
|
219
|
+
getDucatnator: () => Promise<{
|
|
220
|
+
day: import("wfm-api-client").Ducatnator[];
|
|
221
|
+
hour: import("wfm-api-client").Ducatnator[];
|
|
222
|
+
} | undefined>;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
declare module "data/wfm/globalRivenAttribute" {
|
|
227
|
+
import type { RivenAttribute } from '../../types/wfm';
|
|
228
|
+
export function globalRivenAttributeFactory(rivenAttributeData?: RivenAttribute[]): Promise<{
|
|
229
|
+
globalRivenAttributeList: RivenAttribute[];
|
|
230
|
+
globalRivenAttributeDict: Record<string, RivenAttribute>;
|
|
231
|
+
}>;
|
|
232
|
+
export let globalRivenAttribute: AsyncCache<{
|
|
233
|
+
globalRivenAttributeList: RivenAttribute[];
|
|
234
|
+
globalRivenAttributeDict: Record<string, RivenAttribute>;
|
|
235
|
+
}>;
|
|
236
|
+
export function overrideGlobalRivenAttribute(cache: AsyncCache<{
|
|
237
|
+
globalRivenAttributeList: RivenAttribute[];
|
|
238
|
+
globalRivenAttributeDict: {
|
|
239
|
+
[key: string]: RivenAttribute;
|
|
240
|
+
};
|
|
241
|
+
}>): void;
|
|
242
|
+
}
|
|
243
|
+
declare module "data/wfm/globalRivenItem" {
|
|
244
|
+
export const globalRivenItemData: AsyncCache<{
|
|
245
|
+
globalRivenItemList: import("wfm-api-client").RivenItem[];
|
|
246
|
+
globalRivenItemDict: Record<string, import("wfm-api-client").RivenItem>;
|
|
247
|
+
globalRivenItemNameToSlugDict: Record<string, string>;
|
|
248
|
+
}>;
|
|
249
|
+
}
|
|
250
|
+
declare module "infrastructure/ocr-api" {
|
|
251
|
+
import type { OcrAPISecret } from '../types/config';
|
|
252
|
+
export function extractTextFromImage(image: string | Blob, secret: OcrAPISecret): Promise<string[] | undefined>;
|
|
253
|
+
}
|
|
254
|
+
declare module "services/wf-service" {
|
|
255
|
+
import type { WeeklyRiven } from 'warframe-weekly-rivens';
|
|
256
|
+
import type { OcrAPISecret } from '../types/config';
|
|
257
|
+
import type { ServiceResult } from "types/result";
|
|
258
|
+
import type { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
|
|
259
|
+
import type { RivenAttribute } from '../types/wfm';
|
|
260
|
+
import { weaponRivenDispositionDict } from "data/wf/rivenDisposition";
|
|
261
|
+
export function getRelic(input: string): Promise<ServiceResult<Relic>>;
|
|
262
|
+
export function getArbitrations(day?: number): ServiceResult<Arbitration[]>;
|
|
263
|
+
export function getWeekly(): Promise<ServiceResult<{
|
|
264
|
+
archonHunt: ArchonHunt;
|
|
265
|
+
deepArchimedea: ArchiMedea;
|
|
266
|
+
temporalArchimedea: ArchiMedea;
|
|
267
|
+
}>>;
|
|
268
|
+
export function getEnvironment(): Promise<string>;
|
|
269
|
+
export function getCircuitWeek(): {
|
|
270
|
+
currentIncarnons: number;
|
|
271
|
+
currentWarframes: number;
|
|
272
|
+
allIncarnons: string[][];
|
|
273
|
+
allWarframes: string[][];
|
|
274
|
+
};
|
|
275
|
+
export function getFissures(): Promise<ServiceResult<Fissure[]>>;
|
|
276
|
+
export function getSteelPathFissures(): Promise<ServiceResult<Fissure[]>>;
|
|
277
|
+
export function getRailjackFissures(): Promise<ServiceResult<Fissure[]>>;
|
|
278
|
+
export function getAnalyzedRiven(secret: OcrAPISecret, url: string): Promise<ServiceResult<RivenStatAnalyzeResult>>;
|
|
279
|
+
export function getVoidTrader(): Promise<ServiceResult<VoidTrader>>;
|
|
280
|
+
export function filterWeeklyRivens(data: WeeklyRiven[], minPrice: number, minPop?: number): WeeklyRiven[];
|
|
281
|
+
export function getWeeklyRivens(minPrice: number): Promise<WeeklyRiven[]>;
|
|
282
|
+
export function getStaticRivenStats(weaponType: string, statType: string, disposition: number): Promise<ServiceResult<RivenStatResult>>;
|
|
283
|
+
export function getWeaponRivenDisposition(name: string): (typeof weaponRivenDispositionDict)[string] | undefined;
|
|
284
|
+
export function parseOCRResult(ocrResult: string[]): Promise<{
|
|
285
|
+
name: string;
|
|
286
|
+
attributes: {
|
|
287
|
+
attr: RivenAttribute;
|
|
288
|
+
value: number;
|
|
289
|
+
prefix: string;
|
|
290
|
+
}[];
|
|
291
|
+
} | undefined>;
|
|
292
|
+
export function analyzeRivenStat(parseResult: {
|
|
293
|
+
name: string;
|
|
294
|
+
attributes: {
|
|
295
|
+
attr: RivenAttribute;
|
|
296
|
+
value: number;
|
|
297
|
+
prefix: string;
|
|
298
|
+
}[];
|
|
299
|
+
}): RivenStatAnalyzeResult | string;
|
|
300
|
+
}
|
|
301
|
+
declare module "data/wfm/globalDucatnator" {
|
|
302
|
+
export const globalDucatnatorIDDict: AsyncCache<Record<string, import("wfm-api-client").Ducatnator> | undefined>;
|
|
303
|
+
}
|
|
304
|
+
declare module "data/wfm/globalItem" {
|
|
305
|
+
import type { ItemShort } from '../../types/wfm';
|
|
306
|
+
export function globalItemDataFactory(response?: ItemShort[]): Promise<{
|
|
307
|
+
globalItemList: ItemShort[];
|
|
308
|
+
globalItemDict: Record<string, ItemShort>;
|
|
309
|
+
globalItemNameToSlugDict: Record<string, string>;
|
|
310
|
+
globalItemGameRefDict: Record<string, ItemShort>;
|
|
311
|
+
}>;
|
|
312
|
+
export let globalItemData: AsyncCache<{
|
|
313
|
+
globalItemList: ItemShort[];
|
|
314
|
+
globalItemDict: Record<string, ItemShort>;
|
|
315
|
+
globalItemNameToSlugDict: Record<string, string>;
|
|
316
|
+
globalItemGameRefDict: Record<string, ItemShort>;
|
|
317
|
+
}>;
|
|
318
|
+
export function overrideGlobalItemData(cache: AsyncCache<{
|
|
319
|
+
globalItemList: ItemShort[];
|
|
320
|
+
globalItemDict: Record<string, ItemShort>;
|
|
321
|
+
globalItemNameToSlugDict: Record<string, string>;
|
|
322
|
+
globalItemGameRefDict: Record<string, ItemShort>;
|
|
323
|
+
}>): void;
|
|
324
|
+
}
|
|
325
|
+
declare module "services/wfm-service" {
|
|
326
|
+
import type { ServiceResult } from "types/result";
|
|
327
|
+
import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from '../types/wfm';
|
|
328
|
+
export function updateCache(): Promise<string>;
|
|
329
|
+
export function getItemOrders(input: string): Promise<ServiceResult<{
|
|
330
|
+
item: ItemShort;
|
|
331
|
+
orders: OrderWithUser[];
|
|
332
|
+
}>>;
|
|
333
|
+
export function getRivenOrders(input: string): Promise<ServiceResult<{
|
|
334
|
+
item: RivenItem;
|
|
335
|
+
orders: RivenOrderInternal[];
|
|
336
|
+
}>>;
|
|
337
|
+
export function applyRelicData(relic: Relic): Promise<OutputRelic>;
|
|
338
|
+
export const primedModHistory: AsyncCache<PrimedModHistoryItem[]>;
|
|
339
|
+
export function stringToWFMItem(input: string): Promise<ItemShort | undefined>;
|
|
340
|
+
}
|
|
341
|
+
declare module "services/index" {
|
|
342
|
+
export * from "services/miscs-service";
|
|
343
|
+
export * from "services/wf-service";
|
|
344
|
+
export * from "services/wfm-service";
|
|
345
|
+
}
|
|
346
|
+
declare module "commands/miscs" {
|
|
347
|
+
import type { PluginDependencies } from '../types/config';
|
|
348
|
+
export function createMiscsCommands(deps: PluginDependencies): {
|
|
349
|
+
hotRivenCommand: () => Promise<string>;
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
declare module "components/wf" {
|
|
353
|
+
import type { Element } from 'koishi';
|
|
354
|
+
import type { WeeklyRiven } from 'warframe-weekly-rivens';
|
|
355
|
+
import type { RivenStatAnalyzeResult, RivenStatResult } from '../types/wf/riven';
|
|
356
|
+
export function ArbitrationComponent(arbi: Arbitration[]): Element;
|
|
357
|
+
export function CircuitComponent(currentIncarnons: number, currentWarframes: number, allIncarnons: string[][], allWarframes: string[][]): Element;
|
|
358
|
+
export function FissureComponent(fissures: Fissure[], type: 'fissure' | 'sp-fissure' | 'rj-fissure'): Element;
|
|
359
|
+
export function WeeklyRivenComponent(items: WeeklyRiven[], minPrice: number): Element;
|
|
360
|
+
export function WeeklyComponent(archon: ArchonHunt, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea): Element;
|
|
361
|
+
export function RelicComponent(relic: OutputRelic): Element;
|
|
362
|
+
export function RivenComponent(data: RivenStatAnalyzeResult): Element;
|
|
363
|
+
export function RivenStatComponent(data: RivenStatResult): Element;
|
|
364
|
+
export function VoidTraderComponent(data: VoidTrader): Element;
|
|
365
|
+
}
|
|
366
|
+
declare module "commands/wf" {
|
|
367
|
+
import type { Argv, Dict } from 'koishi';
|
|
368
|
+
import type { PluginDependencies } from '../types/config';
|
|
369
|
+
export function createWfCommands(deps: PluginDependencies): {
|
|
370
|
+
arbitrationCommand: (_action: Argv, input?: number) => Promise<string>;
|
|
371
|
+
circuitCommand: (_action: Argv) => Promise<string>;
|
|
372
|
+
voidtraderCommand: (_action: Argv) => Promise<string>;
|
|
373
|
+
fissureCommand: (_action: Argv) => Promise<string>;
|
|
374
|
+
steelPathFissureCommand: (_action: Argv) => Promise<string>;
|
|
375
|
+
railjackFissureCommand: (_action: Argv) => Promise<string>;
|
|
376
|
+
relicCommand: (_action: Argv, input: string) => Promise<string>;
|
|
377
|
+
rivenCommand: (_action: Argv, input: Dict) => Promise<string>;
|
|
378
|
+
rivenStatCommand: (_action: Argv, weaponType: string, statType: string, disposition: number) => Promise<string>;
|
|
379
|
+
weeklyCommand: (_action: Argv) => Promise<string>;
|
|
380
|
+
weeklyRivenCommand: (_action: Argv, minPrice?: number) => Promise<string>;
|
|
381
|
+
environmentCommand: () => Promise<string>;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
declare module "components/wfm" {
|
|
385
|
+
import type Element from '@satorijs/element';
|
|
386
|
+
import type { ItemShort, OrderWithUser, PrimedModHistoryItem, RivenItem, RivenOrderInternal } from '../types/wfm';
|
|
387
|
+
export function ItemOrderComponent(item: ItemShort, orders: OrderWithUser[]): Element;
|
|
388
|
+
export function RivenOrderComponent(item: RivenItem, orders: RivenOrderInternal[]): Element;
|
|
389
|
+
export function PrimedModHistoryComponent(history: PrimedModHistoryItem[]): Element;
|
|
390
|
+
}
|
|
391
|
+
declare module "commands/wfm" {
|
|
392
|
+
import type { Argv } from 'koishi';
|
|
393
|
+
import type { PluginDependencies } from '../types/config';
|
|
394
|
+
export function createWfmCommands(deps: PluginDependencies): {
|
|
395
|
+
wmCommand: (_action: Argv, input: string) => Promise<string>;
|
|
396
|
+
wmrCommand: (_action: Argv, input: string) => Promise<string>;
|
|
397
|
+
wmuCommand: (_action: Argv, _input: string) => Promise<string>;
|
|
398
|
+
pmodhistoryCommand: (_action: Argv, _input: string) => Promise<string>;
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
declare module "commands/index" {
|
|
402
|
+
export * from "commands/miscs";
|
|
403
|
+
export * from "commands/wf";
|
|
404
|
+
export * from "commands/wfm";
|
|
405
|
+
}
|
|
406
|
+
declare module "components/render" {
|
|
407
|
+
import type { Element } from 'koishi';
|
|
408
|
+
import type Puppeteer from 'koishi-plugin-puppeteer';
|
|
409
|
+
export function generateImageOutput(puppe: Puppeteer, element: Element): Promise<string>;
|
|
410
|
+
}
|
|
411
|
+
declare module "index" {
|
|
412
|
+
import type { Context } from 'koishi';
|
|
413
|
+
import type { Config as PluginConfig } from './types/config';
|
|
414
|
+
import { Schema } from 'koishi';
|
|
415
|
+
import 'reflect-metadata';
|
|
416
|
+
export const name = "warframe";
|
|
417
|
+
export const inject: {
|
|
418
|
+
required: string[];
|
|
419
|
+
};
|
|
420
|
+
export const Config: Schema<PluginConfig>;
|
|
421
|
+
export function apply(ctx: Context): void;
|
|
422
|
+
}
|