koishi-plugin-warframe 1.2.2 → 1.3.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,8 +1,9 @@
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单位不显示)
@@ -24,8 +25,11 @@ export const fullWidthToHalfWidth: (text: string) => string;
24
25
  export const removeSpace: (text: string) => string;
25
26
  export const pascalToSpaced: (text: string) => string;
26
27
  export const toPascalCase: (text: string) => string;
28
+ export function normalSimilarity(a: string, b: string): number;
29
+ export function tokenSimilarity(a: string, b: string): number;
27
30
  export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
28
31
  export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
32
+ export const fetchAsyncImage: (url: string, method?: string) => Promise<Blob | null>;
29
33
  export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
30
34
  [key: string]: T;
31
35
  };
@@ -37,6 +41,13 @@ export const dictToKeyDict: <T>(dict: {
37
41
  }, predict: (obj: T) => string[]) => {
38
42
  [key: string]: string;
39
43
  };
44
+ export const lerp: (start: number, end: number, t: number) => number;
45
+ export const hexToRgb: (hex: string) => {
46
+ r: number;
47
+ g: number;
48
+ b: number;
49
+ };
50
+ export const rgbToHex: (r: number, g: number, b: number) => string;
40
51
  export const getSolNodeKey: (name: string) => Promise<string>;
41
52
  export const getMissionTypeKey: (name: string) => Promise<string>;
42
53
  export const fissureTierName: {
@@ -85,6 +96,7 @@ export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" |
85
96
  export const OutputImage: (imgBase64: string) => Element;
86
97
  export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
87
98
  export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
99
+ export let globalRivenAttributeList: RivenAttribute[];
88
100
  export let globalRivenAttributeDict: Record<string, RivenAttribute>;
89
101
  export const wmOnReady: () => Promise<void>;
90
102
  export const setGlobalItem: (data: ItemShort[]) => void;
@@ -120,7 +132,10 @@ export const CircuitTable: (incarnons: string[], warframes: string[]) => Element
120
132
  export const FissureTable: (fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Element;
121
133
  export const WeeklyTable: (archon: string, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea) => Promise<string>;
122
134
  export const RelicComponent: (relic: OutputRelic) => Element;
135
+ export const RivenComponent: (data: RivenStatAnalyzeResult) => Element;
123
136
  export const getWorldState: () => Promise<WorldState>;
137
+ export const extractTextFromImage: (image: string | Blob, secret: OcrAPISecret) => Promise<GeneralBasicOCRResponse | undefined>;
138
+ export const rivenAttrValueDict: Record<string, Record<string, number>>;
124
139
  export const wfOnReady: () => Promise<void>;
125
140
  export const getRelic: (input: string) => Promise<Relic | string>;
126
141
  export const generateRelicOutput: (puppe: Puppeteer, relic: OutputRelic) => Promise<import("koishi").Element>;
@@ -145,6 +160,37 @@ export const getFissures: () => Promise<any[] | "内部错误,获取最新信
145
160
  export const getSteelPathFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
146
161
  export const getRailjackFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
147
162
  export const generateFissureOutput: (puppe: Puppeteer, fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Promise<import("koishi").Element>;
163
+ export const getWeaponRivenDisposition: (name: string) => {
164
+ name: {
165
+ en: string;
166
+ zh: string;
167
+ };
168
+ calc: {
169
+ disposition: number;
170
+ name: string;
171
+ texture: string;
172
+ riventype: string;
173
+ };
174
+ weapon: any;
175
+ };
176
+ export const getAnalyzedRiven: (secret: OcrAPISecret, dict: Dict) => Promise<string | RivenStatAnalyzeResult>;
177
+ export const generateAnalyzedRivenOutput: (puppe: Puppeteer, data: RivenStatAnalyzeResult) => Promise<import("koishi").Element>;
178
+ export const parseOCRResult: (ocrResult: GeneralAccurateOCRResponse) => {
179
+ name: string;
180
+ attributes: {
181
+ attr: RivenAttribute;
182
+ value: number;
183
+ prefix: string;
184
+ }[];
185
+ };
186
+ export const analyzeRivenStat: (parseResult: {
187
+ name: string;
188
+ attributes: {
189
+ attr: RivenAttribute;
190
+ value: number;
191
+ prefix: string;
192
+ }[];
193
+ }) => RivenStatAnalyzeResult | string;
148
194
  export const wmCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
149
195
  export const wmrCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
150
196
  export const aboutCommand: (action: Argv) => Promise<string>;
@@ -156,10 +202,12 @@ export const circuitCommand: (action: Argv) => Promise<import("koishi").Element>
156
202
  export const environmentCommand: () => Promise<string>;
157
203
  export const weeklyCommand: (action: Argv) => Promise<string>;
158
204
  export const relicCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
205
+ export const rivenCommand: (action: Argv, input: Dict, secret: OcrAPISecret) => Promise<string | import("koishi").Element>;
159
206
  export const onReadyHandler: () => Promise<void>;
160
207
  export const name = "warframe";
161
208
  export interface Config {
162
209
  developerMode: boolean;
210
+ ocrAPISecret: OcrAPISecret;
163
211
  }
164
212
  export const Config: Schema<Config>;
165
213
  export function apply(ctx: Context): void;