ez-web-audio
Version:
Making the Web Audio API super EZ since 2024.
37 lines • 998 B
TypeScript
/**
* Debug message types and formatting utilities.
*
* @module debug/messages
*/
/**
* A debug message representing an event, connection change, or warning.
*/
export interface DebugMessage {
/** The type of debug message */
type: 'event' | 'connection' | 'warning';
/** Sound name or identifier */
source: string;
/** Human-readable message */
message: string;
/** Timestamp (audioContext.currentTime or Date.now()) */
timestamp: number;
/** Optional additional details */
details?: Record<string, unknown>;
}
/**
* Format a debug message for console output.
*
* @param msg - The debug message to format
* @returns Formatted string for logging
*
* @example
* formatDebugMessage({
* type: 'event',
* source: 'mySound',
* message: 'play',
* timestamp: 1.234
* })
* // Returns: "[ez-audio:event] [1.234] mySound: play"
*/
export declare function formatDebugMessage(msg: DebugMessage): string;
//# sourceMappingURL=messages.d.ts.map