import type { KeyboardOptions, State, Note, Keymap, SpecialKey, SpecialKeymap } from './types'; export declare const onKeyDown: import("rxjs").Observable; export declare const onKeyUp: import("rxjs").Observable; export declare const onSpecialKey: import("rxjs").Observable; export declare const activeKeys: import("nanostores").WritableAtom; export declare class QwertyKeyboard { state: State; private _rows; /** * How many octaves to display. */ get rows(): 1 | 2; set rows(rows: 1 | 2); /** * A map of the computer keyboard keys to their corresponding piano {@link Key Keys}. */ _keymap: Keymap; get keys(): Keymap; set keys(keys: Keymap); /** * All white keys in the keys. */ whiteKeys: Keymap; /** * All the black keys in the keys. */ blackKeys: Keymap; /** * Maps Z and X to octave up and down, respectively, and * maps numbers 1-9 and 0 to velocity 1-127. */ specialKeyMap: SpecialKeymap; /** * An observable that emits the current {@link Note} being pressed. */ onKeyDown?: import("rxjs").Observable | undefined; /** * An observable that emits the current {@link Note} being released. */ onKeyUp?: import("rxjs").Observable | undefined; /** Internal rxjs keyDown Subject */ private keyDown; /** Internal rxjs keyUp Subject */ private keyUp; constructor(options?: Partial); static defaultState(): State; protected keypressActive: boolean; keypress(e: KeyboardEvent): void; protected keyupActive: boolean; keyup(e: KeyboardEvent): void; protected blurActive: boolean; blur(): void; protected addListeners(): void; dispose(): void; private get root(); /** `map` returns the midi note for a given keyCode. */ private getMidiNote; private offset; /** `isNote` determines whether a keyCode is a note or not. */ private isNote; /** * Convert a midi note to a frequency. We assume that `map` has * already been called (to account for a potential rootNote offset) */ private toFrequency; press(code: KeyboardEvent['code']): void; release(code: KeyboardEvent['code']): void; /** * Creates a {@link Note} object from a keyboard event. */ private addKey; private removeKey; private isPressed; private makeNote; /** * Releases all active notes. */ clear(): void; /** * Compares the `keys` array to the `buffer` array * which is the , makes the necessary changes to `buffer` and * triggers any events that need triggering. */ private update; private diff; private prioritize; /** * Sets the last bunch to active based on the polyphony. */ private last; /** * Sets the last bunch to active based on the polyphony. */ first(): void; /** * Get the highest notes and set them to active */ highest(): void; /** * Get the lowest notes and set them to active */ lowest(): void; private isSpecialKey; private specialKey; }