From f15eb220b6fcf74e69fbe6b80bed03efe94fa3c8 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Sun, 12 May 2024 18:30:15 +0300 Subject: [PATCH] Fix minor TypeDoc issues --- src/diamond-mos.ts | 2 +- src/expression.ts | 5 ++++- src/index.ts | 1 + src/interval.ts | 6 +++--- src/parser/statement.ts | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/diamond-mos.ts b/src/diamond-mos.ts index 992a7556..ae93b9bb 100644 --- a/src/diamond-mos.ts +++ b/src/diamond-mos.ts @@ -9,7 +9,7 @@ import { VULGAR_FRACTIONS, VulgarFraction, } from './pythagorean'; -import {ZERO, hasOwn} from './utils'; +import {ZERO} from './utils'; export type MosDegree = { center: TimeMonzo; diff --git a/src/expression.ts b/src/expression.ts index 7efced5e..e1a19343 100644 --- a/src/expression.ts +++ b/src/expression.ts @@ -244,6 +244,9 @@ export type SquareSuperparticular = { end: bigint | null; }; +/** + * AST node produced by the parser or a synthetic one used for formatting. + */ export type IntervalLiteral = | IntegerLiteral | DecimalLiteral @@ -1132,7 +1135,7 @@ export function integerToVectorComponent(num: number): VectorComponent { }; } -export function literalToJSON(literal?: IntervalLiteral) { +export function literalToJSON(literal?: IntervalLiteral): any { if (!literal) { return undefined; } diff --git a/src/index.ts b/src/index.ts index 8ccb87be..4d1bcd62 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,7 @@ export { type Nominal, type AbsolutePitch, } from './pythagorean'; +export * from './diamond-mos'; export * from './tools'; export { MetricPrefix, diff --git a/src/interval.ts b/src/interval.ts index 3e2df34f..abed7570 100644 --- a/src/interval.ts +++ b/src/interval.ts @@ -261,9 +261,9 @@ export class Interval { /** * Serialize the time monzo to a JSON compatible object. - * @returns The serialized object with property `type` set to `'TimeMonzo'`. + * @returns The serialized object with property `type` set to `'Interval'`. */ - toJSON() { + toJSON(): any { return { type: 'Interval', value: this.value.toJSON(), @@ -1001,7 +1001,7 @@ export class Interval { * @param context Current root context with information about root pitch and size of ups and lifts. * @returns A true AST node suitable for string conversion or `undefined` realization is impossible in the given context. */ - realizeNode(context: RootContext) { + realizeNode(context: RootContext): IntervalLiteral | undefined { if (!this.node) { return this.node; } diff --git a/src/parser/statement.ts b/src/parser/statement.ts index bc73241c..2f8cc2d0 100644 --- a/src/parser/statement.ts +++ b/src/parser/statement.ts @@ -919,7 +919,7 @@ export class StatementVisitor { /** * Execute the abstract syntax tree of a SonicWeave program. - * @param body Program containing the AST to be executed. + * @param program Program containing the AST to be executed. */ executeProgram(program: Program) { const interrupt = this.executeStatements(program.body);