UNPKG

js-tts-wrapper

Version:

A JavaScript/TypeScript library that provides a unified API for working with multiple cloud-based Text-to-Speech (TTS) services

83 lines (82 loc) 2.28 kB
/** * Environment detection and cross-platform utilities */ /** * Check if code is running in a browser environment */ export declare const isBrowser: boolean; /** * Check if code is running in a Node.js environment */ export declare const isNode: boolean; /** * File system utilities that work in both environments */ export declare const fileSystem: { /** * Read a file asynchronously * @param path Path to the file * @returns Promise resolving to the file contents as a string */ readFile: (path: string) => Promise<string>; /** * Read a file synchronously * @param path Path to the file * @returns File contents as a string */ readFileSync: (path: string) => string; /** * Write a file asynchronously * @param path Path to the file * @param data Data to write * @returns Promise resolving when the file is written */ writeFile: (path: string, data: string | Uint8Array) => Promise<void>; /** * Write a file synchronously * @param path Path to the file * @param data Data to write */ writeFileSync: (path: string, data: string | Uint8Array) => void; /** * Check if a file exists asynchronously * @param path Path to the file * @returns Promise resolving to true if the file exists, false otherwise */ exists: (path: string) => Promise<boolean>; /** * Check if a file exists synchronously * @param path Path to the file * @returns True if the file exists, false otherwise */ existsSync: (path: string) => boolean; }; /** * Path utilities that work in both environments */ export declare const pathUtils: { /** * Join path segments * @param paths Path segments to join * @returns Joined path */ join: (...paths: string[]) => string; /** * Get the directory name of a path * @param path Path * @returns Directory name */ dirname: (path: string) => string; /** * Get the base name of a path * @param path Path * @returns Base name */ basename: (path: string) => string; /** * Get the extension of a path * @param path Path * @returns Extension */ extname: (path: string) => string; };