haruki-sekai-deck-recommend-cpp 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. package/index.d.ts +5 -0
  2. package/index.js +9 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -289,6 +289,7 @@ export interface RawSekaiDeckRecommendInstance {
289
289
  updateMasterdataFromObject(data: Record<string, unknown>, region: SekaiRegion): void
290
290
  updateMusicmetasFromString(data: string, region: SekaiRegion): void
291
291
  recommend(optionsJson: string): string
292
+ recommendBatch(optionsJsonArray: string): string
292
293
  recommendAreaItems(optionsJson: string): string
293
294
  recommendMusic(optionsJson: string): string
294
295
  calculateExactLive(optionsJson: string): string
@@ -299,6 +300,8 @@ export interface RawSekaiDeckRecommendInstance {
299
300
  export interface RawSekaiDeckRecommendModule {
300
301
  SekaiDeckRecommend: new () => RawSekaiDeckRecommendInstance
301
302
  initDataPath(path: string): void
303
+ /** Effective only in wasm builds compiled with SEKAI_WASM_THREADS; a no-op in the default single-threaded package. */
304
+ setEngineThreadCount(count: number): void
302
305
  [key: string]: unknown
303
306
  }
304
307
 
@@ -312,6 +315,8 @@ export class SekaiDeckRecommendWasm {
312
315
  loadMasterData(region: SekaiRegion, data: Record<string, unknown>): void
313
316
  loadMusicMetas(region: SekaiRegion, data: string | object): void
314
317
  recommend(options: RecommendOptions): RecommendResult
318
+ /** Runs each request through the full recommend pipeline; results are returned in input order. */
319
+ recommendBatch(optionsList: RecommendOptions[]): RecommendResult[]
315
320
  getWorldBloomSupportCards(options: WorldBloomSupportOptions): WorldBloomSupportCard[]
316
321
  recommendAreaItems(options: AreaItemRecommendOptions): RecommendAreaItem[]
317
322
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haruki-sekai-deck-recommend-cpp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "WebAssembly bindings for the Project Sekai deck recommendation engine.",
5
5
  "type": "module",
6
6
  "license": "LGPL-2.0-only",