import { Fraction, FractionValue, FractionalMonzo } from 'xen-dev-utils'; import { NedjiLiteral, FractionLiteral, CentsLiteral, IntegerLiteral, MonzoLiteral, DecimalLiteral, RadicalLiteral, ValLiteral } from './expression'; /** * Interval domain. The operator '+' means addition in the linear domain. In the logarithmic domain '+' correspond to multiplication of the underlying values instead. * Cologarithmic values are meant for mapping between values, usually just intonation and steps of equal temperaments. */ export type Domain = 'linear' | 'logarithmic' | 'cologarithmic'; export type EqualTemperament = { fractionOfEquave: Fraction; equave: Fraction; }; /** * Set the default number of components in the vector part of time monzos. * @param n New default length of the vector part. */ export declare function setNumberOfComponents(n: number): void; /** * Get the default number of components in the vector part of extended monzos. * @returns The default length of the vector part. */ export declare function getNumberOfComponents(): number; /** * Arbitrary (but inaccurate) value measured in time-related units (usually Hz). * * Used to represent irrational frequencies and values like pi. */ export declare class TimeReal { timeExponent: number; value: number; /** * Construct a time real. * @param timeExponent Exponent of the seconds unit. * @param value Multiplier of the time unit. */ constructor(timeExponent: number, value: number); /** * Create a real-valued scalar. * @param value Linear value of the scalar. * @returns Scalar in the relative echelon. */ static fromValue(value: number): TimeReal; /** * Create a real-valued scalar from cents (1 cent = 1 centisemitone or 1200th of an octave). * @param cents Width of a musical interval in cents i.e. logarithmic size. * @returns Scalar in the relative echelon. */ static fromCents(cents: number): TimeReal; /** * Create a real-valued frequency. * @param frequency Frequency of a musical note measured in hertz. * @returns Frequency value in the absolute echelon. */ static fromFrequency(frequency: number): TimeReal; /** * Revive a {@link TimeReal} instance produced by `TimeReal.toJSON()`. Return everything else as is. * * Intended usage: * ```ts * const data = JSON.parse(serializedData, TimeReal.reviver); * ``` * * @param key Property name. * @param value Property value. * @returns Deserialized {@link TimeReal} instance or other data without modifications. */ static reviver(key: string, value: any): any; /** * Serialize the time real to a JSON compatible object. * @returns The serialized object with property `type` set to `'TimeReal'`. */ toJSON(): { type: string; t: number; v: string | number; }; /** * Create a copy of this {@link TimeReal} instance. * @returns Independent clone. */ clone(): TimeReal; /** * Convert a relative scalar to cents. * @param ignoreSign Ignore the linear sign of of the scalar. * @returns Size of this interval in cents. */ toCents(ignoreSign?: boolean): number; /** * Convert value to cents ignoring the time exponent. * @param ignoreSign Ignore the linear sign of of the scalar. * @returns Size of this interval in cents (only makes sense if relative). */ totalCents(ignoreSign?: boolean): number; /** * Check if the time real lacks units of time/frequency. * @return `true` if the time real isn't expressed in units of time. */ isScalar(): boolean; /** * Return the frequency-space negative of the time real. * @returns The linear negative of the time real. */ neg(): TimeReal; /** * Return a pitch-space negative of the time real. * @returns The frequency-space inverse of the time real. */ inverse(): TimeReal; /** * Return the frequency-space square root of the time real. * @returns The pitch-space half of the time real. */ sqrt(): TimeReal; /** * Linear space absolute value of the time real. * @returns The time real unchanged or negated if negative originally. */ abs(): TimeReal; /** * Pitch space absolute value of the time real. * @returns The time real unchanged or inverted if less than one originally. */ pitchAbs(): TimeReal; /** * Convert a relative time real to a real number representing a ratio of frequencies. * Convert an absolute time real to the scalar of its time unit. * @returns A real number. */ valueOf(): number; /** * Check if this time real has the same size as another. * @param other Another time real or time monzo. * @returns `true` if the inputs are of equal size. */ equals(other: TimeMonzo | TimeReal): boolean; /** * Check for strict equality between this and another time real. * @param other Another time real. * @returns `true` if the time reals share the same time exponent, and value. */ strictEquals(other: TimeMonzo | TimeReal): boolean; /** * Compare this time real with another. * @param other Another time real or time monzo. * @returns Result < 0 if other is larger than this. Result > 0 if other is smaller than this. Result == 0 if other is equal to this in size. */ compare(other: TimeMonzo | TimeReal): number; /** * Raise this time real to the power of another. * @param other Another time real or a fractional value. * @returns This multiplied by itself `other` times. */ pow(other: FractionValue | TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** @hidden */ tenneyHeight(): number; /** @hidden */ lpow(other: TimeMonzo): TimeReal; /** * Calculate the logarithm in the given base if it exists. * @param other Base of the logarithm. * @returns `x` such that `this ** x === other`. */ log(other: FractionValue | TimeMonzo | TimeReal): number; /** * Combine the time real with another in linear space. * @param other Another time real. * @returns The linear sum of the time reals. */ add(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Subtract another time real from this one in linear space. * @param other Another time real. * @returns The linear difference of the time reals. */ sub(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** @hidden */ lsub(other: TimeMonzo | TimeReal): TimeReal; /** * Perform harmonic addition according to the thin lens equation f⁻¹ = u⁻¹ + v⁻¹. * @param other Another time real. * @returns The reciprocal of the sum of the reciprocals. */ lensAdd(other: TimeMonzo | TimeReal): TimeReal; /** * Perform harmonic subtraction f⁻¹ = u⁻¹ - v⁻¹ (a variation of the thin lens equation). * @param other Another time real. * @returns The reciprocal of the difference of the reciprocals. */ lensSub(other: TimeMonzo | TimeReal): TimeReal; /** @hidden */ leftLensSub(other: TimeMonzo | TimeReal): TimeReal; /** * Multiply the time real with another in linear space i.e. add in logarithmic space. * @param other Another time real. * @returns The product of the time reals in linear space. */ mul(other: TimeMonzo | TimeReal): TimeReal; /** * Divide the time real with another in linear space i.e. subtract in logarithmic space. * @param other Another time real. * @returns This real divided by the other in linear space. */ div(other: TimeMonzo | TimeReal): TimeReal; /** @hidden */ ldiv(other: TimeMonzo | TimeReal): TimeReal; /** * Round the time real to a multiple of another. * @param other Another time real. * @returns The closest multiple of the other to this one. */ roundTo(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Round the time real to a power of another. * @param other Another time real. * @returns The closest power of the other to this one. */ pitchRoundTo(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Calculate modulus with respect to another time real. * @param other Another time real. * @param ceiling If `true` `x.mmod(x)` evaluates to `x`. * @returns This modulo the other. */ mmod(other: TimeMonzo | TimeReal, ceiling?: boolean): TimeReal | TimeMonzo; /** @hidden */ lmmod(other: TimeMonzo | TimeReal, ceiling?: boolean): TimeReal; /** * Calculate modulus in pitch space with respect to another time real. * @param other Another time real. * @param ceiling If `true` `x.reduce(x)` evaluates to `x`. * @returns This reduced by the other. */ reduce(other: TimeMonzo | TimeReal, ceiling?: boolean): TimeReal; /** * Calculate the product of this time real's time exponents with another's. * @param other Another time real. * @returns Product of the time exponents as a fraction. */ dot(other: TimeMonzo | TimeReal): Fraction; /** * Obtain an AST node representing the time real as a decimal. * @returns Real decimal literal. */ asDecimalLiteral(): DecimalLiteral | undefined; /** * Obtain an AST node representing the time real as a cents literal. * @returns Cents literal or a hacky real cents literal if necessary. */ asCentsLiteral(): CentsLiteral | undefined; /** * Obtain an AST node representing the time real as a monzo literal. * @param interchange Boolean flag to use Hz basis for the absolute echelon. * @returns Monzo literal. */ asMonzoLiteral(interchange?: boolean): MonzoLiteral; /** * Obtain an AST node representing the time monzo as a monzo literal suitable for interchange between programs. * @returns Monzo literal. */ asInterchangeLiteral(): MonzoLiteral; /** @hidden */ formatTimeExponent(): string; /** * Faithful string representation of the time real. * @param domain Domain of representation. * @returns String that evaluates to the same value as this time real. */ toString(domain?: Domain): string; /** * Find the closest approximation of the time real in a harmonic series. * @param denominator Denominator of the harmonic series. * @returns The closest approximant in the series. */ approximateHarmonic(denominator: number): TimeMonzo; /** * Find the closest approximation of the time real in a subharmonic series. * @param numerator Numerator of the subharmonic series. * @returns The closest approximant in the series. */ approximateSubharmonic(numerator: number): TimeMonzo; /** * Simplify the time real using the given threshold. * @param eps Error threshold. Defaults to `0.001`. * @returns Simple approximation of the time real. */ approximateSimple(eps?: number): TimeMonzo; /** * Obtain an array of the time real representing a continued fraction. The first element always contains the whole part. * @returns Array of continued fraction coefficients. */ toContinued(): number[]; /** * Obtain a convergent of this time real. * @param depth How many continued fraction coefficients to use after the whole part. * @returns Approximation of the time real. */ getConvergent(depth: number): TimeMonzo; /** @hidden */ isIntegral(): boolean; /** @hidden */ isFractional(): boolean; /** @hidden */ isSqrt(): boolean; /** @hidden */ isEqualTemperament(): boolean; /** @hidden */ isUnity(): boolean; /** @hidden */ isDecimal(): boolean; /** @hidden */ isPowerOfTwo(): boolean; /** @hidden */ toBigInteger(): bigint; /** @hidden */ toFraction(): Fraction; toBigNumeratorDenominator(): { numerator: bigint; denominator: bigint; }; /** @hidden */ toIntegerMonzo(): number[]; /** @hidden */ toMonzo(): number[]; /** @hidden */ toEqualTemperament(): EqualTemperament; /** @hidden */ tail(): TimeReal; /** @hidden */ gcd(other: TimeMonzo | TimeReal): TimeReal; /** @hidden */ lcm(other: TimeMonzo | TimeReal): TimeReal; /** @hidden */ get octaves(): Fraction; /** @hidden */ project(): TimeMonzo; /** @hidden */ divisors(): number[]; /** @hidden */ factorize(): Map; /** @hidden */ asIntegerLiteral(): undefined; /** @hidden */ asFractionLiteral(): undefined; /** @hidden */ asNedjiLiteral(): undefined; /** @hidden */ asRadicalLiteral(): undefined; } /** * Fractional monzo with multiplicative residue measured in time-related units (usually Hz). * * Used to represent the value of musical objects like 432Hz, 5/3 or 7\12 (N-of-EDO). */ export declare class TimeMonzo { timeExponent: Fraction; primeExponents: FractionalMonzo; residual: Fraction; /** * Construct a fractional monzo with multiplicative residue. * @param timeExponent Exponent of the seconds unit. * @param primeExponents Fractional monzo part. * @param residual Multiplicative residue that is too complex to fit in the vector part. */ constructor(timeExponent: Fraction, primeExponents: FractionalMonzo, residual?: Fraction); /** * Construct a time monzo from a rational number. * @param fraction Rational number to convert. * @param numberOfComponents Number of components in the monzo vector part. * @returns Time monzo representing the just intonation interval. */ static fromFraction(fraction: FractionValue, numberOfComponents?: number): TimeMonzo; /** * Construct a time monzo from a pitch-space fraction of a frequency-space fraction. * @param fractionOfEquave Fraction of the equave measured in pitch-space. * @param equave Equave measured in frequency-space. Defaults to the octave (2/1). * @param numberOfComponents Number of components in the monzo vector part. * @returns Time monzo representing N-of-EDO (default) or a generic EDJI interval. */ static fromEqualTemperament(fractionOfEquave: FractionValue, equave?: FractionValue, numberOfComponents?: number): TimeMonzo; /** * Construct a time monzo from a value that's a rational multiple of 1 Hz. * @param frequency Frequency measured in oscillations per second. * @param numberOfComponents Number of components in the monzo vector part. * @returns Time monzo representing the frequency. */ static fromFractionalFrequency(frequency: FractionValue, numberOfComponents?: number): TimeMonzo; /** * Construct a time monzo from a harmonic. * @param value Index of the harmonic with 1/1 starting from 1. * @param numberOfComponents Number of components in the monzo vector part. * @returns Time monzo representing the harmonic. */ static fromBigInt(value: bigint, numberOfComponents?: number): TimeMonzo; /** * Construct a time monzo from a rational number. * @param numerator Numerator of the number. * @param denominator Denominator of the number. * @param numberOfComponents Number of components in the monzo vector part. * @returns Time monzo representing the just intonation interval. */ static fromBigNumeratorDenominator(numerator: bigint, denominator: bigint, numberOfComponents?: number): TimeMonzo; /** * Create a scalar from a rational number of cents (1 cent = 1 centisemitone or 1200th of an octave). * @param cents Width of a musical interval in cents i.e. logarithmic size. * @returns Scalar in the relative echelon. */ static fromFractionalCents(cents: FractionValue, numberOfComponents?: number): TimeMonzo; /** * Create a scalar from an array of prime exponents. * @param monzo Exponents of prime numbers starting from prime 2. Possibly fractional. * @returns Scalar in the relative echelon. */ static fromArray(monzo: FractionValue[]): TimeMonzo; /** * Revive a {@link TimeMonzo} instance produced by `TimeMonzo.toJSON()`. Return everything else as is. * * Intended usage: * ```ts * const data = JSON.parse(serializedData, TimeMonzo.reviver); * ``` * * @param key Property name. * @param value Property value. * @returns Deserialized {@link TimeMonzo} instance or other data without modifications. */ static reviver(key: string, value: any): any; /** * Serialize the time monzo to a JSON compatible object. * @returns The serialized object with property `type` set to `'TimeMonzo'`. */ toJSON(): { type: string; t: import("xen-dev-utils").UnsignedFraction; p: number[]; r: import("xen-dev-utils").UnsignedFraction; }; /** * Number of components in the monzo vector part. */ get numberOfComponents(): number; set numberOfComponents(value: number); /** * The first monzo component. The exponent of 2. */ get octaves(): Fraction; /** * Create a deep copy of this time monzo. * @returns A clone with independent vector part. */ clone(): TimeMonzo; /** * Convert the time monzo to a fraction in linear space. * @returns Musical ratio as a fraction in linear space corresponding to the unit of time of the original time monzo. * @throws An error if the time monzo cannot be represented as a ratio. */ toFraction(): Fraction; /** * Convert the time monzo to a BigInt numerator and denominator in linear space. * @returns Musical ratio as a fraction in linear space corresponding to the unit of time. * @throws An error if the time monzo cannot be represented as a ratio. */ toBigNumeratorDenominator(): { numerator: bigint; denominator: bigint; }; /** * Convert the time monzo to an integer in linear space. * @returns Musical ratio as an integer in linear space corresponding to the unit of time of the time monzo. * @throws An error if the time monzo cannot be represented as an integer. */ toBigInteger(): bigint; /** * Convert the time monzo to cents. * @param ignoreSign Compute the size of the absolute value. * @returns Size of the time monzo in cents. */ toCents(ignoreSign?: boolean): number; /** * Convert the time monzo to pitch-space fraction of a frequency-space fraction. * @param preferPositive Prefer a positive fraction of the equave. * @returns Pair of the pitch-space fraction and the equave as a frequency-space fraction. * @throws An error if the time monzo cannot be represented as an EDJI interval. */ toEqualTemperament(preferPositive?: boolean): EqualTemperament; /** * Convert the time monzo to a simple monzo with integer coefficients. * @returns Array of prime exponents. * @param trim If `true` trim zero components from the tail. * @throws An error if the time monzo cannot be represented as sufficiently simple ratio in frequency-space. */ toIntegerMonzo(trim?: boolean): number[]; /** * Convert the time monzo to a simple array of numbers. * @returns Array of prime exponents. * @param trim If `true` trim zero components from the tail. * @throws An error if the time monzo cannot be represented as sufficiently simple ratio in frequency-space. */ toMonzo(trim?: boolean): number[]; /** * Check if the time monzo represents the number one. * @returns `true` if the time monzo represents musical unison ignoring units of time. */ isUnity(): boolean; /** * Check if the time monzo lacks units of time/frequency. * @return `true` if the time monzo isn't expressed in units of time. */ isScalar(): boolean; /** * Check if the time monzo represents a whole number. * @returns `true` if the time monzo represents an integer ignoring units of time. */ isIntegral(): boolean; /** * Check if the time monzo represents a finite sum of powers of ten. * @returns `true` if the time monzo represents a decimal number ignoring units of time. */ isDecimal(): boolean; /** * Check if the time monzo represents a musical fraction or fractional amount of time or frequency. * @returns `true` if the time monzo can be interpreted as a ratio in frequency-space. */ isFractional(): boolean; /** * Check if the time monzo represents a square root of a fraction or fractional amount of time or frequency. * @returns `true` if the square of time monzo can be interpreted as a ratio in frequency-space. */ isSqrt(): boolean; /** * Check if the time monzo represents a generic EDJI interval. * @returns `true` if the time monzo can be interpreted as pitch-space fraction of a frequency-space fraction. */ isEqualTemperament(): boolean; /** * Check if the time monzo is a power of two in frequency space. * @returns `true` if the time monzo is a power of two. */ isPowerOfTwo(): boolean | 0; /** * Return the frequency-space negative of the time monzo. * @returns The frequency-space negative of the time monzo. */ neg(): TimeMonzo; /** * Return a pitch-space negative of the time monzo. * @returns The frequency-space inverse of the time monzo. */ inverse(): TimeMonzo; /** * Return the frequency-space square root of the time monzo. * @returns The pitch-space half of the time monzo. */ sqrt(): TimeReal | TimeMonzo; /** * Combine the time monzo with another in linear space. * @param other Another time monzo. * @returns The linear sum of the time monzos. */ add(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Subtract another time monzo from this one in linear space. * @param other Another time monzo. * @returns The linear difference of the time monzos. */ sub(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Perform harmonic addition according to the thin lens equation f⁻¹ = u⁻¹ + v⁻¹. * @param other Another time monzo. * @returns The reciprocal of the sum of the reciprocals. */ lensAdd(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Perform harmonic subtraction f⁻¹ = u⁻¹ - v⁻¹ (a variation of the thin lens equation). * @param other Another time monzo. * @returns The reciprocal of the difference of the reciprocals. */ lensSub(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Multiply the time monzo with another in linear space i.e. add in logarithmic space. * @param other Another time monzo. * @returns The product of the time monzos in linear space. */ mul(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Compute the greatest common divisor between this and another time monzo. * @param other Another time monzo. * @returns The largest multiplicative factor shared by both monzos. */ gcd(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Compute the least common multiple between this and another time monzo. * @param other Another time monzo. * @returns The smallest monzo that has both monzos as factors. */ lcm(other: TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Divide the time monzo with another in linear space i.e. subtract in logarithmic space. * @param other Another time monzo. * @returns This monzo divided by the other monzo in linear space. */ div(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Raise this time monzo to the power of another. * @param other Another time monzo or a fractional value. * @returns This multiplied by itself `other` times. */ pow(other: FractionValue | TimeMonzo | TimeReal): TimeMonzo | TimeReal; /** * Calculate the logarithm in the given base if it exists. * @param other Base of the logarithm. * @returns `x` such that `this ** x === other`. */ log(other: FractionValue | TimeMonzo | TimeReal): Fraction | number; /** * Calculate the dot product of the vector parts of two time monzos. * @param other Another time monzo. * @returns The sum of the pairwise products of the vector parts. */ dot(other: TimeMonzo | TimeReal): Fraction; /** * Calculate the geometric inverse of the time monzo. * @returns A time monzo whose dot product with this one is unitary. */ geometricInverse(): TimeMonzo; /** * Linear space absolute value of the time monzo. * @returns The time monzo unchanged or negated if negative originally. */ abs(): TimeMonzo; /** * Pitch space absolute value of the time monzo. * @returns The time monzo unchanged or inverted if less than one originally. */ pitchAbs(): TimeMonzo; /** * Calculate modulus with respect to another time monzo. * @param other Another time monzo. * @param ceiling If `true` `x.mmod(x)` evaluates to `x`. * @returns This modulo the other. */ mmod(other: TimeMonzo | TimeReal, ceiling?: boolean): TimeMonzo | TimeReal; /** * Calculate modulus in pitch space with respect to another time monzo. * @param other Another time monzo. * @param ceiling If `true` `x.reduce(x)` evaluates to `x`. * @returns This reduced by the other. */ reduce(other: TimeMonzo | TimeReal, ceiling?: boolean): TimeReal | TimeMonzo; /** * Project the exponent of two to the given base. * @param base New base to replace prime two. * @returns N steps of equal divisions of the new base assuming this time monzo was N steps of an equally divided octave. */ project(base: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Check for strict equality between this and another time monzo. * @param other Another time monzo. * @returns `true` if the time monzos share the same time exponent, prime exponents, residual and cents offset. */ strictEquals(other: TimeMonzo | TimeReal): boolean; /** * Convert a relative time monzo to cents. * Covert an absolute time monzo to the size in cents of the scalar of its time unit. * @param ignoreSign Compute the size of the absolute value. * @returns Size of the time monzo in cents. */ totalCents(ignoreSign?: boolean): number; /** * Calculate the Tenney height of this time monzo ignoring units of time. * @returns The natural logarithm of the Benedetti height */ tenneyHeight(): number; /** * Convert a relative time monzo to a real number representing a ratio of frequencies. * Convert an absolute time monzo to the scalar of its time unit. * @returns A real number. */ valueOf(): number; /** * Obtain an array of the time monzo representing a continued fraction. The first element always contains the whole part. * @returns Array of continued fraction coefficients. */ toContinued(): number[]; /** * Check if this time monzo has the same size as another. * @param other Another time monzo. * @returns `true` if the time monzos are of equal size. */ equals(other: TimeMonzo | TimeReal): boolean; /** * Compare this time monzo with another. * @param other Another time monzo. * @returns Result < 0 if other is larger than this. Result > 0 if other is smaller than this. Result == 0 if other is equal to this in size. */ compare(other: TimeMonzo | TimeReal): number; /** * Round the time monzo to a multiple of another. * @param other Another time monzo. * @returns The closest multiple of the other to this one. */ roundTo(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Round the time monzo to a power of another. * @param other Another time monzo. * @returns The closest power of the other to this one. */ pitchRoundTo(other: TimeMonzo | TimeReal): TimeReal | TimeMonzo; /** * Find the closest approximation of the time monzo in a harmonic series. * @param denominator Denominator of the harmonic series. * @returns The closest approximant in the series. */ approximateHarmonic(denominator: number): TimeMonzo; /** * Find the closest approximation of the time monzo in a subharmonic series. * @param numerator Numerator of the subharmonic series. * @returns The closest approximant in the series. */ approximateSubharmonic(numerator: number): TimeMonzo; /** * Simplify the time monzo using the given threshold. * @param eps Error threshold. Defaults to `0.001`. * @returns Simple approximation of the time monzo. */ approximateSimple(eps?: number): TimeMonzo; /** * Obtain a convergent of this time monzo. * @param depth How many continued fraction coefficients to use after the whole part. * @returns Approximation of the time monzo. */ getConvergent(depth: number): TimeMonzo; /** * Obtain a higher prime tail of this time monzo. * @param index Prime index with 2 at #0. * @returns Multiplicative tail above the given limit. */ tail(index: number): TimeMonzo; /** * Find all divisors of a natural number (ignoring units of time). * @returns All divisors including 1 and the number itself. * @throws An error if this time monzo doesn't represent a positive integer. */ divisors(): number[]; /** * Factorize the time monzo into a Map instance with prime numbers as keys and their multiplicity as values. * @returns A sparse monzo. */ factorize(): Map; /** * Obtain an AST node representing the time monzo as a decimal. * @returns Decimal literal or a real decimal literal if necessary. */ asDecimalLiteral(): DecimalLiteral | undefined; /** * Obtain a pseudo-AST node representing the time monzo as a radical. * @returns Radical literal or `undefined` if representation fails. */ asRadicalLiteral(): RadicalLiteral | undefined; /** * Obtain an AST node representing the time monzo as a cents literal. * @returns Cents literal or a hacky real cents literal if necessary. */ asCentsLiteral(): CentsLiteral | undefined; /** * Obtain an AST node representing the time monzo as an integer literal. * @returns Integer literal or `undefined` if representation fails. */ asIntegerLiteral(): IntegerLiteral | undefined; /** * Obtain an AST node representing the time monzo as a fraction literal. * @param node Reference node to infer formatting from. * @returns Fraction literal or `undefined` if representation fails. */ asFractionLiteral(node?: FractionLiteral): FractionLiteral | undefined; /** * Obtain an AST node representing the time monzo as a NEDJI literal. * @param node Reference node to infer formatting from. * @returns NEDJI literal or `undefined` if representation fails. */ asNedjiLiteral(node?: NedjiLiteral): NedjiLiteral | undefined; /** * Obtain an AST node representing the time monzo as a monzo literal. * @returns Monzo literal. */ asMonzoLiteral(trimTail?: boolean): MonzoLiteral; /** * Obtain an AST node representing the time monzo as a monzo literal suitable for interchange between programs. * @returns Monzo literal. */ asInterchangeLiteral(): MonzoLiteral; /** * Obtain an AST node representing the time monzo as a val literal. * @returns Val literal. */ asValLiteral(): ValLiteral; /** * Faithful string representation of the time monzo. * @param domain Domain of representation. * @returns String that evaluates to the same value as this time monzo. */ toString(domain?: Domain): string; }