# songstress/manifest

> The manifest's types, its validator and the lists it checks against.

Page: https://songstress.app/docs/develop/reference/manifest/

It needs no host: it runs in a terminal, on a server and in a browser. See [The manifest](/docs/develop/manifest/#check-it-from-code).

What it exports is the SDK's own record of its public surface, which the SDK's tests hold to the code. Each type's
fields, and every description, are read from the SDK's source when the site is built.

It also exports, as the modules that declare them document them: [CatalogType](/docs/develop/reference/songstress/#type-CatalogType), [IconName](/docs/develop/reference/songstress/#type-IconName), [MenuLocation](/docs/develop/reference/songstress/#type-MenuLocation), [PermissionName](/docs/develop/reference/songstress/#type-PermissionName), [Platform](/docs/develop/reference/songstress/#type-Platform), [ProviderGroup](/docs/develop/reference/songstress/#type-ProviderGroup), [Side](/docs/develop/reference/songstress/#type-Side).

### ArtistInfoSource

A source of words about an artist.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `supports` | `("biography" \| "similar")[]` | What it can say about an artist: who they are, in words, or the artists like them. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### ArtworkSource

A source of artist photos and album covers.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `supports` | `("album-cover" \| "artist-photo")[]` | The pictures it can find. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### Banner

A 16:9 image, from 1280 by 720 up to 3840 by 2160 pixels.

| Field | Type | Description |
|---|---|---|
| `path` | `string` | The PNG, JPEG or WebP file, from the package root. |
| `width` | `number` | The image's width in pixels. |
| `height` | `number` | The image's height in pixels. |

### BooleanSetting

A switch.

| Field | Type | Description |
|---|---|---|
| `key` | `string` | The name code reads the setting by. |
| `type` | `"boolean"` | A switch. |
| `title` | `string` | The setting's label. |
| `description?` | `string \| undefined` | A line of help under the label. |
| `section?` | `string \| undefined` | The heading the setting is drawn under, with the other settings that name it. |
| `scope` | `SettingScope` | Whose setting it is: the server's, each member's or each device's. |
| `default?` | `boolean \| undefined` | The value until someone sets one. |

Refers to [SettingKey](/docs/develop/reference/manifest/#type-SettingKey), [Title](/docs/develop/reference/manifest/#type-Title), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [SettingSection](/docs/develop/reference/manifest/#type-SettingSection), [SettingScope](/docs/develop/reference/manifest/#type-SettingScope).

### CATEGORIES

Every category a manifest may list, as the schema lists them.

```ts
export declare const CATEGORIES: readonly Category[];
```

Refers to [Category](/docs/develop/reference/manifest/#type-Category).

### CLIENT_HOOKS

Every hook the client entry may listen to, as the schema lists them.

```ts
export declare const CLIENT_HOOKS: readonly ClientHook[];
```

Refers to [ClientHook](/docs/develop/reference/manifest/#type-ClientHook).

### Category

A category of the official list.

```ts
export type Category = "sources" | "lyrics" | "metadata-artwork" | "scrobbling-stats" | "discovery" | "playback-audio" | "visualisers" | "themes" | "social-jam" | "library-tools" | "integrations" | "server-worker";
```

### ClientHook

A hook of the client entry.

```ts
export type ClientHook = "onPlay" | "onPause" | "onTrackChange" | "onSeek" | "onVolumeChange" | "onQueueChange" | "onProgress";
```

### Command

A named action the extension's code carries out, run from a menu, a button or another command.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The command's name. Code registers its handler under it. |
| `title` | `string` | The label on the menu item or button that runs it. |
| `run` | `Side` | The entry that holds the command's handler. |
| `description?` | `string \| undefined` | What the command does. |
| `icon?` | `string \| undefined` | The icon beside the title. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [Side](/docs/develop/reference/songstress/#type-Side), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [IconName](/docs/develop/reference/songstress/#type-IconName).

### Contributes

What the extension adds to Songstress: commands, menus, settings, pages, panels, status items, views, themes, providers, jobs, routes and a sign-in.

| Field | Type | Description |
|---|---|---|
| `commands?` | `Command[] \| undefined` | Named actions the extension's code carries out. |
| `menus?` | `Menus \| undefined` | Where the extension's commands appear in the apps. |
| `settings?` | `Setting[] \| undefined` | The settings Songstress draws and keeps for the extension, in the order they are shown. |
| `pages?` | `Page[] \| undefined` | Pages the apps draw from a tree of Songstress's own components. |
| `panels?` | `Panel[] \| undefined` | Sections drawn inside Songstress's own screens. |
| `status?` | `StatusItem[] \| undefined` | Status items in the player: an icon and a few words each, the extension's state at a glance. |
| `views?` | `View[] \| undefined` | Free-form pages: the extension's own HTML, opened in the browser apart from the app, with no API. An app may not open them at all. |
| `themes?` | `Theme[] \| undefined` | The themes the extension adds to the picker: each a dark look, a light one, or both. |
| `providers?` | `SourcesByKind \| undefined` | Sources the extension adds beside Songstress's own, by kind. |
| `jobs?` | `Job[] \| undefined` | Scheduled and background work, shown in Activity. |
| `routes?` | `Route[] \| undefined` | Signed-in JSON routes under the extension's own prefix. |
| `signIn?` | `SignIn \| undefined` | A sign-in to the service the extension reaches, which a person starts and ends in Songstress. |

Refers to [Command](/docs/develop/reference/manifest/#type-Command), [Menus](/docs/develop/reference/manifest/#type-Menus), [Setting](/docs/develop/reference/manifest/#type-Setting), [Page](/docs/develop/reference/manifest/#type-Page), [Panel](/docs/develop/reference/manifest/#type-Panel), [StatusItem](/docs/develop/reference/manifest/#type-StatusItem), [View](/docs/develop/reference/manifest/#type-View), [Theme](/docs/develop/reference/manifest/#type-Theme), [SourcesByKind](/docs/develop/reference/manifest/#type-SourcesByKind), [Job](/docs/develop/reference/manifest/#type-Job), [Route](/docs/develop/reference/manifest/#type-Route), [SignIn](/docs/develop/reference/manifest/#type-SignIn).

### DownloadSource

A source the library can fetch audio from, at the qualities it offers.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `qualities` | `Quality[]` | The qualities it offers, best first. The admin picks one. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [Quality](/docs/develop/reference/manifest/#type-Quality).

### Engines

The extension API versions the extension runs on.

| Field | Type | Description |
|---|---|---|
| `songstress` | `string` | The versions of the extension API the extension runs on, as a range: ^1.2.0, ~1.2.0, >=1.2.0, >=1.2.0 <2.0.0 or one exact version. Never *. |

Refers to [songstress](/docs/develop/reference/songstress/#type-songstress).

### Entry

The extension's code: the bundle that runs on the server, the one that runs in the apps, or both.

| Field | Type | Description |
|---|---|---|
| `server?` | `string \| undefined` | The bundle that runs on the user's server, in a sandbox. It hears every app's plays and does the work that must go on while no app is open. |
| `client?` | `string \| undefined` | The bundle that runs inside an app while it is open, in a sandbox. It follows this device's player live. An app may not run client code at all: what must work everywhere belongs in the server entry. |

Refers to [ScriptPath](/docs/develop/reference/manifest/#type-ScriptPath).

### ExtensionId

publisher.name, each part in lowercase letters, digits and single hyphens.

```ts
export type ExtensionId = string;
```

### HOOK_PERMISSIONS

The permission each hook needs before it is delivered; null for none.
Hearing a member's playback is reading their listening, on either side.

```ts
export declare const HOOK_PERMISSIONS: {
    readonly server: Readonly<Record<ServerHook, PermissionName>>;
    readonly client: Readonly<Record<ClientHook, PermissionName | null>>;
};
```

Refers to [ServerHook](/docs/develop/reference/manifest/#type-ServerHook), [PermissionName](/docs/develop/reference/songstress/#type-PermissionName), [ClientHook](/docs/develop/reference/manifest/#type-ClientHook).

### Hooks

The events the extension's code listens to, by side.

| Field | Type | Description |
|---|---|---|
| `server?` | `ServerHook[] \| undefined` | Hooks the server entry listens to. |
| `client?` | `ClientHook[] \| undefined` | Hooks the client entry listens to. |

Refers to [ServerHook](/docs/develop/reference/manifest/#type-ServerHook), [ClientHook](/docs/develop/reference/manifest/#type-ClientHook).

### HostPattern

A public host by name (api.example.com), or every host under a domain (*.example.com), with an optional port. Never an address, a scheme or a path.

```ts
export type HostPattern = string;
```

### HttpsUrl

An https address.

```ts
export type HttpsUrl = string;
```

### Icon

A square PNG of 512 by 512 pixels.

| Field | Type | Description |
|---|---|---|
| `path` | `string` | The PNG file, from the package root. |
| `width` | `512` | The image's width in pixels: 512. |
| `height` | `512` | The image's height in pixels: 512. |

### Job

Work the server runs in the background, on a schedule or when code asks, shown in Activity.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The job's name. Code registers its handler under it. |
| `title` | `string` | The job as Activity shows it. |
| `every?` | `string \| undefined` | How often the job runs by itself: a number and m, h or d (15m, 6h, 1d). Left out, the job runs only when code starts it. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### KEYWORD_CODES

The code each keyword reports when it fails: the contract every reader of
the schema keeps, whatever validator it is built on.

```ts
export declare const KEYWORD_CODES: {
    readonly type: "SCHEMA_TYPE";
    readonly required: "SCHEMA_REQUIRED";
    readonly additionalProperties: "SCHEMA_UNKNOWN_PROPERTY";
    readonly enum: "SCHEMA_ENUM";
    readonly const: "SCHEMA_CONST";
    readonly pattern: "SCHEMA_PATTERN";
    readonly minLength: "SCHEMA_LENGTH";
    readonly maxLength: "SCHEMA_LENGTH";
    readonly minimum: "SCHEMA_RANGE";
    readonly maximum: "SCHEMA_RANGE";
    readonly exclusiveMinimum: "SCHEMA_RANGE";
    readonly minItems: "SCHEMA_ITEM_COUNT";
    readonly maxItems: "SCHEMA_ITEM_COUNT";
    readonly uniqueItems: "SCHEMA_DUPLICATE_ITEM";
    readonly minProperties: "SCHEMA_PROPERTY_COUNT";
};
```

### Keyword

A tag: lowercase letters and digits, with single dots or hyphens between them.

```ts
export type Keyword = string;
```

### LISTING_FIELDS

The fields a listing cannot do without.

```ts
export declare const LISTING_FIELDS: readonly [
    "license",
    "repository",
    "categories",
    "icon",
    "screenshots"
];
```

### LISTING_LICENSES

The licences the official list accepts, as SPDX identifiers.

```ts
export declare const LISTING_LICENSES: readonly string[];
```

### LISTING_MIN_SCREENSHOTS

The fewest screenshots a listing shows. The schema holds the most (six).

```ts
export declare const LISTING_MIN_SCREENSHOTS = 3;
```

### LinkPattern

A host with an optional path that a link must begin with (soundcloud.com, example.com/album/), or an app link's scheme (spotify:). A host also takes links to the hosts under it.

```ts
export type LinkPattern = string;
```

### LinkSource

A source that reads a pasted link.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `group?` | `ProviderGroup \| undefined` | The catalogue of Songstress's own whose links this source reads. Left out, the source is a group of its own. |
| `patterns` | `string[]` | The links it reads. The longest pattern that fits a link wins. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [ProviderGroup](/docs/develop/reference/songstress/#type-ProviderGroup), [LinkPattern](/docs/develop/reference/manifest/#type-LinkPattern).

### LocalId

A name unique among its kind inside one extension: lowercase letters, digits and single hyphens, starting with a letter.

```ts
export type LocalId = string;
```

### LocalNetworkPermission

Reaching the user's own network: why, and which targets.

| Field | Type | Description |
|---|---|---|
| `reason` | `string` | Why the extension needs this, in words the person granting it will read. |
| `targets?` | `string[] \| undefined` | The targets on the user's own network the extension asks for. Left out, the admin names them when granting. |

Refers to [Reason](/docs/develop/reference/manifest/#type-Reason), [LocalTarget](/docs/develop/reference/manifest/#type-LocalTarget).

### LocalTarget

A target on the user's own network: an IPv4 address (192.168.1.20), a block of them (192.168.1.0/24) or a host name (nas.local), the address and the name with an optional port.

```ts
export type LocalTarget = string;
```

### LookupSource

A source that opens one track, album, artist or playlist by its id.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `group?` | `ProviderGroup \| undefined` | The catalogue of Songstress's own whose ids this source speaks. Left out, the source is a group of its own. |
| `types` | `CatalogType[]` | What it can open by id. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [ProviderGroup](/docs/develop/reference/songstress/#type-ProviderGroup), [CatalogType](/docs/develop/reference/songstress/#type-CatalogType).

### MANIFEST_ERROR_CODES

Every code the validator reports, each with a sentence for people. The codes are the contract; the sentences may be reworded.

```ts
export declare const MANIFEST_ERROR_CODES: {
    MANIFEST_TOO_LARGE: string;
    MANIFEST_TOO_DEEP: string;
    JSON_INVALID: string;
    JSON_DUPLICATE_KEY: string;
    THEME_FILE_TOO_LARGE: string;
    SCHEMA_TYPE: string;
    SCHEMA_REQUIRED: string;
    SCHEMA_UNKNOWN_PROPERTY: string;
    SCHEMA_ENUM: string;
    SCHEMA_CONST: string;
    SCHEMA_PATTERN: string;
    SCHEMA_LENGTH: string;
    SCHEMA_RANGE: string;
    SCHEMA_ITEM_COUNT: string;
    SCHEMA_DUPLICATE_ITEM: string;
    SCHEMA_PROPERTY_COUNT: string;
    TEXT_UNSAFE: string;
    ID_RESERVED: string;
    VERSION_INVALID: string;
    ENGINE_RANGE_INVALID: string;
    ENGINE_UNSUPPORTED: string;
    PATH_OUTSIDE_PACKAGE: string;
    BANNER_NOT_16_9: string;
    ENTRY_REQUIRED: string;
    ENTRY_UNUSED: string;
    PERMISSION_REQUIRED: string;
    PERMISSION_UNUSED: string;
    NETWORK_LOCAL_NOT_PRIVATE: string;
    DUPLICATE_ID: string;
    MENU_COMMAND_UNKNOWN: string;
    ROUTE_DUPLICATE: string;
    LINK_PATTERN_TOO_BROAD: string;
    PROVIDER_PLAY_NEEDS_SEARCH: string;
    PROVIDER_MISMATCH: string;
    SETTING_DEFAULT_INVALID: string;
    SETTING_RANGE_INVALID: string;
    SETTING_OPTION_DUPLICATE: string;
    THEME_LOOKS: string;
    THEME_COLOR: string;
    THEME_COLOR_ALPHA: string;
    WHEN_INVALID: string;
    WHEN_KEY_UNKNOWN: string;
    LISTING_FIELD_REQUIRED: string;
    LISTING_LICENSE: string;
    LISTING_REPOSITORY: string;
    LISTING_SCREENSHOTS: string;
};
```

### MANIFEST_FILE

The name of the manifest file, at the root of an extension's package.

```ts
export declare const MANIFEST_FILE = "songstress.json";
```

Refers to [songstress](/docs/develop/reference/songstress/#type-songstress).

### MANIFEST_PROFILES

The validator's profiles: `install`, what a server takes from a link or a file, and `listing`, what a listing asks on top.

```ts
export declare const MANIFEST_PROFILES: readonly ManifestProfile[];
```

Refers to [ManifestProfile](/docs/develop/reference/manifest/#type-ManifestProfile).

### MANIFEST_SCHEMA

The manifest's JSON Schema (draft 2020-12).

```ts
export declare const MANIFEST_SCHEMA: SchemaNode;
```

### MANIFEST_SCHEMA_ID

The address the schema is published at, and its `$id`.

```ts
export declare const MANIFEST_SCHEMA_ID: string;
```

### MAX_MANIFEST_BYTES

The largest manifest read, in bytes of UTF-8.

```ts
export declare const MAX_MANIFEST_BYTES: number;
```

### MAX_MANIFEST_DEPTH

The deepest nesting of objects and lists read.

```ts
export declare const MAX_MANIFEST_DEPTH = 16;
```

### MAX_THEME_FILE_BYTES

The most a theme file may hold, in bytes.

```ts
export declare const MAX_THEME_FILE_BYTES: number;
```

### MENU_LOCATIONS

Every place a menu item may stand.

```ts
export declare const MENU_LOCATIONS: readonly MenuLocation[];
```

Refers to [MenuLocation](/docs/develop/reference/songstress/#type-MenuLocation).

### Manifest

The songstress.json file at the root of an extension's package: what the extension is, how it is listed, the code it ships, the permissions it asks for and everything it adds to Songstress.

| Field | Type | Description |
|---|---|---|
| `$schema?` | `string \| undefined` | The address of this schema, so an editor can check the file as you type. |
| `manifestVersion` | `1` | The version of the manifest format. Always 1. |
| `id` | `string` | The extension's identity, as publisher.name. It never changes once the extension is installed anywhere. |
| `name` | `string` | The name people see. |
| `version` | `string` | The extension's own version, as a semantic version (1.4.0). A release is tagged with it. |
| `description` | `string` | One or two sentences on what the extension does, shown under its name. |
| `engines` | `Engines` | The extension API the extension was written for. |
| `license?` | `string \| undefined` | The licence of the extension's code, as an SPDX identifier (MIT, Apache-2.0). |
| `repository?` | `string \| undefined` | Where the source lives. |
| `sponsor?` | `Sponsor \| undefined` | Where people can support the author. |
| `categories?` | `Category[] \| undefined` | The one category the extension is listed under. |
| `keywords?` | `string[] \| undefined` | Free tags that help people find the extension. |
| `platforms?` | `Platform[] \| undefined` | The Songstress apps the extension's interface and client code work in. Left out, it means all of them. Code in the server entry reaches every app whatever this says. |
| `icon?` | `Icon \| undefined` | The extension's icon. |
| `banner?` | `Banner \| undefined` | The wide image on the extension's card. |
| `screenshots?` | `Screenshot[] \| undefined` | Captures of the extension at work. The official list asks for three to six. |
| `entry?` | `Entry \| undefined` | The extension's code: one JavaScript bundle for each side it runs on. |
| `hooks?` | `Hooks \| undefined` | The hooks the extension's code listens to. Songstress starts the code when one of them fires. |
| `permissions?` | `Permissions \| undefined` | What the extension asks to be allowed to do. Nothing is allowed unless it is asked for here and then granted by a person. |
| `contributes?` | `Contributes \| undefined` | What the extension adds to Songstress. |

Refers to [ExtensionId](/docs/develop/reference/manifest/#type-ExtensionId), [Engines](/docs/develop/reference/manifest/#type-Engines), [HttpsUrl](/docs/develop/reference/manifest/#type-HttpsUrl), [Sponsor](/docs/develop/reference/manifest/#type-Sponsor), [Category](/docs/develop/reference/manifest/#type-Category), [Keyword](/docs/develop/reference/manifest/#type-Keyword), [Platform](/docs/develop/reference/songstress/#type-Platform), [Icon](/docs/develop/reference/manifest/#type-Icon), [Banner](/docs/develop/reference/manifest/#type-Banner), [Screenshot](/docs/develop/reference/manifest/#type-Screenshot), [Entry](/docs/develop/reference/manifest/#type-Entry), [Hooks](/docs/develop/reference/manifest/#type-Hooks), [Permissions](/docs/develop/reference/manifest/#type-Permissions), [Contributes](/docs/develop/reference/manifest/#type-Contributes).

### ManifestErrorCode

A stable problem code.

```ts
export type ManifestErrorCode = keyof typeof MANIFEST_ERROR_CODES;
```

Refers to [MANIFEST_ERROR_CODES](/docs/develop/reference/manifest/#type-MANIFEST_ERROR_CODES).

### ManifestIssue

One problem: its code, where it is, and a sentence for a person. Only the
code and the pointer are part of the specification; the sentence may be
reworded.

| Field | Type | Description |
|---|---|---|
| `code` | `"BANNER_NOT_16_9" \| "DUPLICATE_ID" \| "ENGINE_RANGE_INVALID" \| "ENGINE_UNSUPPORTED" \| "ENTRY_REQUIRED" \| "ENTRY_UNUSED" \| "ID_RESERVED" \| "JSON_DUPLICATE_KEY" \| "JSON_INVALID" \| "LINK_PATTERN_TOO_BROAD" \| "LISTING_FIELD_REQUIRED" \| "LISTING_LICENSE" \| "LISTING_REPOSITORY" \| "LISTING_SCREENSHOTS" \| "MANIFEST_TOO_DEEP" \| "MANIFEST_TOO_LARGE" \| "MENU_COMMAND_UNKNOWN" \| "NETWORK_LOCAL_NOT_PRIVATE" \| "PATH_OUTSIDE_PACKAGE" \| "PERMISSION_REQUIRED" \| "PERMISSION_UNUSED" \| "PROVIDER_MISMATCH" \| "PROVIDER_PLAY_NEEDS_SEARCH" \| "ROUTE_DUPLICATE" \| "SCHEMA_CONST" \| "SCHEMA_DUPLICATE_ITEM" \| "SCHEMA_ENUM" \| "SCHEMA_ITEM_COUNT" \| "SCHEMA_LENGTH" \| "SCHEMA_PATTERN" \| "SCHEMA_PROPERTY_COUNT" \| "SCHEMA_RANGE" \| "SCHEMA_REQUIRED" \| "SCHEMA_TYPE" \| "SCHEMA_UNKNOWN_PROPERTY" \| "SETTING_DEFAULT_INVALID" \| "SETTING_OPTION_DUPLICATE" \| "SETTING_RANGE_INVALID" \| "TEXT_UNSAFE" \| "THEME_COLOR" \| "THEME_COLOR_ALPHA" \| "THEME_FILE_TOO_LARGE" \| "THEME_LOOKS" \| "VERSION_INVALID" \| "WHEN_INVALID" \| "WHEN_KEY_UNKNOWN"` | What is wrong, as a stable code: `MANIFEST_ERROR_CODES` says each. |
| `pointer` | `string` | A JSON Pointer (RFC 6901) into the manifest; "" is the whole document. |
| `message` | `string` | The problem in a sentence, for people. It may be reworded; the code may not. |

Refers to [ManifestErrorCode](/docs/develop/reference/manifest/#type-ManifestErrorCode).

### ManifestProfile

What a manifest is held to: what a server takes from a file or a link
("install"), or what the official list asks on top ("listing").

```ts
export type ManifestProfile = 'install' | 'listing';
```

### ManifestResult

A manifest that passed, typed; or every problem found in it.

```ts
export type ManifestResult = {
    valid: true;
    manifest: Manifest;
    issues: [
    ];
} | {
    valid: false;
    issues: ManifestIssue[];
};
```

Refers to [Manifest](/docs/develop/reference/manifest/#type-Manifest), [ManifestIssue](/docs/develop/reference/manifest/#type-ManifestIssue).

### MenuItem

One menu item: a command, and when it shows.

| Field | Type | Description |
|---|---|---|
| `command` | `string` | The id of one of the extension's commands. |
| `when?` | `string \| undefined` | The item shows only while this holds. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [When](/docs/develop/reference/manifest/#type-When).

### MenuItems

The items an extension adds to one menu.

```ts
export type MenuItems = MenuItem[];
```

Refers to [MenuItem](/docs/develop/reference/manifest/#type-MenuItem).

### Menus

Where the extension's commands appear, by menu.

| Field | Type | Description |
|---|---|---|
| `song/context?` | `MenuItems \| undefined` | A song's menu. The command receives the song. |
| `album/context?` | `MenuItems \| undefined` | An album's menu. The command receives the album. |
| `artist/context?` | `MenuItems \| undefined` | An artist's menu. The command receives the artist. |
| `playlist/context?` | `MenuItems \| undefined` | A playlist's menu. The command receives the playlist. |
| `queue/item?` | `MenuItems \| undefined` | The menu of a song waiting in the queue. The command receives the song. |
| `player/actions?` | `MenuItems \| undefined` | The player's own menu. The command receives the song that is playing. |
| `sidebar?` | `MenuItems \| undefined` | The sidebar of the web and desktop apps. |
| `settings/actions?` | `MenuItems \| undefined` | Buttons on the extension's own settings page. |

Refers to [MenuItems](/docs/develop/reference/manifest/#type-MenuItems).

### MetadataSource

A source of facts about artists, releases and tracks.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `group?` | `ProviderGroup \| undefined` | The catalogue of Songstress's own whose artist ids this source speaks. Left out, the source is a group of its own. |
| `supports` | `("discography" \| "enrich")[]` | What it answers: an artist's discography (their releases, their most played songs, a release's tracks), or the missing facts of one track. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [ProviderGroup](/docs/develop/reference/songstress/#type-ProviderGroup).

### NetworkPermission

Reaching public hosts: why, and which hosts.

| Field | Type | Description |
|---|---|---|
| `reason` | `string` | Why the extension needs this, in words the person granting it will read. |
| `hosts` | `string[]` | The public hosts the extension may reach, over http or https. |

Refers to [Reason](/docs/develop/reference/manifest/#type-Reason), [HostPattern](/docs/develop/reference/manifest/#type-HostPattern).

### NumberSetting

A number.

| Field | Type | Description |
|---|---|---|
| `key` | `string` | The name code reads the setting by. |
| `type` | `"number"` | A number. |
| `title` | `string` | The setting's label. |
| `description?` | `string \| undefined` | A line of help under the label. |
| `section?` | `string \| undefined` | The heading the setting is drawn under, with the other settings that name it. |
| `scope` | `SettingScope` | Whose setting it is: the server's, each member's or each device's. |
| `required?` | `boolean \| undefined` | Songstress asks for it, and does not start the extension for whoever lacks it: anyone, a member or a device, by its scope. |
| `default?` | `number \| undefined` | The value until someone sets one. |
| `minimum?` | `number \| undefined` | The smallest value accepted. |
| `maximum?` | `number \| undefined` | The largest value accepted. |
| `step?` | `number \| undefined` | The distance between two values the control offers. |

Refers to [SettingKey](/docs/develop/reference/manifest/#type-SettingKey), [Title](/docs/develop/reference/manifest/#type-Title), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [SettingSection](/docs/develop/reference/manifest/#type-SettingSection), [SettingScope](/docs/develop/reference/manifest/#type-SettingScope).

### PANEL_LOCATIONS

Every screen a panel may be drawn in.

```ts
export declare const PANEL_LOCATIONS: readonly PanelLocation[];
```

Refers to [PanelLocation](/docs/develop/reference/manifest/#type-PanelLocation).

### PERMISSIONS

Every permission a manifest may ask for.

```ts
export declare const PERMISSIONS: readonly PermissionName[];
```

Refers to [PermissionName](/docs/develop/reference/songstress/#type-PermissionName).

### PLATFORMS

The apps an extension's interface and client code may work in.

```ts
export declare const PLATFORMS: readonly Platform[];
```

Refers to [Platform](/docs/develop/reference/songstress/#type-Platform).

### PROVIDER_KINDS

Every kind of provider a manifest may declare.

```ts
export declare const PROVIDER_KINDS: readonly ProviderKind[];
```

Refers to [ProviderKind](/docs/develop/reference/manifest/#type-ProviderKind).

### Page

A page the apps draw from a tree of Songstress's own blocks, built by the extension's code.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The page's name. Code registers its renderer under it, and it is the page's address. |
| `title` | `string` | The page's heading. |
| `render` | `Side` | The entry that builds the page's tree. A page built in the server entry shows in every app. |
| `icon?` | `string \| undefined` | The icon of the page's sidebar entry. |
| `sidebar?` | `boolean \| undefined` | Give the page an entry in the apps' own navigation: the sidebar of the web and desktop apps, the Library tab of the phones. |
| `when?` | `string \| undefined` | The page's entry in the apps' navigation shows only while this holds. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [Side](/docs/develop/reference/songstress/#type-Side), [IconName](/docs/develop/reference/songstress/#type-IconName), [When](/docs/develop/reference/manifest/#type-When).

### Panel

A section the extension's code builds inside one of Songstress's own screens.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The panel's name. Code registers its renderer under it. |
| `title` | `string` | The panel's heading. |
| `location` | `PanelLocation` | Which of Songstress's screens the panel is drawn in. |
| `render` | `Side` | The entry that builds the panel's tree. |
| `when?` | `string \| undefined` | The panel is drawn only while this holds. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [PanelLocation](/docs/develop/reference/manifest/#type-PanelLocation), [Side](/docs/develop/reference/songstress/#type-Side), [When](/docs/develop/reference/manifest/#type-When).

### PanelLocation

The Songstress screen a panel is drawn in: the player's now-playing view, Home, an artist's page, an album's page or a playlist's page.

```ts
export type PanelLocation = "now-playing" | "home" | "artist" | "album" | "playlist";
```

### Permission

A permission with nothing more to name than why it is asked for.

| Field | Type | Description |
|---|---|---|
| `reason` | `string` | Why the extension needs this, in words the person granting it will read. |

Refers to [Reason](/docs/develop/reference/manifest/#type-Reason).

### Permissions

What the extension may do, each with the reason it gives.

| Field | Type | Description |
|---|---|---|
| `network?` | `NetworkPermission \| undefined` | Reach the named public hosts. |
| `network.local?` | `LocalNetworkPermission \| undefined` | Reach targets on the user's own network. |
| `library.read?` | `Permission \| undefined` | Read the catalogue and hear when it changes. |
| `users.read?` | `Permission \| undefined` | Read members' ids and display names. |
| `listening.read?` | `Permission \| undefined` | Read a member's plays, what they are playing now and what they like. Each member grants it for themselves. |
| `player.control?` | `Permission \| undefined` | Start, pause, skip and seek the player of the device the code runs on, and add to its queue. |
| `providers?` | `Permission \| undefined` | Answer beside Songstress's own sources. |
| `routes?` | `Permission \| undefined` | Serve its own signed-in routes. |
| `jobs?` | `Permission \| undefined` | Run scheduled and background work. |
| `storage?` | `Permission \| undefined` | Keep its own data, under a quota. |
| `secrets?` | `Permission \| undefined` | Keep its own credentials, sealed. |

Refers to [NetworkPermission](/docs/develop/reference/manifest/#type-NetworkPermission), [LocalNetworkPermission](/docs/develop/reference/manifest/#type-LocalNetworkPermission), [Permission](/docs/develop/reference/manifest/#type-Permission).

### ProviderKind

A kind of provider, as `contributes.providers` keys it.

```ts
export type ProviderKind = keyof SourcesByKind;
```

Refers to [SourcesByKind](/docs/develop/reference/manifest/#type-SourcesByKind).

### Quality

One quality a download source offers.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The quality's name, as code receives it. |
| `title` | `string` | The quality as people read it (AAC 256 kbps). |
| `lossless?` | `boolean \| undefined` | The audio is lossless. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### RESERVED_PUBLISHERS

Publisher names no extension may take: the namespaces of the extension
API and the first part of each permission. An id such as "player.radio"
would read as part of Songstress itself.

```ts
export declare const RESERVED_PUBLISHERS: readonly string[];
```

### Reason

Why the extension needs this, in words the person granting it will read.

```ts
export type Reason = string;
```

### RecommendSource

A source of recommendations.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `modes` | `("artist" \| "context" \| "track")[]` | What it recommends from: one song, one artist, or a list of songs. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### Route

An HTTP route under the extension's own prefix on the server.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The route's name. Code registers its handler under it. |
| `method` | `"DELETE" \| "GET" \| "PATCH" \| "POST" \| "PUT"` | The HTTP method. |
| `path` | `string` | The path under the extension's own prefix: segments of lowercase letters, digits, dots, hyphens and underscores, or :name for a part the handler reads (/charts/:period). |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId).

### SERVER_HOOKS

Every hook the server entry may listen to, as the schema lists them.

```ts
export declare const SERVER_HOOKS: readonly ServerHook[];
```

Refers to [ServerHook](/docs/develop/reference/manifest/#type-ServerHook).

### Screenshot

One capture, with the size it really has.

| Field | Type | Description |
|---|---|---|
| `path` | `string` | The PNG, JPEG or WebP file, from the package root. |
| `width` | `number` | The image's width in pixels. |
| `height` | `number` | The image's height in pixels. |
| `caption?` | `string \| undefined` | What the capture shows, also read aloud by screen readers. |
| `platform?` | `Platform \| undefined` | The app the capture was taken in. |

Refers to [Platform](/docs/develop/reference/songstress/#type-Platform).

### ScriptPath

One JavaScript file, from the package root.

```ts
export type ScriptPath = string;
```

### SearchSource

A source that answers a search.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |
| `group?` | `ProviderGroup \| undefined` | The catalogue of Songstress's own whose results this source's are merged with. Left out, the source is a group of its own. |
| `types` | `CatalogType[]` | What a search can find. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [ProviderGroup](/docs/develop/reference/songstress/#type-ProviderGroup), [CatalogType](/docs/develop/reference/songstress/#type-CatalogType).

### SecretSetting

A password, key or token. Songstress seals it, never shows it again and never sends it to an app. A device cannot keep one.

| Field | Type | Description |
|---|---|---|
| `key` | `string` | The name code reads the setting by. |
| `type` | `"secret"` | A password field: Songstress seals what is typed and never shows it again. |
| `title` | `string` | The setting's label. |
| `description?` | `string \| undefined` | A line of help under the label. |
| `section?` | `string \| undefined` | The heading the setting is drawn under, with the other settings that name it. |
| `scope` | `"server" \| "user"` | Who the secret belongs to: the whole server or each member. |
| `required?` | `boolean \| undefined` | Songstress asks for it, and does not start the extension for whoever lacks it: anyone, a member or a device, by its scope. |
| `placeholder?` | `string \| undefined` | The hint shown while the field is empty. |

Refers to [SettingKey](/docs/develop/reference/manifest/#type-SettingKey), [Title](/docs/develop/reference/manifest/#type-Title), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [SettingSection](/docs/develop/reference/manifest/#type-SettingSection).

### SelectSetting

One choice from a list.

| Field | Type | Description |
|---|---|---|
| `key` | `string` | The name code reads the setting by. |
| `type` | `"select"` | One choice from a list of options. |
| `title` | `string` | The setting's label. |
| `description?` | `string \| undefined` | A line of help under the label. |
| `section?` | `string \| undefined` | The heading the setting is drawn under, with the other settings that name it. |
| `scope` | `SettingScope` | Whose setting it is: the server's, each member's or each device's. |
| `required?` | `boolean \| undefined` | Songstress asks for it, and does not start the extension for whoever lacks it: anyone, a member or a device, by its scope. |
| `default?` | `string \| undefined` | The value of the option chosen until someone picks one. |
| `options` | `SettingOption[]` | The choices, in the order they are shown. |

Refers to [SettingKey](/docs/develop/reference/manifest/#type-SettingKey), [Title](/docs/develop/reference/manifest/#type-Title), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [SettingSection](/docs/develop/reference/manifest/#type-SettingSection), [SettingScope](/docs/develop/reference/manifest/#type-SettingScope), [SettingOption](/docs/develop/reference/manifest/#type-SettingOption).

### Sentence

A sentence or two, on one line.

```ts
export type Sentence = string;
```

### ServerHook

A hook of the server entry.

```ts
export type ServerHook = "onPlay" | "onScrobble" | "onFavorite" | "onPlaylistChange" | "onLibraryChange" | "onScanComplete";
```

### Setting

One setting. Its type decides the control Songstress draws and what else it may say.

```ts
export type Setting = StringSetting | SecretSetting | NumberSetting | BooleanSetting | SelectSetting;
```

Refers to [StringSetting](/docs/develop/reference/manifest/#type-StringSetting), [SecretSetting](/docs/develop/reference/manifest/#type-SecretSetting), [NumberSetting](/docs/develop/reference/manifest/#type-NumberSetting), [BooleanSetting](/docs/develop/reference/manifest/#type-BooleanSetting), [SelectSetting](/docs/develop/reference/manifest/#type-SelectSetting).

### SettingKey

A setting's name as code reads it: letters and digits, starting with a lowercase letter.

```ts
export type SettingKey = string;
```

### SettingOption

One choice of a select setting.

| Field | Type | Description |
|---|---|---|
| `value` | `string` | What code reads when this option is chosen. |
| `title` | `string` | The option's label. |

Refers to [Title](/docs/develop/reference/manifest/#type-Title).

### SettingScope

Who a setting belongs to: the whole server (the admin sets it), each member, or each device.

```ts
export type SettingScope = "server" | "user" | "device";
```

### SettingSection

The heading a setting is drawn under, with the others that name it.

```ts
export type SettingSection = string;
```

### SignIn

An account at a service the extension signs in to, for the server or for each member.

| Field | Type | Description |
|---|---|---|
| `scope` | `"server" \| "user"` | Whose account it is. "server": one account for the whole server, which its admin signs in. "user": each member's own, which they sign in themselves. |
| `title?` | `string \| undefined` | The service as the sign-in names it (Tunelog). Left out, the extension's name. |

Refers to [Title](/docs/develop/reference/manifest/#type-Title).

### Source

A source that answers beside Songstress's own.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The source's name inside the extension. Code registers the provider under it; the same id under several kinds is one source. |
| `name?` | `string \| undefined` | The source's name as people read it. Left out, it is the extension's name. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title).

### SourcesByKind

The extension's sources, by what they answer. Each kind is a provider contract the code registers.

| Field | Type | Description |
|---|---|---|
| `search?` | `SearchSource[] \| undefined` | Sources that answer a search. |
| `lookup?` | `LookupSource[] \| undefined` | Sources that open one track, album, artist or playlist by its id. |
| `links?` | `LinkSource[] \| undefined` | Sources that read a pasted link. |
| `lyrics?` | `Source[] \| undefined` | Sources of lyrics. |
| `metadata?` | `MetadataSource[] \| undefined` | Sources of facts about artists, releases and tracks. |
| `artwork?` | `ArtworkSource[] \| undefined` | Sources of artist photos and album covers. |
| `artistInfo?` | `ArtistInfoSource[] \| undefined` | Sources of words about an artist: who they are, and the artists like them. |
| `scrobble?` | `Source[] \| undefined` | Services that plays are reported to. |
| `recommend?` | `RecommendSource[] \| undefined` | Sources of recommendations. |
| `play?` | `Source[] \| undefined` | Sources that can play what their own search found. Switched off until the admin turns each on. |
| `download?` | `DownloadSource[] \| undefined` | Sources songs can be acquired from. Switched off until the admin turns each on. |

Refers to [SearchSource](/docs/develop/reference/manifest/#type-SearchSource), [LookupSource](/docs/develop/reference/manifest/#type-LookupSource), [LinkSource](/docs/develop/reference/manifest/#type-LinkSource), [Source](/docs/develop/reference/manifest/#type-Source), [MetadataSource](/docs/develop/reference/manifest/#type-MetadataSource), [ArtworkSource](/docs/develop/reference/manifest/#type-ArtworkSource), [ArtistInfoSource](/docs/develop/reference/manifest/#type-ArtistInfoSource), [RecommendSource](/docs/develop/reference/manifest/#type-RecommendSource), [DownloadSource](/docs/develop/reference/manifest/#type-DownloadSource).

### Sponsor

Where people can support the extension's author.

| Field | Type | Description |
|---|---|---|
| `url` | `string` | The page where people can support the author. |

Refers to [HttpsUrl](/docs/develop/reference/manifest/#type-HttpsUrl).

### StatusItem

An item in the player: an icon and a few words the extension's code keeps current.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The status item's name. Code registers its renderer under it. |
| `title` | `string` | What the item is, for people who do not see it, and where the player lists it. |
| `render` | `Side` | The entry that says what the item shows, for the song playing. |
| `icon?` | `string \| undefined` | The icon shown until the renderer answers. |
| `when?` | `string \| undefined` | The item is drawn only while this holds. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [Side](/docs/develop/reference/songstress/#type-Side), [IconName](/docs/develop/reference/songstress/#type-IconName), [When](/docs/develop/reference/manifest/#type-When).

### StringSetting

A line of text.

| Field | Type | Description |
|---|---|---|
| `key` | `string` | The name code reads the setting by. |
| `type` | `"string"` | A line of text. |
| `title` | `string` | The setting's label. |
| `description?` | `string \| undefined` | A line of help under the label. |
| `section?` | `string \| undefined` | The heading the setting is drawn under, with the other settings that name it. |
| `scope` | `SettingScope` | Whose setting it is: the server's, each member's or each device's. |
| `required?` | `boolean \| undefined` | Songstress asks for it, and does not start the extension for whoever lacks it: anyone, a member or a device, by its scope. |
| `default?` | `string \| undefined` | The value until someone sets one. |
| `placeholder?` | `string \| undefined` | The hint shown while the field is empty. |
| `maxLength?` | `number \| undefined` | The longest value accepted, in characters. |

Refers to [SettingKey](/docs/develop/reference/manifest/#type-SettingKey), [Title](/docs/develop/reference/manifest/#type-Title), [Sentence](/docs/develop/reference/manifest/#type-Sentence), [SettingSection](/docs/develop/reference/manifest/#type-SettingSection), [SettingScope](/docs/develop/reference/manifest/#type-SettingScope).

### THEME_APPEARANCES

A theme's appearances: `dark`, `light` or `both`.

```ts
export declare const THEME_APPEARANCES: readonly ThemeAppearance[];
```

Refers to [ThemeAppearance](/docs/develop/reference/manifest/#type-ThemeAppearance).

### THEME_FILE_SCHEMA

A theme file's JSON Schema (draft 2020-12): the looks of one theme, which
a manifest's theme names by its `path`. Its definitions are the manifest
schema's own (the theme tokens).

```ts
export declare const THEME_FILE_SCHEMA: SchemaNode;
```

### THEME_FILE_SCHEMA_ID

The address the theme file's schema is published at, and its `$id`.

```ts
export declare const THEME_FILE_SCHEMA_ID: string;
```

### THEME_TOKENS

Every colour token a theme's look may set, in the order the specification lists them.

```ts
export declare const THEME_TOKENS: readonly [
    "background",
    "surface",
    "surface.raised",
    "surface.hover",
    "sidebar",
    "border",
    "text",
    "text.muted",
    "text.faint",
    "accent",
    "accent.fill",
    "accent.fill.pressed",
    "accent.onFill",
    "success",
    "warning",
    "danger",
    "info"
];
```

### Theme

One theme the picker lists: a dark look, a light one, or both, written here or in a theme file.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The theme's name inside the extension. |
| `label` | `string` | The theme's name, as the picker shows it. |
| `appearance` | `"both" \| "dark" \| "light"` | The looks the theme has: a dark one, a light one, or both. They are written here or in its file, never both. |
| `dark?` | `ThemeLook \| undefined` | The theme's dark look, written here. |
| `light?` | `ThemeLook \| undefined` | The theme's light look, written here. |
| `path?` | `string \| undefined` | A theme file holding the theme's looks instead, from the package root. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [ThemeLook](/docs/develop/reference/manifest/#type-ThemeLook).

### ThemeAppearance

The looks a theme has, as its `appearance` names them.

```ts
export type ThemeAppearance = Theme['appearance'];
```

Refers to [Theme](/docs/develop/reference/manifest/#type-Theme).

### ThemeColor

A colour: #RGB, #RGBA, #RRGGBB or #RRGGBBAA, or rgb(), rgba(), hsl() or hsla() as CSS writes them, the name in lower case (SPEC.md, section 12, "Colours"). Only border and surface.hover may be translucent.

```ts
export type ThemeColor = string;
```

### ThemeColors

Colour tokens by name (SPEC.md, section 12). What a look leaves out, an app fills in.

| Field | Type | Description |
|---|---|---|
| `background?` | `string \| undefined` | The stage behind every screen: lists, a tab's root, the window. |
| `surface?` | `string \| undefined` | Grouped rows, cards and sheets on the stage, and Android's tab bar. |
| `surface.raised?` | `string \| undefined` | What sits on a surface: menus, popovers, the disc of a pull to refresh. |
| `surface.hover?` | `string \| undefined` | The wash under a pressed or hovered row, and behind secondary controls. It may be translucent. |
| `sidebar?` | `string \| undefined` | The sidebar of the web and desktop apps. |
| `border?` | `string \| undefined` | Hairlines between rows and around cards and fields. It may be translucent. |
| `text?` | `string \| undefined` | Words: titles, rows, body copy. |
| `text.muted?` | `string \| undefined` | The second voice: an artist under a title, a caption. |
| `text.faint?` | `string \| undefined` | Placeholders, chevrons, and captions that repeat what is beside them. |
| `accent?` | `string \| undefined` | The theme's colour in Songstress Red's place: icons, active states, progress, links, the tab bar's tint. |
| `accent.fill?` | `string \| undefined` | A filled accent that carries a label: Play, a primary button, a selected segment, a badge. |
| `accent.fill.pressed?` | `string \| undefined` | A filled accent under a press or the pointer, and the far end of Play's sweep. |
| `accent.onFill?` | `string \| undefined` | The label on a filled accent, at rest and pressed. |
| `success?` | `string \| undefined` | Lossless audio, done, connected. |
| `warning?` | `string \| undefined` | Lossy audio, something to look at. |
| `danger?` | `string \| undefined` | Delete, Sign Out, errors, a menu's destructive items. |
| `info?` | `string \| undefined` | Work in progress: running, importing. |

Refers to [ThemeColor](/docs/develop/reference/manifest/#type-ThemeColor).

### ThemeFile

A theme file, which a theme names by its path: its looks, as the manifest would write them (schema/theme.v1.json).

| Field | Type | Description |
|---|---|---|
| `$schema?` | `string \| undefined` | The address of the theme file's schema, so an editor can check the file as you type. |
| `dark?` | `ThemeLook \| undefined` | The theme's dark look. |
| `light?` | `ThemeLook \| undefined` | The theme's light look. |

Refers to [ThemeLook](/docs/develop/reference/manifest/#type-ThemeLook).

### ThemeFileResult

A theme file that passed, typed; or every problem found in it.

```ts
export type ThemeFileResult = {
    valid: true;
    file: ThemeFile;
    issues: [
    ];
} | {
    valid: false;
    issues: ManifestIssue[];
};
```

Refers to [ThemeFile](/docs/develop/reference/manifest/#type-ThemeFile), [ManifestIssue](/docs/develop/reference/manifest/#type-ManifestIssue).

### ThemeLook

A theme's look, dark or light: its colours, a seed for what they leave out, and the glow behind the stage.

| Field | Type | Description |
|---|---|---|
| `seed?` | `string \| undefined` | One colour the look grows from where it names no other: the accent, with the stage and the text tinted by its hue. |
| `colors?` | `ThemeColors \| undefined` | The look's colour tokens. What it leaves out, an app fills in. |
| `glow?` | `string[] \| undefined` | Up to three colours for the ambient light behind the stage of the web and desktop apps. |

Refers to [ThemeColor](/docs/develop/reference/manifest/#type-ThemeColor), [ThemeColors](/docs/develop/reference/manifest/#type-ThemeColors).

### ThemeToken

A colour token a theme's look may set.

```ts
export type ThemeToken = (typeof THEME_TOKENS)[number];
```

Refers to [THEME_TOKENS](/docs/develop/reference/manifest/#type-THEME_TOKENS).

### Title

A short label, on one line.

```ts
export type Title = string;
```

### UNSAFE_CODE_POINTS

The code points `TEXT_UNSAFE` refuses in a manifest's text, as ranges: Unicode's default ignorable code points, less the joiners, marks and selectors that scripts and emoji need.

```ts
export declare const UNSAFE_CODE_POINTS: readonly (readonly [
    from: number,
    to: number
])[];
```

### ValidateOptions

How a manifest is checked: the profile, and the extension API version of the host that is checking.

| Field | Type | Description |
|---|---|---|
| `profile?` | `ManifestProfile \| undefined` | Left out, "install". |
| `apiVersion?` | `string \| undefined` | The extension API version of the host that is checking. Given, a manifest whose `engines.songstress` leaves it out is refused. |

Refers to [ManifestProfile](/docs/develop/reference/manifest/#type-ManifestProfile).

### Version

A parsed semantic version.

| Field | Type | Description |
|---|---|---|
| `major` | `number` | The major version. |
| `minor` | `number` | The minor version. |
| `patch` | `number` | The patch version. |
| `prerelease` | `readonly string[]` | The prerelease identifiers ("beta", "2"); none for a release. |
| `build` | `string` | The build metadata after "+", which takes no part in ordering. |

### VersionRange

A parsed range: every version from `from` on, before `before` when there
is one; or `from` alone when `exact`.

| Field | Type | Description |
|---|---|---|
| `from` | `Version` | The lowest version the range takes. |
| `before` | `Version \| null` | The version the range stops before, or null for none. |
| `exact` | `boolean` | The range takes one version alone. |

Refers to [Version](/docs/develop/reference/manifest/#type-Version).

### View

A free-form page: the extension's own HTML, opened in a sandboxed frame.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The view's name, and its address. |
| `title` | `string` | The view's heading. |
| `path` | `string` | The HTML file the browser opens, from the package root. |
| `icon?` | `string \| undefined` | The icon of the view's sidebar entry. |
| `sidebar?` | `boolean \| undefined` | Give the view an entry in the sidebar of the web and desktop apps. |

Refers to [LocalId](/docs/develop/reference/manifest/#type-LocalId), [Title](/docs/develop/reference/manifest/#type-Title), [IconName](/docs/develop/reference/songstress/#type-IconName).

### When

A condition on what the app knows (SPEC.md section 10): keys such as platform, admin, signedIn, playing, favorite and setting.<key>, joined with !, &&, || and parentheses, and compared with == and != to 'text', true, false or a number. The item shows only while it holds.

```ts
export type When = string;
```

### compareVersions

-1 when `a` comes before `b`, 1 when after, 0 when they rank the same.

```ts
export declare function compareVersions(a: Version, b: Version): number;
```

| Parameter | Type | Description |
|---|---|---|
| `a` | `Version` | A version. |
| `b` | `Version` | The version to hold it against. |

Returns `number`: -1, 0 or 1, for sorting.

Refers to [Version](/docs/develop/reference/manifest/#type-Version).

### parseManifest

Reads and checks a manifest from its text, or from its bytes as they are
on disk. Prefer the bytes: only they can show a file that is not UTF-8.

```ts
export declare function parseManifest(input: string | Uint8Array, options?: ValidateOptions): ManifestResult;
```

| Parameter | Type | Description |
|---|---|---|
| `input` | `string \| Uint8Array` | The manifest's bytes, or its text. |
| `options?` | `ValidateOptions` | Which checks to run (`profile`), and the API version of the host that is checking (`apiVersion`). |

Returns `ManifestResult`: The manifest when it is valid; else every issue found.

Example:

```ts
import { parseManifest } from 'songstress/manifest'

declare const bytes: Uint8Array // the file's bytes, as read from disk

const result = parseManifest(bytes, { profile: 'install' })
if (result.valid) console.log(result.manifest.id)
else for (const issue of result.issues) console.log(issue.code, issue.pointer, issue.message)
```

Refers to [ValidateOptions](/docs/develop/reference/manifest/#type-ValidateOptions), [ManifestResult](/docs/develop/reference/manifest/#type-ManifestResult).

### parseRange

`text` as a range, or null when the grammar above does not take it.

```ts
export declare function parseRange(text: string): VersionRange | null;
```

| Parameter | Type | Description |
|---|---|---|
| `text` | `string` | A range as a manifest writes it: `^1.2.0`, `~1.2.0`, `>=1.2.0`, `>=1.2.0 <2.0.0` or one exact version. |

Returns `VersionRange | null`: The range, or null.

Refers to [VersionRange](/docs/develop/reference/manifest/#type-VersionRange).

### parseThemeFile

Reads and checks a theme file from its bytes (or its text), for a theme
whose `appearance` is the one given: the file holds exactly the looks that
names. Prefer the bytes: only they can show a file that is not UTF-8.

```ts
export declare function parseThemeFile(input: string | Uint8Array, appearance: ThemeAppearance): ThemeFileResult;
```

| Parameter | Type | Description |
|---|---|---|
| `input` | `string \| Uint8Array` | The theme file's bytes, or its text. |
| `appearance` | `ThemeAppearance` | The `appearance` the manifest gives the theme. |

Returns `ThemeFileResult`: The theme's looks when the file is valid; else every issue found.

Refers to [ThemeAppearance](/docs/develop/reference/manifest/#type-ThemeAppearance), [ThemeFileResult](/docs/develop/reference/manifest/#type-ThemeFileResult).

### parseVersion

`text` as a version, or null when it is not one.

```ts
export declare function parseVersion(text: string): Version | null;
```

| Parameter | Type | Description |
|---|---|---|
| `text` | `string` | A version as `major.minor.patch`. |

Returns `Version | null`: The version, or null.

Refers to [Version](/docs/develop/reference/manifest/#type-Version).

### satisfiesRange

Whether `version` lies inside `range`.

```ts
export declare function satisfiesRange(version: Version, range: VersionRange): boolean;
```

| Parameter | Type | Description |
|---|---|---|
| `version` | `Version` | The version to test. |
| `range` | `VersionRange` | The range, from `parseRange`. |

Returns `boolean`: True when the range takes the version.

Example:

```ts
import { parseRange, parseVersion, satisfiesRange } from 'songstress/manifest'

const range = parseRange('^0.1.0')
const version = parseVersion('0.1.8')
if (range && version) console.log(satisfiesRange(version, range)) // true
```

Refers to [Version](/docs/develop/reference/manifest/#type-Version), [VersionRange](/docs/develop/reference/manifest/#type-VersionRange).

### validateManifest

Checks a manifest that is already a JSON value.

```ts
export declare function validateManifest(value: unknown, options?: ValidateOptions): ManifestResult;
```

| Parameter | Type | Description |
|---|---|---|
| `value` | `unknown` | The parsed manifest. |
| `options?` | `ValidateOptions` | Which checks to run (`profile`), and the API version of the host that is checking (`apiVersion`). |

Returns `ManifestResult`: The manifest when it is valid; else every issue found.

Refers to [ValidateOptions](/docs/develop/reference/manifest/#type-ValidateOptions), [ManifestResult](/docs/develop/reference/manifest/#type-ManifestResult).
