nitro-patcher 0.3.0 → 1.1.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/dist/browser.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export interface PatchMetadata {
2
+ formatVersion?: number;
2
3
  id?: string;
3
4
  author?: string;
4
5
  name?: string;
@@ -20,11 +21,39 @@ export interface BrowserPatchOptions {
20
21
  maxUncompressedSize?: number;
21
22
  maxEntries?: number;
22
23
  }
24
+ export interface CreatePatchOptions extends BrowserPatchOptions {
25
+ metadata?: Omit<PatchMetadata, "formatVersion">;
26
+ readme?: string;
27
+ }
28
+ export interface CreatePatchResult {
29
+ buffer: Uint8Array<ArrayBuffer>;
30
+ changedFiles: number;
31
+ warnings: string[];
32
+ }
33
+ /** Create an in-memory XZP with diagnostic warnings. Call in a Web Worker. */
34
+ export declare const createPatch: (original: Uint8Array, modified: Uint8Array, options?: CreatePatchOptions) => Promise<CreatePatchResult>;
35
+ export interface DsiCheck {
36
+ status: "valid" | "invalid" | "not-applicable";
37
+ reason?: string;
38
+ }
39
+ export interface DsiVerification {
40
+ arm9: DsiCheck;
41
+ arm7: DsiCheck;
42
+ arm9i: DsiCheck;
43
+ arm7i: DsiCheck;
44
+ arm9NoSecure: DsiCheck;
45
+ banner: DsiCheck;
46
+ sectors: DsiCheck;
47
+ blocks: DsiCheck;
48
+ master: DsiCheck;
49
+ signature: DsiCheck;
50
+ }
23
51
  export interface BrowserPatchResult {
24
52
  buffer: Uint8Array<ArrayBuffer>;
25
53
  returnValue: "SUCCESS" | "MD5_MISMATCH";
26
54
  inputMd5: string;
27
55
  outputMd5: string;
56
+ dsi?: DsiVerification;
28
57
  }
29
58
  export interface RomInfo {
30
59
  gameTitle: string;
@@ -37,9 +66,12 @@ export interface RomInfo {
37
66
  secureArea: boolean;
38
67
  banner: boolean;
39
68
  };
69
+ dsi?: DsiVerification;
40
70
  }
41
71
  /** Parse ROM metadata entirely in memory. No filesystem or Node types required. */
42
- export declare const inspectRom: (bytes: Uint8Array) => RomInfo;
72
+ export declare const inspectRom: (bytes: Uint8Array, options?: {
73
+ dsiMode?: "legacy" | "complete";
74
+ }) => RomInfo;
43
75
  /** Synchronous CPU work; call in a Web Worker for responsive browser UIs. */
44
76
  export declare const patchBuffer: (original: Uint8Array, archive: Uint8Array, options?: BrowserPatchOptions) => BrowserPatchResult;
45
77
  /** Read and validate metadata.json from a patch package entirely in memory. */
@@ -51,6 +83,7 @@ export declare const readPatchInfo: (archive: Uint8Array, options?: BrowserPatch
51
83
  /** Extract one file from a ZIP archive entirely in memory. */
52
84
  export declare const extractZipEntry: (archive: Uint8Array, entryName: string, options?: BrowserPatchOptions) => Uint8Array<ArrayBuffer>;
53
85
  export declare const PatchHelper: Readonly<{
86
+ createPatch: (original: Uint8Array, modified: Uint8Array, options?: CreatePatchOptions) => Promise<CreatePatchResult>;
54
87
  extractZipEntry: (archive: Uint8Array, entryName: string, options?: BrowserPatchOptions) => Uint8Array<ArrayBuffer>;
55
88
  patchBuffer: (original: Uint8Array, archive: Uint8Array, options?: BrowserPatchOptions) => BrowserPatchResult;
56
89
  readPatchInfo: (archive: Uint8Array, options?: BrowserPatchOptions) => PatchInfo;
@@ -58,5 +91,7 @@ export declare const PatchHelper: Readonly<{
58
91
  readPatchReadme: (archive: Uint8Array, options?: BrowserPatchOptions) => PatchReadme | null;
59
92
  }>;
60
93
  export declare const NitroHelper: Readonly<{
61
- inspectRom: (bytes: Uint8Array) => RomInfo;
94
+ inspectRom: (bytes: Uint8Array, options?: {
95
+ dsiMode?: "legacy" | "complete";
96
+ }) => RomInfo;
62
97
  }>;