import { AbcVisualParams } from 'abcjs'; import { Accidental } from '@abc-editor/core'; import { Dispatch } from 'react'; import { EditorCommandAction } from '@abc-editor/core'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { PuroReactProps } from 'puro'; import { Rhythm } from '@abc-editor/core'; import { TuneObject } from 'abcjs'; /** The main ABC notation editor with a built-in toolbar. */ export declare function ABCEditor({ initialAbc, chordTemplate, jazzChords, format, selectTypes, visualTranspose, autoLineBreaks, responsive, scale, enableKbdShortcuts, onChange, }: EditorProps): JSX_2.Element; export declare function EditorControls(): JSX_2.Element; declare type EditorProps = { initialAbc?: string; chordTemplate?: string; jazzChords?: boolean; selectTypes?: boolean; format?: AbcVisualParams["format"]; visualTranspose?: AbcVisualParams["visualTranspose"]; /** Make the printed music visually bigger or smaller. Will be overridden if `responsive` is set to `true`. @default 1 */ scale?: number; /** Whether the printed music should grow/shrink according to the available width. Setting this to `true` overrides the `scale` option */ responsive?: boolean; /** * Set this property in order to add line breaks automatically, rather than follow the line breaks in the * ABC score. You'll need to provide the available width for the staff, as well as the preferred number of measures in each line. * @see [abcjs docs](https://paulrosen.github.io/abcjs/visual/render-abc-options.html#wrap) for more details * on each of the options */ autoLineBreaks?: { staffWidth: number; preferredMeasuresPerLine: number; minSpacing?: number; maxSpacing?: number; }; /** Whether to enable keyboard shortcuts for the editor. TODO docs @default false */ enableKbdShortcuts?: boolean; /** * Fires after each edit made to the score. * @param abc The updated ABC score * @param tuneObject The tuneObject returned by the abcjs rendering library. This object has useful * parsed information about the score, and can also be used to setup playback with the abcjs library. * For more info, see the abcjs docs: * [API of the returned object](https://paulrosen.github.io/abcjs/visual/render-abc-result.html) and * [setting up playback](https://paulrosen.github.io/abcjs/audio/synthesized-sound.html) */ onChange?: (abc: string, tuneObject: TuneObject) => void; }; export declare const EditorProvider: ({ children, ...props }: PuroReactProps & EditorProviderProps) => JSX.Element; declare interface EditorProviderProps { initialAbc?: string; abcjsOptions?: AbcVisualParams; chordTemplate?: string; enableKbdShortcuts?: boolean; onChange?: (abc: string, tuneObject: TuneObject) => void; } export declare function Keyboard({ startKey, endKey }: KeyboardProps): JSX_2.Element; declare type KeyboardProps = { startKey: number; endKey: number; }; /** The ABC score display. */ export declare function Score(): JSX_2.Element; export declare const useEditorContext: () => { currentCommands: { rhythm: Rhythm; rest: boolean; accidental: Accidental; dotted: boolean; beamed: boolean; triplet: boolean; showKeyboard: boolean; midiEnabled: boolean; }; dispatchCommand: Dispatch; setRenderDiv: (div: HTMLDivElement | null) => HTMLDivElement | null; onAddNote: (noteName: string | number) => void; onBackspace: () => void; onNewLine: () => void; }; export { }