/** * Shared utilities for builtin tools */ /** * Type guard for Node.js errors with code property */ export declare function isNodeError(error: unknown): error is NodeJS.ErrnoException; /** * Get the file extension from a path, including the leading dot. * Returns empty string if no extension found. * * @example * getExtension('/path/to/file.ts') // returns '.ts' * getExtension('/path/to/file') // returns '' * getExtension('/path/to/.gitignore') // returns '' (dotfile, not extension) */ export declare function getExtension(filePath: string): string; /** * Check if a file extension is in the allowed list. * Handles both formats: ['.ts', '.js'] or ['ts', 'js'] */ export declare function isExtensionAllowed(filePath: string, allowedExtensions: string[]): boolean; /** * Write a file atomically by writing to a temp file first, then renaming. * This prevents file corruption if the write is interrupted. */ export declare function atomicWriteFile(filePath: string, content: string, encoding?: BufferEncoding): Promise;