haruki-sekai-deck-recommend-cpp 0.3.0 → 0.3.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/index.d.ts +7 -0
- package/index.js +9 -0
- package/package.json +1 -1
- package/sekai_deck_recommend.wasm +0 -0
package/index.d.ts
CHANGED
|
@@ -273,6 +273,8 @@ export interface RecommendDeck {
|
|
|
273
273
|
|
|
274
274
|
export interface RecommendResult {
|
|
275
275
|
decks: RecommendDeck[]
|
|
276
|
+
/** Wall-clock time of the search algorithm itself in milliseconds (excludes option/user-data parsing and result serialization). */
|
|
277
|
+
cost_ms: number
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
export interface WorldBloomSupportCard {
|
|
@@ -289,6 +291,7 @@ export interface RawSekaiDeckRecommendInstance {
|
|
|
289
291
|
updateMasterdataFromObject(data: Record<string, unknown>, region: SekaiRegion): void
|
|
290
292
|
updateMusicmetasFromString(data: string, region: SekaiRegion): void
|
|
291
293
|
recommend(optionsJson: string): string
|
|
294
|
+
recommendBatch(optionsJsonArray: string): string
|
|
292
295
|
recommendAreaItems(optionsJson: string): string
|
|
293
296
|
recommendMusic(optionsJson: string): string
|
|
294
297
|
calculateExactLive(optionsJson: string): string
|
|
@@ -299,6 +302,8 @@ export interface RawSekaiDeckRecommendInstance {
|
|
|
299
302
|
export interface RawSekaiDeckRecommendModule {
|
|
300
303
|
SekaiDeckRecommend: new () => RawSekaiDeckRecommendInstance
|
|
301
304
|
initDataPath(path: string): void
|
|
305
|
+
/** Effective only in wasm builds compiled with SEKAI_WASM_THREADS; a no-op in the default single-threaded package. */
|
|
306
|
+
setEngineThreadCount(count: number): void
|
|
302
307
|
[key: string]: unknown
|
|
303
308
|
}
|
|
304
309
|
|
|
@@ -312,6 +317,8 @@ export class SekaiDeckRecommendWasm {
|
|
|
312
317
|
loadMasterData(region: SekaiRegion, data: Record<string, unknown>): void
|
|
313
318
|
loadMusicMetas(region: SekaiRegion, data: string | object): void
|
|
314
319
|
recommend(options: RecommendOptions): RecommendResult
|
|
320
|
+
/** Runs each request through the full recommend pipeline; results are returned in input order. */
|
|
321
|
+
recommendBatch(optionsList: RecommendOptions[]): RecommendResult[]
|
|
315
322
|
getWorldBloomSupportCards(options: WorldBloomSupportOptions): WorldBloomSupportCard[]
|
|
316
323
|
recommendAreaItems(options: AreaItemRecommendOptions): RecommendAreaItem[]
|
|
317
324
|
recommendMusic(options: MusicRecommendOptions, deck: RecommendDeck): RecommendMusic[]
|
package/index.js
CHANGED
|
@@ -71,6 +71,15 @@ export class SekaiDeckRecommendWasm {
|
|
|
71
71
|
return JSON.parse(json)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
recommendBatch(optionsList) {
|
|
75
|
+
this.#assertActive()
|
|
76
|
+
if (!Array.isArray(optionsList)) {
|
|
77
|
+
throw new TypeError("recommendBatch expects an array of options.")
|
|
78
|
+
}
|
|
79
|
+
const json = this.#engine.recommendBatch(JSON.stringify(optionsList.map(normalizeUserDataAliases)))
|
|
80
|
+
return JSON.parse(json)
|
|
81
|
+
}
|
|
82
|
+
|
|
74
83
|
getWorldBloomSupportCards(options) {
|
|
75
84
|
this.#assertActive()
|
|
76
85
|
const json = this.#engine.getWorldBloomSupportCards(JSON.stringify(normalizeUserDataAliases(options)))
|
package/package.json
CHANGED
|
Binary file
|