Options
All
  • Public
  • Public/Protected
  • All
Menu

vexflow

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AccidentalValue: -2 | -1 | 0 | 1 | 2
Attributes: { font-family?: string; font-size?: string | number; font-style?: string; font-weight?: string | number }

Type declaration

  • [name: string]: string | number | undefined
  • Optional font-family?: string
  • Optional font-size?: string | number
  • Optional font-style?: string
  • Optional font-weight?: string | number
CommitHook: ((obj: any, note: StemmableNote, builder: Builder) => void)

Type declaration

ContextBuilder: typeof getSVGContext | typeof getCanvasContext
FontModule: { data: FontData; metrics: FontMetrics }

Type declaration

GroupedResults: (Result | Result[])[]
KeyValue: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11
Line: { column: number; dblSharpLine: boolean; flatLine: boolean; line: number; numAcc: number; width: number }

Type declaration

  • column: number
  • dblSharpLine: boolean
  • flatLine: boolean
  • line: number
  • numAcc: number
  • width: number
Match: string | Match[] | null
ModifierContextMember: Tickable | Modifier | StaveNote | TabNote
PartialBeamDirection: typeof BEAM_LEFT | typeof BEAM_RIGHT | typeof BEAM_BOTH
RootValue: 0 | 1 | 2 | 3 | 4 | 5 | 6
RuleFunction: (() => Rule)

Type declaration

StaveConnectorType: "singleRight" | "singleLeft" | "single" | "double" | "brace" | "bracket" | "boldDoubleLeft" | "boldDoubleRight" | "thinDouble" | "none" | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
TriggerFunction: ((state?: { matches: Match[] }) => void)

Type declaration

    • (state?: { matches: Match[] }): void
    • Parameters

      • Optional state: { matches: Match[] }

      Returns void

Variables

BEAM_BOTH: "B" = 'B'
BEAM_LEFT: "L" = 'L'
BEAM_RIGHT: "R" = 'R'

Functions

  • defined<T>(x?: T, code?: string, message?: string): T
  • Check that x is of type T and not undefined. If x is undefined, throw a RuntimeError with the optionally provided error code and message.

    Type Parameters

    • T

    Parameters

    • Optional x: T
    • code: string = 'undefined'
    • message: string = ''

    Returns T

  • drawDot(ctx: RenderContext, x: number, y: number, color?: string): void
  • Draw a tiny dot marker on the specified context. A great debugging aid.

    Parameters

    • ctx: RenderContext

      context

    • x: number

      dot x coordinate

    • y: number

      dot y coordinate

    • color: string = '#F55'

    Returns void

  • globalObject(): typeof globalThis & any
  • VexFlow can be used outside of the browser (e.g., Node) where window may not be defined.

    Returns typeof globalThis & any

  • isBarline(obj: unknown): obj is Barline
  • Parameters

    • obj: unknown

    Returns obj is Barline

  • isCategory<T>(obj: any, category: string, checkAncestors?: boolean): obj is T
  • Use instead of instanceof as a more flexible type guard.

    Type Parameters

    • T

    Parameters

    • obj: any

      check if this object's CATEGORY matches the provided category.

    • category: string

      a string representing a category of VexFlow objects.

    • checkAncestors: boolean = true

      defaults to true, so we walk up the prototype chain to look for a matching CATEGORY. If false, we do not check the superclass or other ancestors.

    Returns obj is T

    true if obj has a static CATEGORY property that matches category.

  • isDot(obj: unknown): obj is Dot
  • Parameters

    • obj: unknown

    Returns obj is Dot

  • Parameters

    • obj: unknown

    Returns obj is GraceNote

  • isHTMLCanvas(element: any): element is HTMLCanvasElement
  • Parameters

    • element: any

    Returns element is HTMLCanvasElement

  • isHTMLDiv(element: any): element is HTMLDivElement
  • Parameters

    • element: any

    Returns element is HTMLDivElement

  • isNote(obj: unknown): obj is Note
  • Parameters

    • obj: unknown

    Returns obj is Note

  • Parameters

    • obj: unknown

    Returns obj is StaveNote

  • isTabNote(obj: unknown): obj is TabNote
  • Parameters

    • obj: unknown

    Returns obj is TabNote

  • log(block: string, ...args: any[]): void
  • Default log function sends all arguments to console.

    Parameters

    • block: string
    • Rest ...args: any[]

    Returns void

  • midLine(a: number, b: number): number
  • Locate the mid point between stave lines. Returns a fractional line if a space.

    Parameters

    • a: number
    • b: number

    Returns number

  • normalizeAngle(a: number): number
  • Convert an arbitrary angle in radians to the equivalent one in the range [0, pi).

    Parameters

    • a: number

    Returns number

  • prefix(text: string): string
  • Used by various classes (e.g., SVGContext) to provide a unique prefix to element names (or other keys in shared namespaces).

    Parameters

    • text: string

    Returns string

  • warn(...args: any[]): void
  • Dump warning to console.

    Parameters

    • Rest ...args: any[]

    Returns void