export default WebMscore; declare class WebMscore { /** * This promise is resolved when the runtime is fully initialized * @returns {Promise} */ static get ready(): Promise; /** * The maximum MSCZ/MSCX file format version supported by webmscore * @returns {Promise} e.g. `301` */ static version(): Promise; /** * Set log level * @param {0 | 1 | 2} level - See https://github.com/LibreScore/webmscore/blob/v1.0.0/src/framework/global/thirdparty/haw_logger/logger/log_base.h#L30-L33 * - 0: Off * - 1: Normal (`ERRR` or `WARN` or `INFO`) * - 2: Debug (`DEBG`) * @returns {Promise} */ static setLogLevel(level: 0 | 1 | 2): Promise; /** * Set custom stdout instead of `console.log` * Available before `WebMscore.ready` * @private Node.js exclusive * @param {(byte: number) => any} write */ private static set stdout(arg); /** @private */ private static get stdout(); /** * Set custom stderr instead of `console.warn` * Available before `WebMscore.ready` * @private Node.js exclusive * @param {(byte: number) => any} write * @example * ```js * WebMscore['stderr'] = function (byte) { * process.stderr.write(new Uint8Array([byte])) * } * await WebMscore.ready * ``` */ private static set stderr(arg); /** @private */ private static get stderr(); /** * Load score data * @param {import('../schemas').InputFileFormat} format * @param {Uint8Array} data * @param {Uint8Array[] | Promise} fonts load extra font files (CJK characters support) * @param {boolean} doLayout set to false if you only need the score metadata or the midi file (Super Fast, 3x faster than the musescore software) * @returns {Promise} */ static load(format: import('../schemas').InputFileFormat, data: Uint8Array, fonts?: Uint8Array[] | Promise, doLayout?: boolean): Promise; /** * Load (CJK) fonts on demand * @private * @param {string | Uint8Array} font * * path to the font file in the virtual file system, or * * the font file data * @returns {Promise} success */ private static addFont; /** @private */ private static set hasSoundfont(arg); /** * A soundfont file is loaded * @private * @type {boolean} * @see setSoundFont and saveAudio */ private static get hasSoundfont(); /** * Set the soundfont (sf2/sf3) data * (Audio needs soundfonts) * @private * @param {Uint8Array} data * @returns {Promise} */ private static setSoundFont; /** * @hideconstructor use `WebMscore.load` * @param {number} scoreptr the pointer to the MasterScore class instance in C++ */ constructor(scoreptr: number); /** @private */ private scoreptr; /** @private */ private excerptId; /** * Only save this excerpt (linked parts) of the score * * if no excerpts, generate excerpts from existing instrument parts * * @param {number} id `-1` means the full score */ setExcerptId(id: number): Promise; getExcerptId(): Promise; /** * Generate excerpts from Parts (only parts that are visible) if no existing excerpts * @returns {Promise} */ generateExcerpts(): Promise; /** * Get the score title * @returns {Promise} */ title(): Promise; /** * Get the score title (filename safe, replaced some characters) */ titleFilenameSafe(): Promise; /** * Get the number of pages in the score (or the excerpt if `excerptId` is set) * @returns {Promise} */ npages(): Promise; /** * Get score metadata * @returns {Promise} */ metadata(): Promise; /** * Get the positions of measures * @returns {Promise} */ measurePositions(): Promise; /** * Get the positions of segments * @returns {Promise} */ segmentPositions(): Promise; /** * Export score as MusicXML file * @returns {Promise} contents of the MusicXML file (plain text) */ saveXml(): Promise; /** * Export score as compressed MusicXML file * @returns {Promise} */ saveMxl(): Promise; /** * Save part score as MSCZ/MSCX file * @param {'mscz' | 'mscx'} format * @returns {Promise} */ saveMsc(format?: 'mscz' | 'mscx'): Promise; /** * Export score as the SVG file of one page * @param {number} pageNumber integer * @param {boolean} drawPageBackground * @returns {Promise} contents of the SVG file (plain text) */ saveSvg(pageNumber?: number, drawPageBackground?: boolean): Promise; /** * Export score as the PNG file of one page * @param {number} pageNumber integer * @param {boolean} drawPageBackground * @param {boolean} transparent * @returns {Promise} */ savePng(pageNumber?: number, drawPageBackground?: boolean, transparent?: boolean): Promise; /** * Export score as PDF file * @returns {Promise} */ savePdf(): Promise; /** * Export score as MIDI file * @param {boolean} midiExpandRepeats * @param {boolean} exportRPNs * @returns {Promise} */ saveMidi(midiExpandRepeats?: boolean, exportRPNs?: boolean): Promise; /** * Set the soundfont (sf2/sf3) data * @param {Uint8Array} data */ setSoundFont(data: Uint8Array): Promise; /** * Export score as audio file (wav/ogg/flac/mp3) * @param {'wav' | 'ogg' | 'flac' | 'mp3'} format */ saveAudio(format: 'wav' | 'ogg' | 'flac' | 'mp3'): Promise; /** * Synthesize audio frames * * `synthAudio` is single instance, i.e. you can't have multiple iterators. If you call `synthAudio` multiple times, it will reset the time offset of all iterators the function returned. * * @param {number} starttime The start time offset in seconds * @returns {Promise<(cancel?: boolean) => Promise>} The iterator function, see `processSynth` */ synthAudio(starttime: number): Promise<(cancel?: boolean) => Promise>; /** * Synthesize audio frames in bulk * @param {number} starttime - The start time offset in seconds * @param {number} batchSize - max number of result SynthRes' (n * 512 frames) * @returns {Promise<(cancel?: boolean) => Promise>} */ synthAudioBatch(starttime: number, batchSize: number): Promise<(cancel?: boolean) => Promise>; /** * Synthesize audio frames * @private * @todo GC this iterator function * @param {number} starttime The start time offset in seconds * @returns {Promise} Pointer to the iterator function */ private _synthAudio; /** * Parse struct SynthRes, then free its memory * @private * @param {number} resptr - pointer to the SynthRes data * @returns {import('../schemas').SynthRes} */ private _parseSynthRes; /** * @private * @param {number} fnptr - pointer to the iterator function * @param {boolean} cancel - cancel the audio synthesis worklet * @returns {Promise} */ private processSynth; /** * @private * @param {number} fnptr - pointer to the iterator function * @param {number} batchSize - see `synthAudioBatch` * @param {boolean} cancel - cancel the audio synthesis worklet */ private processSynthBatch; /** * Export positions of measures or segments (if `ofSegments` == true) as JSON * @param {boolean} ofSegments * @also `score.measurePositions()` and `score.segmentPositions()` * @returns {Promise} */ savePositions(ofSegments: boolean): Promise; /** * Export score metadata as JSON text * @also `score.metadata()` * @returns {Promise} contents of the JSON file */ saveMetadata(): Promise; /** * @param {boolean=} soft (default `true`) * * `true` destroy the score instance only, or * * `false` destroy the whole WebMscore context * @returns {void} */ destroy(soft?: boolean | undefined): void; }