UNPKG

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

43 lines (42 loc) 1.22 kB
import type { TrackMetadata, AlbumMetadata } from './spotify.js'; import { ThemesSelector } from './constants.js'; /** * A class for generating and saving posters containing track or album information. */ export declare class Poster { private options?; constructor(options?: PosterOptions | undefined); private _handleOutput; /** * Adds text like title, artist, and label info. */ private _drawTemplate; track(metadata: TrackMetadata, lyrics: string, options?: PosterTrackOptions): Promise<Buffer>; album(metadata: AlbumMetadata, options?: PosterAlbumOptions): Promise<Buffer>; private save; private BFT; } export type OutputMode = { type: 'buffer'; } | { type: 'file'; path: string; }; export type PosterTrackOptions = { accent?: boolean; palette?: boolean; theme?: ThemesSelector.Options; pcover?: Buffer | string; }; export type PosterAlbumOptions = { indexing?: boolean; accent?: boolean; palette?: boolean; theme?: ThemesSelector.Options; pcover?: Buffer | string; }; export type PosterOptions = { filename?: string; mimeType?: 'image/png' | 'image/jpeg' | 'image/avif' | 'image/webp'; output?: OutputMode; };