beepody
Version:
Beep melody utilities.
73 lines • 1.67 kB
TypeScript
/**
* @class Beep utility
* @name Beep
*/
export declare class Beep {
frequency: number;
length: number;
repeats: number;
/**
* Initialize a beep.
*/
constructor(frequency?: number, length?: number, repeats?: number);
/**
* The text representation.
*/
toString(): string;
}
/**
* @class Beep sequence
* @name BeepSequence
*/
export declare class BeepSequence {
beeps: Beep[];
tempo: number;
/**
* Initialize a beep sequence.
*/
constructor(beeps: Beep[]);
/**
* Return the URL hash for the sequence.
* Each note is "frequency (Hz), length (ms), repeats" separated by "|", with defaults (440 200 1).
* Notes are separated by ",".
*/
toHash(): string;
/**
* Return the `beep` command.
*/
toBeepCommand(): string;
/**
* Return the GRUB init tune.
*/
toGRUBInitTune(): string;
/**
* The text representation.
*/
toString(): string;
/**
* The length of the playtime in seconds.
*/
lengthInSeconds(): number;
}
/**
* Play a beep sequence to the browser audio.
*/
export declare const playBeepSequence: (bs: BeepSequence) => void;
/**
* Play the default beep.
*/
export declare const playDefaultBeep: () => void;
/**
* Parse a Linux "beep" command.
*/
export declare const parseBeepCommand: (s: string) => BeepSequence;
/**
* Parse a Grub init tune "play" line.
*/
export declare const parseGRUBInitTune: (s: string) => BeepSequence;
/**
* Parse a beep sequence hash.
*/
export declare const parseBeepHash: (s: string) => BeepSequence;
export default Beep;
//# sourceMappingURL=Beep.d.ts.map