beatprints.js
Version:
A Node.js version of the original Python BeatPrints project (https://github.com/TrueMyst/BeatPrints/) by TrueMyst. Create eye-catching, Pinterest-style music posters effortlessly. BeatPrints integrates with Spotify and LRClib API to help you design custom
25 lines (24 loc) • 1.26 kB
TypeScript
export declare function zip<T, Q>(array: T[], other: Q[]): [T, Q][];
export declare function pickRandom<T>(arr: T[]): T | null;
/**
* Adds a flat index to each track name in a nested list.
* @param {string[][]} nlist A nested array of track names.
* @returns {string[][]} The modified nested list with flat indexes added to track names.
*/
export declare function addIndexes(nlist: string[][]): string[][];
/**
* Distributes tracks into columns while ensuring they fit within the maximum allowed width.
* @param {string[]} tracks A list of track names to be organized into columns.
* @param {boolean} index If true, adds index numbers to the tracks. Defaults to false.
* @returns {OrganizeResult} A tuple containing the organized columns of tracks and their respective widths.
*/
export declare function organizeTracks(tracks: string[], index?: boolean): OrganizeResult;
/**
* Creates a safe filename based on the song and artist names.
* @param {string} song The name of a song.
* @param {string} artist The name of the artist.
* @returns {string} A sanitized filename that is safe for file systems.
*/
export declare function filename(song: string, artist: string): string;
type OrganizeResult = [cols: string[][], colWidths: number[]];
export {};