/** * OnSong import URL payload definition. */ export type OnSongImportUrlPayload = { /** * HTTP URL to a supported file format. OnSong's official import URL scheme * replaces the `http://` component with `onsong://`. */ url: string; }; /** * OnSong import data payload definition. */ export type OnSongImportDataPayload = { /** * File name with extension. OnSong uses the extension to determine how to * treat the file. */ filename: string; /** * Base64-encoded file data. */ base64Data: string; }; /** * OnSong song viewer navigation index value. */ export type OnSongSongsIndex = 'first' | 'last' | 'next' | 'previous' | number; /** * OnSong open songs payload fields. */ export type OnSongOpenSongsReference = { /** * Song title, song identifier, or ordered song list. Arrays are serialized as * repeated `song` query parameters. */ song: string | string[]; /** * Song viewer position to navigate to. */ index?: OnSongSongsIndex; /** * Set name/identifier to load or create with the supplied song list. */ set?: string; collection?: never; } | { /** * Collection or book name/identifier to load in the song viewer. */ collection: string; song?: never; set?: never; index?: never; } | { /** * Set name/identifier to load. */ set: string; song?: never; collection?: never; index?: never; } | { /** * Song viewer position to navigate to. */ index: OnSongSongsIndex; song?: never; collection?: never; set?: never; }; /** * OnSong open songs payload definition. */ export type OnSongOpenSongsPayload = OnSongOpenSongsReference; /** * OnSong open song payload definition. */ export type OnSongOpenSongPayload = { /** * Song title or song identifier. */ song: string; }; /** * OnSong export songs payload fields. */ export type OnSongExportSongsReference = { /** * Song title or song identifier to export. */ song: string; set?: never; collection?: never; } | { /** * Set name/identifier to export. */ set: string; song?: never; collection?: never; } | { /** * Collection or book name/identifier to export. */ collection: string; song?: never; set?: never; }; /** * OnSong export songs payload definition. */ export type OnSongExportSongsPayload = OnSongExportSongsReference & { /** * Callback URL prefix where OnSong appends the Base64-encoded export data. */ returnURL: string; }; /** * OnSong list actions payload definition. */ export type OnSongListActionsPayload = { /** * Callback URL prefix where OnSong appends the Base64-encoded JSON action list. */ returnURL?: string; }; export type OnSongActionParameterValue = string | number; /** * OnSong perform action payload definition. */ export type OnSongPerformActionPayload = { /** * Action value returned by OnSong's action list API. */ action: string; /** * Amount parameter for variable actions. */ amount?: number; /** * Action-specific parameters documented by OnSong's action list output. */ parameters?: Record; }; export declare function onSongUrl(path?: string, params?: Record): string; export declare function onSongImportUrl(payload: OnSongImportUrlPayload): string; export declare function onSongImportDataUrl(payload: OnSongImportDataPayload): string; export declare function onSongOpenSongsParams(payload: OnSongOpenSongsPayload): { set?: string | undefined; index?: OnSongSongsIndex | undefined; collection?: string | undefined; song?: string | string[] | undefined; }; export declare function onSongOpenSongsPath(payload: OnSongOpenSongsPayload): "open/songs/" | "open/songs"; export declare function onSongExportSongsParams(payload: OnSongExportSongsPayload): { returnURL: string; collection?: string | undefined; set?: string | undefined; song?: string | undefined; }; export declare function assertOnSongOpenSongsPayload(payload: OnSongOpenSongsPayload): void; export declare function assertOnSongExportSongsPayload(payload: OnSongExportSongsPayload): void;