/** * Splits a file path into its directory, name, and extension components. * Preserves the original path separator style (Windows backslashes or Unix forward slashes). * @param filePath - The full file path to split * @returns An object containing the directory path, file name (without extension), extension, and full filename * @example * splitFilePath("path/to/file.txt") // returns { dir: "path/to", name: "file", ext: "txt", filename: "file.txt" } * splitFilePath("C:\\Users\\file.txt") // returns { dir: "C:\\Users", name: "file", ext: "txt", filename: "file.txt" } */ export declare function splitFilePath(filePath: string): { dir: string; name: string; ext: string; filename: string; }; /** * Converts a filename into a valid column or table name for database use. * - Removes file extension * - Replaces invalid characters with underscores * - Ensures the name starts with a letter or underscore * - Truncates to max length of 63 characters * * @param filename - The original filename to convert * @returns A valid table/column name * @example * convertToValidColumnOrTableName("my-file.csv") // returns "my_file" * convertToValidColumnOrTableName("123data.csv") // returns "_123data" */ export declare function convertToValidColumnOrTableName(filename: string): string; /** * Converts a filename into a valid and unique column or table name for database use. * - Removes file extension * - Replaces invalid characters with underscores * - Ensures the name starts with a letter or underscore * - Truncates to max length of 63 characters * - Ensures uniqueness among existing names * * @param filename - The original filename to convert * @param existingTables - Optional array of existing table names to ensure uniqueness * @returns A valid and unique table/column name * @example * convertToUniqueColumnOrTableName("my-file.csv") // returns "my_file" * convertToUniqueColumnOrTableName("123data.csv") // returns "_123data" */ export declare function convertToUniqueColumnOrTableName(filename: string, existingTables?: string[]): string; /** * Generates a unique name by appending a numeric suffix if the name already exists. * @param name - The base name to make unique * @param usedNames - Optional array of existing names to check against * @returns A unique name, potentially with a numeric suffix * @example * generateUniqueName("table", ["table"]) // returns "table_1" * generateUniqueName("table_1", ["table_1"]) // returns "table_2" * generateUniqueName("Notebook", ["Notebook 1"], " ") // returns "Notebook 2" */ export declare function generateUniqueName(name: string, usedNames?: string[], separator?: string): string; /** * Generates a unique file path by appending a numeric suffix if the path already exists. * @param filePath - The original file path * @param existingPaths - Array of existing file paths to check against * @returns A unique file path * @example * generateUniquePath("file.txt", ["file.txt"]) // returns "file_1.txt" */ export declare function generateUniquePath(filePath: string, existingPaths: string[]): string; /** * Converts a string into a valid and unique S3 object name. * - Replaces special characters with underscores * - Ensures name is within S3's length limits * - Ensures uniqueness among existing objects * * @param str - The string to convert into an S3 object name * @param existingObjects - Optional array of existing S3 object names to ensure uniqueness * @returns A valid and unique S3 object name * @example * convertToUniqueS3ObjectName("my file.txt") // returns "my_file.txt" */ export declare function convertToUniqueS3ObjectName(str: string, existingObjects?: string[]): string; /** * Converts a string into a valid and unique S3 folder path. * - Ensures the path ends with a forward slash * - Replaces special characters with underscores * - Ensures uniqueness among existing paths * * @param str - The string to convert into an S3 folder path * @param existingObjects - Optional array of existing S3 paths to ensure uniqueness * @returns A valid and unique S3 folder path ending with a forward slash * @example * convertToUniqueS3FolderPath("my folder") // returns "my_folder/" */ export declare function convertToUniqueS3FolderPath(str: string, existingObjects?: string[]): string; //# sourceMappingURL=filepaths.d.ts.map