Something went wrong. Try again.
A music player that connects to your cloud/distributed storage. forked from tokono.ma/diffuse
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556import type { ProxiedActions } from "~/common/worker.d.ts";
import type { Track } from "~/definitions/types.d.ts";import type { DiffuseElement } from "~/common/element.js";
/** * Consultation. * * `consult` can be "undetermined" if only a scheme was given * instead of a full URI. */export type Consult = | { supported: false; reason: string } | { supported: true; consult: "undetermined" | boolean };
export type ConsultGrouping = | { available: false; reason: string; scheme: string; uris: string[] } | { available: true; scheme: string; uris: string[] };
export type GroupConsult = Record<string, ConsultGrouping>;
export type InputActions = { artwork(uri: string): Promise<Uint8Array | null>; consult(uriOrScheme: string): Promise<Consult>; detach(args: { fileUriOrScheme: string; tracks: Track[] }): Promise<Track[]>; groupConsult(uris: string[]): Promise<GroupConsult>; list(tracks: Track[]): Promise<Track[]>; resolve(args: { method?: string; uri: string }): Promise<ResolvedUri>;};
export type InputElement = & DiffuseElement & InputSchemeProvider & ProxiedActions<InputActions> & { sources: (tracks: Track[]) => Source[] };
export type InputSchemeProvider = { SCHEME: string };
export type ResolvedUri = undefined | ResolveUriAsUrl | ResolveUriAsStream;
export type ResolveUriAsUrl = { expiresAt: number; url: string;};
export type ResolveUriAsStream = { expiresAt: number; mimeType: string; stream: ReadableStream;
/** Total duration in seconds. */ duration?: number;};
export type Source = { label: string; uri: string };