Skip to content

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 ​

readonly bytes: number

Defined in: manifest.ts:12

file ​

readonly file: string

Defined in: manifest.ts:11

sha256 ​

readonly sha256: 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 ​

readonly shared: ManifestFile

Defined in: manifest.ts:18

static? ​

readonly optional static?: 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 ​

readonly baseUrl: string

Defined in: manifest.ts:27

Where the files are: a release's download URL, joined with each file's name.

build ​

readonly build: string

Defined in: manifest.ts:25

The native sources' hash the builds were made from; empty before the first publish.

platforms ​

readonly platforms: 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 ​

NativeManifest

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 ​

NativeManifest

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.