Skip to Content
Documentation

songstress

Every type of the API that both entries share, as the SDK records it.

The songstress module is what code that runs in either entry imports, and it declares the types every other module shares: the API itself, the library's things, the interface's components, the actions, the providers' answers.

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.

API_PERMISSIONS · API_VERSION · Action · Album · AlbumCard · Artist · ArtistBiography · ArtistCard · ArtistInfoProvider · ArtistPhoto · ArtistQuery · ArtworkProvider · AudioContainer · AudioFacts · Awaitable · BadgeBlock · BannerBlock · Block · ButtonBlock · Card · CatalogAlbum · CatalogAlbumDetail · CatalogArtist · CatalogArtistDetail · CatalogIds · CatalogPlaylist · CatalogPlaylistDetail · CatalogTrack · CatalogType · CheckboxField · ClientApi · ClientCapabilities · ClientCommands · ClientHooks · ClientInfo · ClientUi · CollapsibleBlock · CommandContext · CommandHandler · CommandOutcome · Commands · ConfirmAction · CopyAction · DateField · Destination · DetailScreen · Disposable · DividerBlock · DownloadAvailability · DownloadLocation · DownloadProvider · EmptyState · Favorite · FavoriteEvent · Field · ForUser · FormScreen · FormValues · GridScreen · Host · HostInfo · IconBlock · IconName · ImageBlock · ImageSource · InputAction · InvokeAction · JobHandler · JobRun · Jobs · JsonValue · Library · LibraryChange · LibrarySearchResults · LibraryType · LinkProvider · LinkResult · ListScreen · LookupProvider · LyricsLine · LyricsProvider · LyricsResult · MenuBlock · MenuEntry · MenuLocation · MetadataProvider · NavigateAction · Needs · Net · NetRequest · NetResponse · Notice · NotifyAction · OpenUrlAction · PageRenderer · Pages · PanelContent · PanelContext · PanelRenderer · Panels · PermissionName · PickAction · PickItem · PickerField · Platform · PlayAction · PlayEvent · PlayProvider · Playable · Player · PlayerState · Playlist · PlaylistCard · PlaylistChangeEvent · ProgressBlock · ProviderContext · ProviderFailure · ProviderFailureCode · ProviderGroup · ProviderRegistry · Providers · Queue · QueueAction · QueueState · RecommendProvider · RecommendSeed · RecommendedTrack · RefreshAction · RefreshTarget · RenderContext · RouteHandler · RouteRequest · RouteResponse · Routes · Row · ScanSummary · Screen · ScrobbleEvent · ScrobblePlay · ScrobbleProvider · SearchProvider · SearchQuery · SearchResults · Secrets · SectionBlock · ServerApi · ServerHooks · ServerSettings · ServerStore · ServerUi · SettingChange · SettingValue · Settings · ShareAction · SharedApi · SharedHooks · ShelfBlock · Side · SignInHandler · SignInPage · SignInRegistry · SignInReturn · SignInStart · SignOutRequest · SignedIn · Size · SliderField · Song · SongRow · SongstressError · SongstressErrorCode · SpacerBlock · StackBlock · StatusContent · StatusContext · StatusItems · StatusRenderer · Store · StreamLocation · SwitchField · TextBlock · TextField · ToastAction · Tone · TrackFacts · TrackQuery · TreeNode · TreeScreen · UI_VERSION · Ui · User · Users · songstress

API_PERMISSIONS

Every member of the API by its full name, with the permission its call needs (null for none), for each entry. A host checks grants from this table, and its tests prove each member refuses without its grant. net.fetch is listed under network: a request to a target on the user's own network needs network.local instead.

export declare const API_PERMISSIONS: Readonly<{
    shared: Readonly<Record<string, Needs>>;
    server: Readonly<Record<string, Needs>>;
    client: Readonly<Record<string, Needs>>;
}>;

Refers to Needs.

API_VERSION

The version of the extension API this package describes: the version a manifest's engines.songstress is held against. It is the package's own version (a test holds the two together), and it moves whenever the public surface does (api/surface.txt).

export declare const API_VERSION = "0.1.8";

Action

What a tap, a button or a command's answer does: one of the actions, by its type.

export type Action = InvokeAction | NavigateAction | PlayAction | QueueAction | OpenUrlAction | CopyAction | ShareAction | ToastAction | ConfirmAction | RefreshAction | PickAction | InputAction | NotifyAction;

Refers to InvokeAction, NavigateAction, PlayAction, QueueAction, OpenUrlAction, CopyAction, ShareAction, ToastAction, ConfirmAction, RefreshAction, PickAction, InputAction, NotifyAction.

Album

An album of the library.

Prop

Type

AlbumCard

An album of the library, drawn as Songstress draws it, with its own menu.

Prop

Type

Artist

An artist of the library.

Prop

Type

ArtistBiography

Who an artist is, in a source's words.

Prop

Type

ArtistCard

An artist of the library, drawn as Songstress draws them, with their own menu.

Prop

Type

ArtistInfoProvider

Words about an artist. Implement the method for each thing the manifest lists under supports. Both are asked by the server for itself, never for one member.

Prop

Type

Refers to ArtistQuery, ProviderContext, Awaitable, ArtistBiography, CatalogArtist.

ArtistPhoto

One photo in up to three sizes, as addresses.

Prop

Type

ArtistQuery

An artist Songstress wants a photo of, or words about, with what the library holds under the name: the evidence that tells them from a namesake.

Prop

Type

Refers to CatalogIds.

ArtworkProvider

Pictures. Implement the method for each kind the manifest lists under supports.

Prop

Type

Refers to ArtistQuery, ProviderContext, Awaitable, ArtistPhoto.

AudioContainer

The file formats Songstress can serve.

export type AudioContainer = 'flac' | 'm4a' | 'mp3' | 'ogg' | 'opus' | 'webm' | 'wav';

AudioFacts

What a source says about the audio it would hand out for a track.

Prop

Type

Awaitable

A value, or a promise of it: a handler may answer either way.

export type Awaitable<Value> = Value | Promise<Value>;

BadgeBlock

A short word in a pill.

Prop

Type

Refers to Tone.

BannerBlock

A notice across the page.

Prop

Type

Refers to Action.

Block

What a detail screen, a section and a panel are built from.

export type Block = StackBlock | SectionBlock | TextBlock | IconBlock | ImageBlock | BadgeBlock | ProgressBlock | BannerBlock | DividerBlock | SpacerBlock | CollapsibleBlock | ButtonBlock | MenuBlock | ShelfBlock | SongRow | AlbumCard | ArtistCard | PlaylistCard;

Refers to StackBlock, SectionBlock, TextBlock, IconBlock, ImageBlock, BadgeBlock, ProgressBlock, BannerBlock, DividerBlock, SpacerBlock, CollapsibleBlock, ButtonBlock, MenuBlock, ShelfBlock, SongRow, AlbumCard, ArtistCard, PlaylistCard.

ButtonBlock

A button that does an action.

Prop

Type

Refers to Action, IconName.

Card

A card of a grid or a shelf.

Prop

Type

Refers to ImageSource, Action, MenuEntry.

CatalogAlbum

An album of a source's catalogue, as a search or a link finds it.

Prop

Type

Refers to CatalogIds.

CatalogAlbumDetail

An album of a source's catalogue, opened: with its tracks.

Prop

Type

Refers to CatalogAlbum, CatalogTrack.

CatalogArtist

An artist of a source's catalogue, as a search or a link finds them.

Prop

Type

Refers to CatalogIds.

CatalogArtistDetail

An artist of a source's catalogue, opened: with their albums and top tracks.

Prop

Type

Refers to CatalogArtist, CatalogAlbum, CatalogTrack.

CatalogIds

The ids a thing has in Songstress's own catalogues, when the source knows them: they let Songstress see that two sources mean the same thing.

export type CatalogIds = Partial<Record<ProviderGroup, string>>;

Refers to ProviderGroup.

CatalogPlaylist

A playlist of a source's catalogue, as a search or a link finds it.

Prop

Type

CatalogPlaylistDetail

A playlist of a source's catalogue, opened: with its tracks.

Prop

Type

Refers to CatalogPlaylist, CatalogTrack.

CatalogTrack

A track as a source lists it. id is the source's own.

Prop

Type

Refers to CatalogIds, AudioFacts.

CatalogType

A kind of thing a source lists.

export type CatalogType = "track" | "album" | "artist" | "playlist";

CheckboxField

A form's checkbox: true or false.

Prop

Type

ClientApi

The API of the client entry: code that runs inside one app, in a sandbox, for the member signed in there, while the app is open.

Prop

Type

Refers to SharedApi, ClientHooks, ClientCommands, ClientUi, Player, Queue.

ClientCapabilities

What an app can show or run of an extension.

Prop

Type

ClientCommands

Commands as client code has them: it may also run one.

Prop

Type

Refers to Commands.

ClientHooks

The hooks of the client entry. They follow the player of the one device the code runs on, live, while its app is open and in front: client code is stopped in the background and told the current state when it comes back. All but onVolumeChange need the permission listening.read.

Prop

Type

Refers to SharedHooks, Song, PlayerState, Awaitable, Disposable, QueueState.

ClientInfo

An app that draws an extension's interface or runs its client code.

Prop

Type

Refers to Platform, ClientCapabilities.

ClientUi

Declared interface as client code has it: the same, in its own app.

Prop

Type

Refers to Ui, Notice, RefreshTarget.

CollapsibleBlock

Blocks a tap opens and closes.

Prop

Type

Refers to Block.

CommandContext

What a command's handler is told beside its input.

Prop

Type

Refers to MenuLocation, ClientInfo, FormValues.

CommandHandler

A command's handler. input is what the command was run on: the song, album, artist or playlist whose menu it was picked from, or the input of the action, the form or the call that ran it.

export type CommandHandler<Input = unknown> = (input: Input, context: CommandContext) => Awaitable<CommandOutcome | void>;

Refers to CommandContext, Awaitable, CommandOutcome.

CommandOutcome

What a command leaves behind. Both parts are optional.

Prop

Type

Refers to Action.

Commands

Commands: the named actions of the manifest's contributes.commands. Both sides; no permission.

Prop

Type

Refers to CommandHandler, Disposable.

ConfirmAction

Asks first, then does action when the person agrees.

Prop

Type

Refers to Action.

CopyAction

Copies text to the clipboard.

Prop

Type

DateField

A form's date picker.

Prop

Type

Destination

Where a tap can lead: a page or a view of the extension's own, or Songstress's page for something in the library.

export type Destination = {
    page: string;
    params?: Record<string, string>;
} | {
    view: string;
    params?: Record<string, string>;
} | {
    library: LibraryType;
    id: string;
};

Refers to LibraryType.

DetailScreen

A page of blocks, read from top to bottom.

Prop

Type

Refers to Block.

Disposable

Something that can be taken back: a listener, a handler, a provider. dispose() removes it; calling it again does nothing. Everything an extension registers is removed for it when the extension is stopped.

Prop

Type

DividerBlock

A line between blocks.

Prop

Type

DownloadAvailability

Whether the source has a song, and under which id of its own.

Prop

Type

DownloadLocation

Where a download's audio is: one file, or segments in order (with the part that opens them, when the format has one). Songstress fetches them, joins segments into one file of container, and verifies the result before anything keeps it.

export type DownloadLocation = (StreamLocation & {
    kind: 'file';
}) | {
    kind: 'segments';
    urls: string[];
    initUrl?: string;
    headers?: Record<string, string>;
    container: AudioContainer;
};

Refers to StreamLocation, AudioContainer.

DownloadProvider

A source songs can be acquired from. Off until the admin adds it and turns it on.

Prop

Type

Refers to TrackQuery, ProviderContext, Awaitable, DownloadAvailability, DownloadLocation, TrackFacts.

EmptyState

What a list or a grid shows when it has nothing to show.

Prop

Type

Refers to IconName, Action.

Favorite

What a member marked as a favourite, or no longer does.

export type Favorite = {
    type: 'song';
    song: Song;
} | {
    type: 'album';
    album: Album;
} | {
    type: 'artist';
    artist: Artist;
};

Refers to Song, Album, Artist.

FavoriteEvent

What onFavorite is told: a member marked a song, an album or an artist as a favourite, or took the mark away.

Prop

Type

Field

One field of a form: what a form screen's sections hold.

export type Field = TextField | SwitchField | CheckboxField | SliderField | PickerField | DateField;

Refers to TextField, SwitchField, CheckboxField, SliderField, PickerField, DateField.

ForUser

One member, for a call that concerns them.

Prop

Type

FormScreen

A page of fields and one button that submits them.

Prop

Type

Refers to Field.

FormValues

What a form's fields hold when it is submitted, by field name.

export type FormValues = Record<string, string | number | boolean>;

GridScreen

A page of cards.

Prop

Type

Refers to Card, AlbumCard, ArtistCard, PlaylistCard, EmptyState.

Host

Asking the host about itself. Both sides; no permission.

Prop

Type

Refers to HostInfo.

HostInfo

Where the code is running.

Prop

Type

Refers to Side, ClientInfo.

IconBlock

An icon from Songstress's icon set.

Prop

Type

Refers to IconName, Tone.

IconName

A name from Songstress's icon set. A name an app does not know is drawn as the extension mark.

export type IconName = string;

ImageBlock

A picture: a cover from the library, or an address the app fetches through the server.

Prop

Type

Refers to ImageSource.

ImageSource

A picture: the cover of something in the library, or an image on the web, which the app fetches through the server and never from the device.

export type ImageSource = {
    cover: LibraryType;
    id: string;
} | {
    url: string;
};

Refers to LibraryType.

InputAction

Asks the person for a line of text, then runs a command with it. Never a password: a secret is a setting. Nothing runs when they close it.

Prop

Type

InvokeAction

Runs one of the extension's commands, handing it input (JSON).

Prop

Type

JobHandler

Does one run. A run has a deadline of the host's: do a slice, keep where you are in storage, and let the next run go on. Throwing marks the run as failed, with the error's message.

export type JobHandler = (run: JobRun) => Awaitable<void>;

Refers to JobRun, Awaitable.

JobRun

One run of a job.

Prop

Type

Refers to JsonValue.

Jobs

Jobs (the manifest's contributes.jobs), each shown in Activity while it runs. Server entry; permission jobs.

Prop

Type

Refers to JobHandler, Disposable.

JsonValue

What crosses between an extension and Songstress: JSON, and nothing else. No function, no date object, no binary value survives the crossing.

What Songstress hands to an extension is typed as this. What an extension hands to Songstress (a value to store, a route's answer, a command's input) is typed unknown, because TypeScript cannot tell that an interface of yours is JSON: it must be all the same, and a value that is not is refused with the code "invalid".

export type JsonValue = string | number | boolean | null | JsonValue[] | {
    [key: string]: JsonValue;
};

Library

Reading the library. Server entry; permission library.read.

Prop

Type

Refers to Song, Album, Artist, Playlist, LibraryType, LibrarySearchResults.

LibraryChange

Songs that came into the library, changed or left it, by id. A large change arrives as several calls.

Prop

Type

LibrarySearchResults

What a library search found.

Prop

Type

Refers to Song, Album, Artist.

LibraryType

A kind of thing the library holds.

export type LibraryType = 'song' | 'album' | 'artist' | 'playlist';

LinkProvider

Reads a link one of the manifest's patterns claimed: a pasted address, or a playlist a member follows. Null when it leads nowhere.

Prop

Type

Refers to ProviderContext, Awaitable, LinkResult.

LinkResult

What a link turned out to be.

export type LinkResult = {
    type: 'track';
    track: CatalogTrack;
} | {
    type: 'album';
    album: CatalogAlbumDetail;
} | {
    type: 'artist';
    artist: CatalogArtistDetail;
} | {
    type: 'playlist';
    playlist: CatalogPlaylistDetail;
};

Refers to CatalogTrack, CatalogAlbumDetail, CatalogArtistDetail, CatalogPlaylistDetail.

ListScreen

A page of rows.

Prop

Type

Refers to Row, SongRow, EmptyState.

LookupProvider

Opens one thing by the source's own id. Implement a method for each kind the manifest lists under types. Null when the source has no such thing.

Prop

Type

Refers to ProviderContext, Awaitable, CatalogTrack, CatalogAlbumDetail, CatalogArtistDetail, CatalogPlaylistDetail.

LyricsLine

One line of lyrics.

Prop

Type

LyricsProvider

Finds a song's lyrics. Asked by the server's nightly library pass, never while a song plays, within 10 seconds, once an admin adds the source to the lyrics order. The pass asks the whole order about every track without synced lyrics, those with plain ones too, since Songstress's own sources may match exactly enough to replace them; this answer is used for a track with no lyrics at all, and never replaces lyrics a track has. The track is asked again only after a rest (SPEC.md, section 11).

Prop

Type

Refers to TrackQuery, ProviderContext, Awaitable, LyricsResult.

LyricsResult

- found: the lines, synced when each carries its time; at most 2000 are kept, synced is worked out again from them, and no lines is none - instrumental: the source says the song has no words - none: the source does not have them

export type LyricsResult = {
    status: 'found';
    synced: boolean;
    lines: LyricsLine[];
} | {
    status: 'instrumental';
} | {
    status: 'none';
};

Refers to LyricsLine.

MenuBlock

A button that opens a menu.

Prop

Type

Refers to IconName, MenuEntry.

MenuEntry

One entry of a menu.

Prop

Type

Refers to IconName, Action.

MenuLocation

A place a menu item can appear, as contributes.menus keys it.

export type MenuLocation = keyof Menus;

Refers to Menus.

MetadataProvider

Facts about artists, releases and tracks. Implement the three discography methods when the manifest's supports lists "discography" (artists are named by the source's own id, or by the id of the group the provider joined), and enrich when it lists "enrich".

Prop

Type

Refers to ProviderContext, Awaitable, CatalogAlbum, CatalogTrack, TrackQuery, TrackFacts.

NavigateAction

Opens one of the extension's pages or views, or Songstress's own page for something in the library: as a page, or as a sheet.

Prop

Type

Refers to Destination.

Needs

The permission a member's call needs; null when it needs none.

export type Needs = PermissionName | null;

Refers to PermissionName.

Net

The network. There is no global fetch: this is the only way out, and it goes where the manifest's network permission names hosts and nowhere else. Server code may also reach the user's own network, the targets of network.local; client code never does: from an app, a request goes to the public hosts network names alone, which the server's host holds it to. The address a name resolves to is checked when connecting and on every redirect, and an answer larger than the host allows is refused.

Prop

Type

Refers to NetRequest, NetResponse.

NetRequest

A request, as plain data.

Prop

Type

NetResponse

An answer, as plain data.

Prop

Type

Notice

A notice: what an extension has to tell, with up to two things to do about it. It stays until the person closes it or picks one.

Prop

Type

Refers to Action.

NotifyAction

Shows a notice (toast is the message that goes away by itself).

Prop

Type

Refers to Notice.

OpenUrlAction

Opens an http or https address in the browser.

Prop

Type

PageRenderer

Builds a page's screen. Registered with songstress.ui.pages.register.

export type PageRenderer = (context: RenderContext) => Awaitable<Screen>;

Refers to RenderContext, Awaitable, Screen.

Pages

Renderers for the manifest's contributes.pages, each registered in the entry its page names in render.

Prop

Type

Refers to PageRenderer, Disposable.

PanelContent

What a panel shows inside one of Songstress's own screens.

Prop

Type

Refers to Block.

PanelContext

What a panel's renderer is told: who looks, and what the screen shows. The song, artist or album is handed over whole to an extension granted library.read, and left out for any other.

Prop

Type

Refers to ClientInfo, Song, Artist, Album, Playlist.

PanelRenderer

Null when the panel has nothing to show here: it is then left out.

export type PanelRenderer = (context: PanelContext) => Awaitable<PanelContent | null>;

Refers to PanelContext, Awaitable, PanelContent.

Panels

Renderers for the manifest's contributes.panels.

Prop

Type

Refers to PanelRenderer, Disposable.

PermissionName

A permission's name, as the manifest's permissions keys it.

export type PermissionName = keyof Permissions;

Refers to Permissions.

PickAction

Asks the person to choose, with Songstress's own picker (a search field over a long list), then runs a command with what they chose. Nothing runs when they choose nothing and close it.

Prop

Type

Refers to PickItem.

PickItem

One choice of a pick.

Prop

Type

Refers to IconName, ImageSource.

PickerField

A form's choice of one option from a list.

Prop

Type

Platform

A Songstress app: the web app, the desktop app, the iPhone and iPad app, the Android app.

export type Platform = "web" | "desktop" | "ios" | "android";

PlayAction

Plays now, as a tap on a song does.

Prop

Type

Refers to Playable.

PlayEvent

A play as the server heard of it.

Prop

Type

PlayProvider

Plays what the search provider of the same id found. Off until the admin turns it on. One progressive file only: never a playlist of segments.

Prop

Type

Refers to CatalogTrack, ProviderContext, Awaitable, StreamLocation.

Playable

Something to play: songs by id, or everything of an album, an artist or a playlist.

export type Playable = {
    songIds: string[];
} | {
    albumId: string;
} | {
    artistId: string;
} | {
    playlistId: string;
};

Player

The player of the device the code runs on. Client entry. Reading needs the permission listening.read; the rest needs player.control.

Prop

Type

Refers to PlayerState.

PlayerState

This device's player at one moment.

Prop

Type

Refers to Song.

Playlist

A playlist.

Prop

Type

PlaylistCard

A playlist of the library, drawn as Songstress draws it.

Prop

Type

PlaylistChangeEvent

What onPlaylistChange is told: a public playlist was created, changed or deleted.

Prop

Type

ProgressBlock

A bar that shows how far something has got.

Prop

Type

ProviderContext

What every provider call is told.

Prop

Type

ProviderFailure

A failure Songstress knows what to do about. The message is for the server's log and the admin: never put a token or a signed address in it.

export declare class ProviderFailure extends Error {
    readonly name = "ProviderFailure";
    readonly code: ProviderFailureCode;
    readonly retryAfterS?: number;
    constructor(code: ProviderFailureCode, options?: {
        message?: string;
        retryAfterS?: number;
    });
}

Refers to ProviderFailureCode.

ProviderFailureCode

- rate-limited: the source asks to slow down; Songstress waits retryAfterS - sign-in-required: the source wants a sign-in the settings do not hold, or no longer accept - not-configured: a setting the provider needs is empty - unavailable: the source is down, or refuses this request for now

export type ProviderFailureCode = 'rate-limited' | 'sign-in-required' | 'not-configured' | 'unavailable';

ProviderGroup

One of Songstress's own catalogues. A source that reads the same catalogue joins its group and speaks its ids.

export type ProviderGroup = "musicbrainz" | "spotify" | "deezer" | "tidal" | "itunes" | "ytmusic";

ProviderRegistry

Where providers of one kind are registered.

Prop

Type

Refers to Disposable.

Providers

The provider kinds. Server entry; permission providers (and for a scrobble provider listening.read too).

Prop

Type

Refers to ProviderRegistry, SearchProvider, LookupProvider, LinkProvider, LyricsProvider, MetadataProvider, ArtworkProvider, ArtistInfoProvider, ScrobbleProvider, RecommendProvider, PlayProvider, DownloadProvider.

Queue

The queue of the device the code runs on. Client entry.

Prop

Type

Refers to QueueState.

QueueAction

Adds to the queue: at its end, or right after the current song. What is playing is never touched.

Prop

Type

Refers to Playable.

QueueState

This device's queue.

Prop

Type

Refers to Song.

RecommendProvider

Recommendations, best first. Implement the method for each mode the manifest lists under modes. Empty when the source has nothing for the seed.

Prop

Type

Refers to RecommendSeed, ProviderContext, Awaitable, RecommendedTrack.

RecommendSeed

A song or an artist to recommend from. Any field may be missing: use what the source understands.

Prop

Type

RecommendedTrack

A recommended track, by what it is called: Songstress matches it to the library, filters it and caches it.

Prop

Type

Refers to CatalogIds.

RefreshAction

Renders the page, panel or status item it came from again.

Prop

Type

RefreshTarget

What to render again: one of the extension's pages, panels or status items, by its id.

export type RefreshTarget = {
    page: string;
} | {
    panel: string;
} | {
    status: string;
};

RenderContext

What a page's renderer is told.

Prop

Type

Refers to ClientInfo.

RouteHandler

Answers one of the extension's declared routes. Registered with songstress.routes.register.

export type RouteHandler = (request: RouteRequest) => Awaitable<RouteResponse>;

Refers to RouteRequest, Awaitable, RouteResponse.

RouteRequest

A request to one of the extension's routes.

Prop

Type

Refers to JsonValue.

RouteResponse

What a route answers: JSON, and nothing else.

Prop

Type

Routes

Routes (the manifest's contributes.routes), served under a prefix that belongs to the extension. Server entry; permission routes.

Prop

Type

Refers to RouteHandler, Disposable.

Row

A row of a list.

Prop

Type

Refers to IconName, ImageSource, BadgeBlock, Action, MenuEntry.

ScanSummary

A finished scan of the library.

Prop

Type

Screen

What a page is: a list, a grid, a tree, a detail or a form, by its type.

export type Screen = ListScreen | GridScreen | DetailScreen | FormScreen | TreeScreen;

Refers to ListScreen, GridScreen, DetailScreen, FormScreen, TreeScreen.

ScrobbleEvent

A play that counted.

Prop

Type

ScrobblePlay

One play to report.

Prop

Type

Refers to Song.

ScrobbleProvider

A service plays are reported to, for each member who connected it. A play that fails with rate-limited or unavailable is tried again later; sign-in-required asks the member to connect again. It is handed members' plays, so it needs the permission listening.read beside providers, and hears only the members who granted it.

Prop

Type

Refers to ScrobblePlay, ProviderContext, Awaitable.

SearchProvider

Answers a search.

Prop

Type

Refers to SearchQuery, ProviderContext, Awaitable, SearchResults.

SearchQuery

What a search asks a source.

Prop

Type

Refers to CatalogType.

SearchResults

What a source found, for each kind asked. Leave out a kind it found nothing of.

Prop

Type

Refers to CatalogTrack, CatalogAlbum, CatalogArtist, CatalogPlaylist.

Secrets

The extension's own credentials: tokens it was handed, kept sealed, never sent to an app and never shown again. Server entry; permission secrets. For a key a person types, declare a setting of type "secret" instead.

Prop

Type

Refers to ForUser.

SectionBlock

Blocks under a heading.

Prop

Type

Refers to Block.

ServerApi

The API of the server entry: code that runs on the user's own server, in a sandbox, for every member and every app.

Prop

Type

Refers to SharedApi, ServerHooks, ServerUi, ServerSettings, ServerStore, Secrets, Providers, Jobs, Routes, SignInRegistry, Library, Users.

ServerHooks

The hooks of the server entry. They see every app of every member who granted the extension their listening, phones included.

Prop

Type

Refers to SharedHooks, Song, PlayEvent, Awaitable, Disposable, ScrobbleEvent, Favorite, FavoriteEvent, Playlist, PlaylistChangeEvent, LibraryChange, ScanSummary.

ServerSettings

The settings as the server entry reads them: settings of scope "server", secrets included, and with { userId } one member's settings of scope "user". A device's settings stay on the device.

Prop

Type

Refers to Settings, SettingValue, ForUser.

ServerStore

The store as the server entry uses it: one part for the extension as a whole, and with { userId } one part for each member, which is the part code in that member's apps sees. A sandbox is started and stopped as needed: what must last goes here, not in a variable.

Prop

Type

Refers to Store, ForUser.

ServerUi

Declared interface as the server entry has it: it may also tell a member something, or have their apps render something again, while they are open. Nothing is kept for an app that is closed.

Prop

Type

Refers to Ui, Notice, ForUser, RefreshTarget.

SettingChange

What settings.onChange is told: a setting changed.

Prop

Type

Refers to SettingValue.

SettingValue

What a setting holds. A select holds the value of its option, a secret holds text.

export type SettingValue = string | number | boolean;

Settings

The extension's settings (the manifest's contributes.settings), as code in an app reads them: the server's, this member's and this device's. No permission.

Prop

Type

Refers to SettingValue, SettingChange, Awaitable, Disposable.

ShareAction

Opens the device's share sheet.

Prop

Type

SharedApi

What both entries have.

Prop

Type

Refers to SharedHooks, Commands, Ui, Settings, Store, Net, Host.

SharedHooks

The one hook both entries have, as code that runs on either side may use it. Each entry's own hooks say more about the moment.

Prop

Type

Refers to Song, Awaitable, Disposable.

ShelfBlock

A row of cards that scrolls sideways, under a heading.

Prop

Type

Refers to Card, SongRow, AlbumCard, ArtistCard, PlaylistCard.

Side

Where code runs: in the server entry or in the client entry.

export type Side = "server" | "client";

SignInHandler

The two halves of a sign-in, and its end. A half that cannot be done throws a ProviderFailure; anything else thrown counts as broken.

Prop

Type

Refers to SignInStart, Awaitable, SignInPage, SignInReturn, SignedIn, SignOutRequest.

SignInPage

Where the person signs in.

Prop

Type

SignInRegistry

The sign-in the manifest declares. Server entry; permission secrets.

Prop

Type

Refers to SignInHandler, Disposable.

SignInReturn

What finish is handed.

Prop

Type

SignInStart

What start is handed.

Prop

Type

SignOutRequest

What signOut is handed: whose account ends.

Prop

Type

SignedIn

The account now signed in.

Prop

Type

Size

A step of space.

export type Size = 'small' | 'medium' | 'large';

SliderField

A form's slider over a range of numbers.

Prop

Type

Song

A song of the library.

Prop

Type

SongRow

A song of the library, drawn as Songstress draws it, with its own menu.

Prop

Type

SongstressError

The error every call to the API rejects or throws with.

export declare class SongstressError extends Error {
    readonly name = "SongstressError";
    readonly code: SongstressErrorCode;
    constructor(code: SongstressErrorCode, message: string);
}

Refers to SongstressErrorCode.

SongstressErrorCode

Why a call to the API failed. - no-host: the code is not running inside Songstress (a test with no mock host) - permission-denied: the manifest did not ask for it, or nobody granted it - not-available: this side, this app or this build cannot do it - limit-exceeded: a quota, a size, a rate or a deadline was passed - invalid: an argument is wrong, or names something that does not exist - failed: anything else; the message says what

export type SongstressErrorCode = 'no-host' | 'permission-denied' | 'not-available' | 'limit-exceeded' | 'invalid' | 'failed';

SpacerBlock

Room between blocks.

Prop

Type

Refers to Size.

StackBlock

Blocks beside or under one another.

Prop

Type

Refers to Size, Block.

StatusContent

What a status item shows in the player: an icon and a few words, the extension's own state at a glance.

Prop

Type

Refers to IconName, Tone, Action.

StatusContext

What a status item's renderer is told: who looks, and the song playing, whole to an extension granted library.read.

Prop

Type

Refers to ClientInfo, Song.

StatusItems

Renderers for the manifest's contributes.status. A status item is rendered when the player shows it, when the song changes, and when it is refreshed.

Prop

Type

Refers to StatusRenderer, Disposable.

StatusRenderer

Null when the status item has nothing to say now: it is then left out.

export type StatusRenderer = (context: StatusContext) => Awaitable<StatusContent | null>;

Refers to StatusContext, Awaitable, StatusContent.

Store

The extension's own store, as code in an app uses it: the signed-in member's part of it. Small JSON values under text keys, under a quota. Permission storage.

Prop

Type

StreamLocation

Where one whole audio file is.

Prop

Type

Refers to AudioContainer.

SwitchField

A form's switch: on or off.

Prop

Type

TextBlock

Words, in one of four styles.

Prop

Type

Refers to Tone.

TextField

A form's text field.

Prop

Type

ToastAction

Shows a short message that goes away by itself.

Prop

Type

Tone

Colour by what it means; the theme decides what it looks like.

export type Tone = 'default' | 'muted' | 'accent' | 'success' | 'warning' | 'danger' | 'info';

TrackFacts

Facts a source can add to a track that lacks them.

Prop

Type

Refers to CatalogIds.

TrackQuery

A song Songstress wants something for: what its tags say.

Prop

Type

Refers to CatalogIds.

TreeNode

A node of a tree: a row that may hold rows of its own.

Prop

Type

Refers to IconName, ImageSource, BadgeBlock, Action, MenuEntry, SongRow.

TreeScreen

A page of nodes in a tree: folders, groups, anything that holds more of itself. The web and desktop apps open a node in place; the phones open it as a page of its own, titled with the node's title.

Prop

Type

Refers to TreeNode, SongRow, EmptyState.

UI_VERSION

The version of the component vocabulary (ui.ts) this package describes. An app says which version it draws in ClientInfo.ui. Version 2 added the tree screen, status items, and the pick, input and notify actions.

export declare const UI_VERSION = 2;

Ui

Declared interface. Both sides; no permission.

Prop

Type

Refers to Pages, Panels, StatusItems.

User

A member of the server: an id and the name they show.

Prop

Type

Users

Reading who the members are. Server entry; permission users.read.

Prop

Type

Refers to User.

songstress

The API code that runs in either entry imports: import { songstress } from 'songstress'.

export declare const sharedApi: SharedApi;

Refers to SharedApi.