UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

56 lines (55 loc) 2.73 kB
import * as data from '../../data'; import * as musicxml from '../../musicxml'; import * as util from '../../util'; import { Config } from '../../config'; import { Logger } from '../../debug'; /** Represents a musical time signature. */ export declare class Time { private config; private log; private partId; private staveNumber; private components; private symbol; constructor(config: Config, log: Logger, partId: string, staveNumber: number, components: util.Fraction[], symbol: data.TimeSymbol | null); static default(config: Config, log: Logger, partId: string, staveNumber: number): Time; static create(config: Config, log: Logger, partId: string, staveNumber: number, musicXML: { time: musicxml.Time; }): Time | null; /** Creates a Time for each stave. */ static createMulti(config: Config, log: Logger, partId: string, staveCount: number, musicXML: { time: musicxml.Time; }): Array<Time | null>; /** Returns a simple Time, composed of two numbers. */ static simple(config: Config, log: Logger, partId: string, staveNumber: number, beatsPerMeasure: number, beatValue: number): Time; /** * Returns a Time composed of many components. * * The parameter type signature ensures that there are at least two Fractions present. */ static complex(config: Config, log: Logger, partId: string, staveNumber: number, components: util.Fraction[]): Time; /** * Returns a Time that should be hidden. * * NOTE: It contains time signature components, but purely to simplify rendering downstream. It shouldn't be used for * calculations. */ static hidden(config: Config, log: Logger, partId: string, staveNumber: number): Time; /** Returns a Time in cut time. */ static cut(config: Config, log: Logger, partId: string, staveNumber: number): Time; /** Returns a Time in common time. */ static common(config: Config, log: Logger, partId: string, staveNumber: number): Time; /** Combines multiple time signatures into a single one, ignoring any symbols. */ static combine(config: Config, log: Logger, partId: string, staveNumber: number, times: Time[]): Time; /** Creates a new time signature that should be displayed as a single number. */ static singleNumber(config: Config, log: Logger, partId: string, staveNumber: number, time: Time): Time; private static parse; parse(): data.Time; getPartId(): string; getStaveNumber(): number; /** Returns a fraction that represents the combination of all */ toFraction(): util.Fraction; isEqual(timeSignature: Time): boolean; isEquivalent(timeSignature: Time): boolean; private getComponents; }