koishipro-core.js 1.1.1 → 1.1.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.
@@ -1,3 +1,2 @@
1
1
  export * from './ocgcore-parsers';
2
- export * from './script-readers';
3
2
  export * from './start-duel';
@@ -0,0 +1,3 @@
1
+ import type { CardReader } from '../types/callback';
2
+ import type { SqlJsStatic } from 'sql.js';
3
+ export declare function DirCardReader(sqljs: SqlJsStatic, ...baseDirs: string[]): Promise<CardReader>;
@@ -0,0 +1,2 @@
1
+ export * from './sqljs-card-reader';
2
+ export * from './dir-card-reader';
@@ -0,0 +1,5 @@
1
+ import type { Database } from 'sql.js';
2
+ import type { CardReader } from '../types/callback';
3
+ export declare function SqljsCardReader(...dbs: Database[]): CardReader;
4
+ /** @deprecated Use SqljsCardReader instead. */
5
+ export declare function createSqljsCardReader(...dbs: Database[]): CardReader;
@@ -5,5 +5,6 @@ import { OcgcoreProcessResult } from './types';
5
5
  export declare function playYrpStep(ocgcoreWrapper: OcgcoreWrapper, yrpInput: YGOProYrp | Uint8Array): Generator<{
6
6
  duel: OcgcoreDuel;
7
7
  result: OcgcoreProcessResult;
8
+ responses: Uint8Array<ArrayBufferLike>[];
8
9
  }, void, unknown>;
9
10
  export declare const playYrp: (ocgcoreWrapper: OcgcoreWrapper, yrpInput: YGOProYrp | Uint8Array) => Uint8Array<ArrayBufferLike>[];
@@ -0,0 +1,2 @@
1
+ import type { ScriptReader } from '../types/callback';
2
+ export declare function DirScriptReaderEx(...baseDirs: string[]): Promise<ScriptReader>;
@@ -0,0 +1,2 @@
1
+ export * from './script-readers';
2
+ export * from './dir-script-reader-ex';
@@ -0,0 +1,10 @@
1
+ import { ScriptReader } from '../types/callback';
2
+ export declare function MapScriptReader(...maps: Array<Map<string, string | Uint8Array>>): ScriptReader;
3
+ export declare function DirScriptReader(...baseDirs: string[]): ScriptReader;
4
+ export declare function ZipScriptReader(...inputs: Array<Uint8Array | ArrayBuffer | Blob>): Promise<ScriptReader>;
5
+ /** @deprecated Use MapScriptReader instead. */
6
+ export declare function MapReader(...maps: Array<Map<string, string | Uint8Array>>): ScriptReader;
7
+ /** @deprecated Use DirScriptReader instead. */
8
+ export declare function DirReader(...baseDirs: string[]): ScriptReader;
9
+ /** @deprecated Use ZipScriptReader instead. */
10
+ export declare function ZipReader(...inputs: Array<Uint8Array | ArrayBuffer | Blob>): Promise<ScriptReader>;
@@ -1,4 +1,5 @@
1
1
  export * from './binary';
2
2
  export * from './node-fs';
3
3
  export * from './node-path';
4
+ export * from './search-zips';
4
5
  export * from './utf8';
@@ -1,5 +1,16 @@
1
+ type NodeStats = {
2
+ isFile: () => boolean;
3
+ };
4
+ type NodeFsPromises = {
5
+ readFile: (path: string) => Promise<Uint8Array>;
6
+ readdir: (path: string) => Promise<string[]>;
7
+ stat: (path: string) => Promise<NodeStats>;
8
+ access: (path: string) => Promise<void>;
9
+ };
1
10
  export type NodeFs = {
2
11
  existsSync: (path: string) => boolean;
3
12
  readFileSync: (path: string) => Uint8Array;
13
+ promises: NodeFsPromises;
4
14
  };
5
15
  export declare function getNodeFs(noThrow?: boolean): NodeFs | null;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ import { getNodeFs } from './node-fs';
2
+ import { getNodePath } from './node-path';
3
+ type NodeFs = NonNullable<ReturnType<typeof getNodeFs>>;
4
+ type NodePath = NonNullable<ReturnType<typeof getNodePath>>;
5
+ export declare function searchZips(fs: NodeFs, pathMod: NodePath | null, baseDir: string): Promise<string[]>;
6
+ export {};
package/index.ts CHANGED
@@ -16,6 +16,7 @@ export * from './src/adapters';
16
16
  export * from './src/constants';
17
17
  // export * from './src/utility';
18
18
  export * from './src/vendor';
19
- export * from './src/sqljs-card-reader';
19
+ export * from './src/script-reader';
20
+ export * from './src/card-reader';
20
21
  export * from './src/play-yrp';
21
22
  export * from './src/test-card';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishipro-core.js",
3
3
  "description": "WASM wrapper for YGOPro/ocgcore, designed for both Node and browser runtimes.",
4
- "version": "1.1.1",
4
+ "version": "1.1.2",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -1,4 +0,0 @@
1
- import { ScriptReader } from '../types/callback';
2
- export declare function MapReader(...maps: Array<Map<string, string | Uint8Array>>): ScriptReader;
3
- export declare function DirReader(...baseDirs: string[]): ScriptReader;
4
- export declare function ZipReader(...inputs: Array<Uint8Array | ArrayBuffer | Blob>): Promise<ScriptReader>;
@@ -1,3 +0,0 @@
1
- import type { Database } from 'sql.js';
2
- import type { CardReader } from './types/callback';
3
- export declare function createSqljsCardReader(...dbs: Database[]): CardReader;