API reference / @jsprismarine/native-library / manifest
manifest
Interfaces
ManifestFile
Defined in: manifest.ts:10
One published file: its name in the release, its size and its SHA-256.
Properties
bytes
readonlybytes:number
Defined in: manifest.ts:12
file
readonlyfile:string
Defined in: manifest.ts:11
sha256
readonlysha256:string
Defined in: manifest.ts:13
ManifestPlatform
Defined in: manifest.ts:17
One platform's builds: the shared library the runtimes load, and the scriptc archive when there is one.
Properties
shared
readonlyshared:ManifestFile
Defined in: manifest.ts:18
static?
readonlyoptionalstatic?:ManifestFile
Defined in: manifest.ts:19
NativeManifest
Defined in: manifest.ts:23
The builds a version of a package downloads, from its native/manifest.json.
Properties
baseUrl
readonlybaseUrl:string
Defined in: manifest.ts:27
Where the files are: a release's download URL, joined with each file's name.
build
readonlybuild:string
Defined in: manifest.ts:25
The native sources' hash the builds were made from; empty before the first publish.
platforms
readonlyplatforms:Readonly<Record<string,ManifestPlatform>>
Defined in: manifest.ts:28
Functions
parseManifest()
parseManifest(
value):NativeManifest
Defined in: manifest.ts:45
Checks parsed JSON against the manifest's shape.
Parameters
value
unknown
The parsed file.
Returns
The manifest.
Throws
When build or baseUrl is missing.
Throws
When a platform's entry is malformed.
readManifest()
readManifest(
packageDir):NativeManifest
Defined in: manifest.ts:69
Reads a package's manifest from disk, as a script that rewrote it does.
Parameters
packageDir
string
The package's directory.
Returns
The manifest.
sha256()
sha256(
bytes):string
Defined in: manifest.ts:77
The SHA-256 of bytes, as lowercase hex.
Parameters
bytes
Uint8Array
The bytes.
Returns
string
The digest.