A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4 55 lines 1.6 kB view raw
1import type { ProxiedActions } from "~/common/worker.d.ts"; 2 3import type { Track } from "~/definitions/types.d.ts"; 4import type { DiffuseElement } from "~/common/element.js"; 5 6/** 7 * Consultation. 8 * 9 * `consult` can be "undetermined" if only a scheme was given 10 * instead of a full URI. 11 */ 12export type Consult = 13 | { supported: false; reason: string } 14 | { supported: true; consult: "undetermined" | boolean }; 15 16export type ConsultGrouping = 17 | { available: false; reason: string; scheme: string; uris: string[] } 18 | { available: true; scheme: string; uris: string[] }; 19 20export type GroupConsult = Record<string, ConsultGrouping>; 21 22export type InputActions = { 23 artwork(uri: string): Promise<Uint8Array | null>; 24 consult(uriOrScheme: string): Promise<Consult>; 25 detach(args: { fileUriOrScheme: string; tracks: Track[] }): Promise<Track[]>; 26 groupConsult(uris: string[]): Promise<GroupConsult>; 27 list(tracks: Track[]): Promise<Track[]>; 28 resolve(args: { method?: string; uri: string }): Promise<ResolvedUri>; 29}; 30 31export type InputElement = 32 & DiffuseElement 33 & InputSchemeProvider 34 & ProxiedActions<InputActions> 35 & { sources: (tracks: Track[]) => Source[] }; 36 37export type InputSchemeProvider = { SCHEME: string }; 38 39export type ResolvedUri = undefined | ResolveUriAsUrl | ResolveUriAsStream; 40 41export type ResolveUriAsUrl = { 42 expiresAt: number; 43 url: string; 44}; 45 46export type ResolveUriAsStream = { 47 expiresAt: number; 48 mimeType: string; 49 stream: ReadableStream; 50 51 /** Total duration in seconds. */ 52 duration?: number; 53}; 54 55export type Source = { label: string; uri: string };