//////////////////////////////////////////////////////////////////////////////// // NOTE: this file was generated by the emscripten/npm build script // and should not be edited because changes will be lost. //////////////////////////////////////////////////////////////////////////////// export class VerovioToolkit { /** @param {VerovioModule} [VerovioModule] */ constructor(VerovioModule?: VerovioModule); /** @private @type {VerovioModule} */ private VerovioModule; /** @private @type {any} */ private proxy; /** @private @type {number} */ private ptr; destroy(): void; /** * Edit the MEI data. * @param {EditorAction} editorAction The editor action as a JSON object * @returns {boolean} True if the edit action was successfully applied */ edit(editorAction: EditorAction): boolean; /** * Return the editor status. * @deprecated Use editStatus instead. * @returns {EditorStatus} The editor status */ editInfo(): EditorStatus; /** * Return the editor response. * @returns {EditorResponse} The editor response */ editResponse(): EditorResponse; /** * Return the editor status. * @returns {EditorStatus} The editor status */ editStatus(): EditorStatus; /** * Return all available options grouped by category. * * For each option, returns the type, the default value, and the minimum and maximum value (when available) * @returns {AvailableOptions} The available options */ getAvailableOptions(): AvailableOptions; /** * Return a dictionary of all the options with their default value. * @returns {VerovioOptions} The default options */ getDefaultOptions(): VerovioOptions; /** * Return descriptive features as a JSON string. * * The features are tailored for implementing incipit search. * @param {DescriptiveFeaturesOptions} options A JSON object with the feature extraction options * @returns {DescriptiveFeatures} A JSON object with the requested features */ getDescriptiveFeatures(options: DescriptiveFeaturesOptions): DescriptiveFeatures; /** * Return element attributes as a JSON string. * * The attributes returned include the ones not supported by Verovio * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {Object} A JSON object with all attributes */ getElementAttr(xmlId: string): { [x: string]: string; }; /** * Returns array of IDs of elements being currently played. * @param {number} millisec The time in milliseconds * @returns {{notes: string[], page: number}} A JSON object with the page and notes being played */ getElementsAtTime(millisec: number): { notes: string[]; page: number; }; /** * Returns a vector of ID strings of all elements (the notated and the expanded) for a given element. * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {Object} A JSON object with all IDs */ getExpansionIdsForElement(xmlId: string): { [x: string]: string; }; /** * Get the humdrum buffer. * @returns {string} The humdrum buffer as a string */ getHumdrum(): string; /** * Filter Humdrum data. * @param {string} data The Humdrum data * @returns {string} The Humdrum data as a string */ convertHumdrumToHumdrum(data: string): string; /** * Convert Humdrum data to MIDI. * @param {string} data The Humdrum data * @returns {string} The MIDI file as a base64-encoded string */ convertHumdrumToMIDI(data: string): string; /** * Convert MEI data into Humdrum data. * @param {string} data The MEI data * @returns {string} The Humdrum data as a string */ convertMEIToHumdrum(data: string): string; /** * Get the log content for the latest operation. * @returns {string} The log content as a string */ getLog(): string; /** * Get the MEI as a string. * @param {GetMeiOptions} [options] A JSON object with the output options; pageNo: integer; (1-based), all pages if none (or 0) specified; scoreBased: true or false; true by default; basic: true or false; false by default; removeIds: true or false; false by default - remove all @xml:id not used in the data; * @returns {string} The MEI as a string */ getMEI(options?: GetMeiOptions): string; /** * Return MIDI values of the element with the ID (xml:id) * * RenderToMIDI() must be called prior to using this method * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {MIDIValues} a JSON object with the MIDI values */ getMIDIValuesForElement(xmlId: string): MIDIValues; /** * Returns the ID string of the notated (the original) element. * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {string} An ID string */ getNotatedIdForElement(xmlId: string): string; /** * Return a dictionary of all the options with their current value. * @param {boolean} [defaultValues] Deprecated: use getDefaultOptions() (with 'true') or no argument instead. * @returns {VerovioOptions} A JSON object with the current options */ getOptions(defaultValues?: boolean): VerovioOptions; /** * Return the number of pages in the loaded document. * * The number of pages depends one the page size and if encoded layout was taken into account or not. * @returns {number} The number of pages */ getPageCount(): number; /** * Return the page on which the element is the ID (xml:id) is rendered. * * This takes into account the current layout options. * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {number} the page number (1-based) where the element is (0 if not found) */ getPageWithElement(xmlId: string): number; /** * Return the time at which the element is the ID (xml:id) is played. * * RenderToMIDI() must be called prior to using this method. * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {number} The time in milliseconds */ getTimeForElement(xmlId: string): number; /** * Return a JSON object string with the following key values for a given note. * * Return scoreTimeOnset, scoreTimeOffset, scoreTimeTiedDuration, realTimeOnsetMilliseconds, realTimeOffsetMilliseconds, realTimeTiedDurationMilliseconds. * @param {string} xmlId the ID (@xml:id) of the element being looked for * @returns {ElementTimes} A JSON object with the values */ getTimesForElement(xmlId: string): ElementTimes; /** * Return the version number. * @returns {string} the version number as a string */ getVersion(): string; /** * Load a string data with the type previously specified in the options. * * By default, the methods try to auto-detect the type. * @param {string} data A string with the data (e.g., MEI data) to be loaded * @returns {boolean} True if the data was successfully loaded */ loadData(data: string): boolean; /** * Load a MusicXML compressed file passed as base64 encoded string. * @param {string} data A ZIP file as a base64 encoded string * @returns {boolean} True if the data was successfully loaded */ loadZipDataBase64(data: string): boolean; /** * Load a MusicXML compressed file passed as a buffer of bytes. * @param {ArrayBuffer} data A ZIP file as a buffer of bytes * @returns {boolean} True if the data was successfully loaded */ loadZipDataBuffer(data: ArrayBuffer): boolean; /** * Redo the layout of the loaded data. * * This can be called once the rendering option were changed, for example with a new page (sceen) height or a new zoom level. * @param {RedoLayoutOptions} [options] A JSON object with the action options resetCache: true or false; true by default; */ redoLayout(options?: RedoLayoutOptions): void; /** * Redo the layout of the pitch postitions of the current drawing page. * * Only the note vertical positions are recalculated with this method. RedoLayout() needs to be called for a full recalculation. */ redoPagePitchPosLayout(): void; /** * Render the first page of the data to SVG. * * This method is a wrapper for setting options, loading data and rendering the first page. It will return an empty string if the options cannot be set or the data cannot be loaded. * @param {string} data A string with the data (e.g., MEI data) to be loaded * @param {VerovioOptions} options A JSON object with the output options * @returns {string} The SVG first page as a string */ renderData(data: string, options: VerovioOptions): string; /** * Render a document’s expansionMap, if existing. * @returns {ExpansionMap} The expansion map as a JSON object */ renderToExpansionMap(): ExpansionMap; /** * Render the document to MIDI. * @returns {string} A MIDI file as a base64 encoded string */ renderToMIDI(): string; /** * Render a document to Plaine and Easie code. * * Only the top staff / layer is exported. * @returns {string} The PAE as a string */ renderToPAE(): string; /** * Render a page to SVG. * @param {number} [pageNo] The page to render (1-based), default 1 * @param {boolean} [xmlDeclaration] True for including the xml declaration in the SVG output, default false * @returns {string} The SVG page as a string */ renderToSVG(pageNo?: number, xmlDeclaration?: boolean): string; /** * Render a document to a timemap. * @param {TimeMapOptions} [options] A stringified JSON objects with the timemap options * @returns {TimeMapEntry[]} The timemap as a JSON object */ renderToTimemap(options?: TimeMapOptions): TimeMapEntry[]; /** * Reset all options to default values. */ resetOptions(): void; /** * Reset the seed used to generate MEI @xml:id attribute values. * * Passing 0 will seed the @xml:id generator with a random (time-based) seed value. This method will have no effect if the xml-id-checksum option is set. * @param {number} seed The seed value for generating the @xml:id values (0 for a time-based random seed) * @returns {void} */ resetXmlIdSeed(seed: number): void; /** * Set the value for a selection. * * The selection will be applied only when some data is loaded or the layout is redone. The selection can be reset (cancelled) by passing an empty string or an empty JSON object. A selection across multiple mdivs is not possible. * @param {Selection} selection The selection as a stringified object * @returns {boolean} True if the selection was successfully parsed or reset */ select(selection: Selection): boolean; /** * Set option values. * * The name of each option to be set is to be given as JSON key. * @param {VerovioOptions} options A JSON object with the output options * @returns {boolean} True if the options were successfully set */ setOptions(options: VerovioOptions): boolean; /** * Validate the Plaine & Easie code passed in the string data. * * A single JSON object is returned when there is a global input error. When reading the input succeeds, validation is grouped by input keys. The methods always returns errors in PAE pedantic mode. No data remains loaded after the validation. * @param {string | Object} data A string with the data in JSON or with PAE @ keys * @returns {PAEValidation} A JSON object with the validation warnings or errors */ validatePAE(data: string | { [x: string]: string; }): PAEValidation; /** * @private * @param {VerovioOptions} options * @returns {VerovioOptions} */ private preprocessOptions; } export namespace VerovioToolkit { let instances: VerovioToolkit[]; } export type VerovioOptions = import("./VerovioOptions").VerovioOptions; export type EditorAction = import("./EditorTypes").EditorAction; export type EditorStatus = import("./EditorTypes").EditorStatus; export type EditorResponse = import("./EditorTypes").EditorResponse; export type AvailableOptions = import("./AvailableOptions").AvailableOptions; export type MIDIValues = import("./VerovioTypes").MIDIValues; export type GetMeiOptions = import("./VerovioTypes").GetMeiOptions; export type TimeMapEntry = import("./VerovioTypes").TimeMapEntry; export type TimeMapOptions = import("./VerovioTypes").TimeMapOptions; export type RedoLayoutOptions = import("./VerovioTypes").RedoLayoutOptions; export type Selection = import("./VerovioTypes").Selection; export type PAEValidation = import("./VerovioTypes").PAEValidation; export type ExpansionMap = import("./VerovioTypes").ExpansionMap; export type DescriptiveFeatures = import("./VerovioTypes").DescriptiveFeatures; export type DescriptiveFeaturesOptions = import("./VerovioTypes").DescriptiveFeaturesOptions; export type ElementTimes = import("./VerovioTypes").ElementTimes; export type VerovioModule = import("./VerovioModule").VerovioModule;