[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/native-library](https://jsprismarine.dev/api/@jsprismarine/native-library/index.md) / manifest

# manifest

## Interfaces

### ManifestFile

Defined in: [manifest.ts:10](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L10)

One published file: its name in the release, its size and its SHA-256.

#### Properties

##### bytes

> `readonly` **bytes**: `number`

Defined in: [manifest.ts:12](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L12)

##### file

> `readonly` **file**: `string`

Defined in: [manifest.ts:11](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L11)

##### sha256

> `readonly` **sha256**: `string`

Defined in: [manifest.ts:13](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L13)

***

### ManifestPlatform

Defined in: [manifest.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L17)

One platform's builds: the shared library the runtimes load, and the scriptc archive when there is one.

#### Properties

##### shared

> `readonly` **shared**: [`ManifestFile`](#manifestfile)

Defined in: [manifest.ts:18](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L18)

##### static?

> `readonly` `optional` **static?**: [`ManifestFile`](#manifestfile)

Defined in: [manifest.ts:19](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L19)

***

### NativeManifest

Defined in: [manifest.ts:23](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L23)

The builds a version of a package downloads, from its `native/manifest.json`.

#### Properties

##### baseUrl

> `readonly` **baseUrl**: `string`

Defined in: [manifest.ts:27](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L27)

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

##### build

> `readonly` **build**: `string`

Defined in: [manifest.ts:25](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L25)

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

##### platforms

> `readonly` **platforms**: `Readonly`\<`Record`\<`string`, [`ManifestPlatform`](#manifestplatform)\>\>

Defined in: [manifest.ts:28](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L28)

## Functions

### parseManifest()

> **parseManifest**(`value`): [`NativeManifest`](#nativemanifest)

Defined in: [manifest.ts:45](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L45)

Checks parsed JSON against the manifest's shape.

#### Parameters

##### value

`unknown`

The parsed file.

#### Returns

[`NativeManifest`](#nativemanifest)

The manifest.

#### Throws

When `build` or `baseUrl` is missing.

#### Throws

When a platform's entry is malformed.

***

### readManifest()

> **readManifest**(`packageDir`): [`NativeManifest`](#nativemanifest)

Defined in: [manifest.ts:69](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L69)

Reads a package's manifest from disk, as a script that rewrote it does.

#### Parameters

##### packageDir

`string`

The package's directory.

#### Returns

[`NativeManifest`](#nativemanifest)

The manifest.

***

### sha256()

> **sha256**(`bytes`): `string`

Defined in: [manifest.ts:77](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-library/src/manifest.ts#L77)

The SHA-256 of bytes, as lowercase hex.

#### Parameters

##### bytes

`Uint8Array`

The bytes.

#### Returns

`string`

The digest.
