koishi-plugin-warframe 1.2.2 → 1.4.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/README.md CHANGED
@@ -18,6 +18,7 @@ Toolkit for warframe. **(In development)**
18
18
  | relic [name:string] | 遗物, 核桃 | Relic rewards with corresponding data, including wfm medium price and ducats value. |
19
19
  | weekly | 周常 | Weekly mission info (archon hunt, deep archimedea, temporal archimedea) |
20
20
  | environment | env, 地球, 福尔图娜 | Region environment (time) |
21
+ | voidtrader | 虚空商人, 奸商 | Void trader info |
21
22
 
22
23
  ## Install
23
24
 
package/lib/index.d.ts CHANGED
@@ -1,13 +1,22 @@
1
1
  import { IRegion } from 'warframe-public-export-plus';
2
2
  import Puppeteer from 'koishi-plugin-puppeteer';
3
3
  import Element from '@satorijs/element';
4
- import { Element, Argv, Context, Schema } from 'koishi';
4
+ import { Element, Dict, Argv, Context, Schema } from 'koishi';
5
5
  import WorldState from 'warframe-worldstate-parser';
6
+ import { GeneralBasicOCRResponse, GeneralAccurateOCRResponse } from 'tencentcloud-sdk-nodejs-ocr/tencentcloud/services/ocr/v20181119/ocr_models';
6
7
  export const toTimeStamp: (timeStr: string) => number;
7
8
  /**
8
9
  * 毫秒转「X小时X分钟X秒」格式(0单位不显示)
9
10
  * @param {number} ms - 待转换的毫秒数(非负)
10
- * @returns {string} 示例:3661000ms → "1小时1分钟1秒";61000ms → "1分钟1秒";500ms → "0秒"
11
+ * @returns {string} 示例:
12
+ *
13
+ * 90061000ms → "1天1小时1分钟1秒"
14
+ *
15
+ * 3661000ms → "1小时1分钟1秒"
16
+ *
17
+ * 61000ms → "1分钟1秒"
18
+ *
19
+ * 500ms → "0秒"
11
20
  */
12
21
  export const msToHumanReadable: (ms: number) => string;
13
22
  /**
@@ -24,8 +33,11 @@ export const fullWidthToHalfWidth: (text: string) => string;
24
33
  export const removeSpace: (text: string) => string;
25
34
  export const pascalToSpaced: (text: string) => string;
26
35
  export const toPascalCase: (text: string) => string;
36
+ export function normalSimilarity(a: string, b: string): number;
37
+ export function tokenSimilarity(a: string, b: string): number;
27
38
  export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
28
39
  export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
40
+ export const fetchAsyncImage: (url: string, method?: string) => Promise<Blob | null>;
29
41
  export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
30
42
  [key: string]: T;
31
43
  };
@@ -37,18 +49,13 @@ export const dictToKeyDict: <T>(dict: {
37
49
  }, predict: (obj: T) => string[]) => {
38
50
  [key: string]: string;
39
51
  };
40
- export const getSolNodeKey: (name: string) => Promise<string>;
41
- export const getMissionTypeKey: (name: string) => Promise<string>;
42
- export const fissureTierName: {
43
- 1: string;
44
- 2: string;
45
- 3: string;
46
- 4: string;
47
- 5: string;
48
- 6: string;
49
- 7: string;
52
+ export const lerp: (start: number, end: number, t: number) => number;
53
+ export const hexToRgb: (hex: string) => {
54
+ r: number;
55
+ g: number;
56
+ b: number;
50
57
  };
51
- export const fissureTierNumToNumber: (a: number | string) => number;
58
+ export const rgbToHex: (r: number, g: number, b: number) => string;
52
59
  export const regionToShort: (region: IRegion, dict: any) => {
53
60
  name: any;
54
61
  system: any;
@@ -71,6 +78,29 @@ export const relicQualityToTransKey: (quality: string) => string;
71
78
  */
72
79
  export const relicEraToTransKey: (era: string) => string;
73
80
  export const fixRelicRewardKey: (item: string) => string;
81
+ export const relicToFullNameZH: (tier: string, category: string) => string;
82
+ export const getSolNodeKey: (name: string) => Promise<string>;
83
+ export const getMissionTypeKey: (name: string) => Promise<string>;
84
+ export const fissureTierName: {
85
+ 1: string;
86
+ 2: string;
87
+ 3: string;
88
+ 4: string;
89
+ 5: string;
90
+ 6: string;
91
+ 7: string;
92
+ };
93
+ export const fissureTierNumToNumber: (a: number | string) => number;
94
+ export const getVoidTraderItem: (i: {
95
+ item: string;
96
+ uniqueName: string;
97
+ ducats: number;
98
+ credits: number;
99
+ }) => {
100
+ name: string;
101
+ ducats: number;
102
+ credits: number;
103
+ };
74
104
  export const getWFMItemList: () => Promise<WFMResponse<ItemShort[] | null>>;
75
105
  export const getWFMOrderList: (itemId: string) => Promise<WFMResponse<OrderWithUser[] | null>>;
76
106
  export const getWFMRivenItemList: () => Promise<WFMResponse<RivenItem[] | null>>;
@@ -85,6 +115,7 @@ export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" |
85
115
  export const OutputImage: (imgBase64: string) => Element;
86
116
  export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
87
117
  export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
118
+ export let globalRivenAttributeList: RivenAttribute[];
88
119
  export let globalRivenAttributeDict: Record<string, RivenAttribute>;
89
120
  export const wmOnReady: () => Promise<void>;
90
121
  export const setGlobalItem: (data: ItemShort[]) => void;
@@ -120,7 +151,11 @@ export const CircuitTable: (incarnons: string[], warframes: string[]) => Element
120
151
  export const FissureTable: (fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Element;
121
152
  export const WeeklyTable: (archon: string, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea) => Promise<string>;
122
153
  export const RelicComponent: (relic: OutputRelic) => Element;
123
- export const getWorldState: () => Promise<WorldState>;
154
+ export const RivenComponent: (data: RivenStatAnalyzeResult) => Element;
155
+ export const VoidTraderComponent: (data: VoidTrader) => Element;
156
+ export const getWorldState: (json?: string) => Promise<WorldState>;
157
+ export const extractTextFromImage: (image: string | Blob, secret: OcrAPISecret) => Promise<GeneralBasicOCRResponse | undefined>;
158
+ export const rivenAttrValueDict: Record<string, Record<string, number>>;
124
159
  export const wfOnReady: () => Promise<void>;
125
160
  export const getRelic: (input: string) => Promise<Relic | string>;
126
161
  export const generateRelicOutput: (puppe: Puppeteer, relic: OutputRelic) => Promise<import("koishi").Element>;
@@ -145,6 +180,39 @@ export const getFissures: () => Promise<any[] | "内部错误,获取最新信
145
180
  export const getSteelPathFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
146
181
  export const getRailjackFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
147
182
  export const generateFissureOutput: (puppe: Puppeteer, fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Promise<import("koishi").Element>;
183
+ export const getWeaponRivenDisposition: (name: string) => {
184
+ name: {
185
+ en: string;
186
+ zh: string;
187
+ };
188
+ calc: {
189
+ disposition: number;
190
+ name: string;
191
+ texture: string;
192
+ riventype: string;
193
+ };
194
+ weapon: any;
195
+ };
196
+ export const getAnalyzedRiven: (secret: OcrAPISecret, dict: Dict) => Promise<string | RivenStatAnalyzeResult>;
197
+ export const generateAnalyzedRivenOutput: (puppe: Puppeteer, data: RivenStatAnalyzeResult) => Promise<import("koishi").Element>;
198
+ export const parseOCRResult: (ocrResult: GeneralAccurateOCRResponse) => {
199
+ name: string;
200
+ attributes: {
201
+ attr: RivenAttribute;
202
+ value: number;
203
+ prefix: string;
204
+ }[];
205
+ };
206
+ export const analyzeRivenStat: (parseResult: {
207
+ name: string;
208
+ attributes: {
209
+ attr: RivenAttribute;
210
+ value: number;
211
+ prefix: string;
212
+ }[];
213
+ }) => RivenStatAnalyzeResult | string;
214
+ export const getVoidTrader: () => Promise<string | VoidTrader>;
215
+ export const generateVoidTraderOutput: (puppe: Puppeteer, data: VoidTrader) => Promise<import("koishi").Element>;
148
216
  export const wmCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
149
217
  export const wmrCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
150
218
  export const aboutCommand: (action: Argv) => Promise<string>;
@@ -156,10 +224,13 @@ export const circuitCommand: (action: Argv) => Promise<import("koishi").Element>
156
224
  export const environmentCommand: () => Promise<string>;
157
225
  export const weeklyCommand: (action: Argv) => Promise<string>;
158
226
  export const relicCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
227
+ export const rivenCommand: (action: Argv, input: Dict, secret: OcrAPISecret) => Promise<string | import("koishi").Element>;
228
+ export const voidtraderCommand: (action: Argv) => Promise<string | import("koishi").Element>;
159
229
  export const onReadyHandler: () => Promise<void>;
160
230
  export const name = "warframe";
161
231
  export interface Config {
162
232
  developerMode: boolean;
233
+ ocrAPISecret: OcrAPISecret;
163
234
  }
164
235
  export const Config: Schema<Config>;
165
236
  export function apply(ctx: Context): void;