Skip to content

Instantly share code, notes, and snippets.

@gordielachance
Last active March 31, 2023 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gordielachance/33d7f6759dbc4a47d2bc21f99431ad25 to your computer and use it in GitHub Desktop.
Save gordielachance/33d7f6759dbc4a47d2bc21f99431ad25 to your computer and use it in GitHub Desktop.
typescript JSPF tests
//
https://github.com/metabrainz/listenbrainz-server/blob/cdc4df46738402d7d003acf08febfe7c7cf2fe4f/frontend/js/src/utils/types.d.ts
export type URI = string;
export type URICollection = URI[];
export type JSPFAttribution = Record<string,URI>;
export type JSPFAttributionCollection = JSPFAttribution[];
export type JSPFLink = Record<URI,URI>;
export type JSPFLinkCollection = JSPFLink[];
export type JSPFMeta = Record<URI,any>;
export type JSPFMetaCollection = JSPFMeta[];
export type JSPFExtension = Record<URI,any>;
export type JSPFTrack{
location?: URICollection,
identifier?: URICollection,
title?: string,
creator?: string,
annotation?: string,
info?: URI,
image?: URI,
album?: URI,
trackNum?: number,/*should be a non-negative integer*/
duration?: number,/*should be a non-negative integer*/
link?: JSPFLinkCollection,
meta?: JSPFMetaCollection,
extension?: JSPFExtension
};
export type JSPFTrackCollection = JSPFTrack[];
export type JSPFPlaylist{
title?: string,
creator?: string,
annotation?: string,
info?: URI,
location?: URI,
identifier?: URI,
image?: URI,
date?: Date, /*DateTimeIso8601String*/,
license?: URI,
attribution?: JSPFAttributionCollection,
link?: JSPFLinkCollection,
meta?: JSPFMetaCollection,
extension?: JSPFExtension,
track?: JSPFTrack[]
};
export type JSPFObject = {
playlist: JSPFPlaylist
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment