export declare class FileUtils { /** * Determine if the `subjectPath` contains and also ends with the test path * @param subjectPath the path that `testPath` should be found within * @param testPath the path that the `subjectPath` should end with */ pathEndsWith(subjectPath: string, testPath: string): boolean; /** * Determines if the `subject` path includes `search` path, with case sensitive comparison * @param subject * @param search */ pathIncludesCaseInsensitive(subject: string, search: string): boolean; /** * Replace the first instance of `search` in `subject` with `replacement` */ replaceCaseInsensitive(subject: string, search: string, replacement: string): string; /** * Given a `directoryPath`, find and return all file paths relative to the `directoryPath` * @param directoryPath */ getAllRelativePaths(directoryPath: string): Promise; /** * Given a partial file path (truncated path from Roku telnet console), * search through the staging directory and find any paths that appear to * match the partial file path * @param partialFilePath the partial file path to search for * @param directoryPath the path to the directory to search through * @returns a relative path to the first match found in the directory */ findPartialFileInDirectory(partialFilePath: string, directoryPath: string): Promise; /** * The Roku telnet debugger truncates file paths, so this removes that leading truncation piece. * This removes 0 or more leading dots, followed by 0 or more leading slashes * @param filePath */ removeFileTruncation(filePath: string): string; /** * Given a relative file path, and a list of directories, find the first directory that contains the relative file. * This is basically a utility function for the sourceDirs concept * @param relativeFilePath - the path to the item relative to each `directoryPath` * @param directoryPaths - an array of directory paths * @returns the first path that was found to exist, or undefined if the file was not found in any of the `directoryPaths` */ findFirstRelativeFile(relativeFilePath: string, directoryPaths: string[]): Promise; /** * Determine if the filename ends with one of the specified extensions */ hasAnyExtension(fileName: string, extensions: string[]): boolean; /** * Given a path to a directory, and an absolute path to a file, * get the relative file path (relative to the containingFolderPath) */ getRelativePath(containingFolderPath: string, filePathAbsolute: string): string; /** * Find the first `directoryPath` that is a parent to `filePathAbsolute` * @param filePathAbsolute - the absolute path to the file * @param directoryPaths - a list of directories where this file might reside */ findFirstParent(filePathAbsolute: string, directoryPaths: string[]): string; /** * Find the number at the end of component library prefix at the end of the file. * (i.e. "pkg:/source/main_lib1.brs" returns 1) * All files in component libraries are renamed to include the component library index as the ending portion of the filename, * which is necessary because the Roku debugger doesn't tell you which component library a file came from. */ getComponentLibraryIndexFromFileName(filePath: string, postfix: string): number; /** * Append a postfix to the filename BEFORE its file extension */ postfixFilePath(filePath: string, postfix: string, fileExtensions: string[]): string; /** * Given a file path, return a new path with the component library postfix removed */ unPostfixFilePath(filePath: string, postfix: string): string; /** * Replace all directory separators with current OS separators, * force all drive letters to lower case (because that's what VSCode does sometimes so this makes it consistent) * @param thePath */ standardizePath(thePath: string): string; /** * Force the drive letter to lower case * @param fullPath */ driveLetterToLower(fullPath: string): string; /** * Get a file url for a file path (i.e. file:///C:/projects/Something or file:///projects/something * @param fullPath */ getFileProtocolPath(fullPath: string): string; /** * Given a path to a folder, search all files until an entry point is found. * (An entry point is a function that roku uses as the Main function to start the program). * @param projectPath - a path to a Roku project */ findEntryPoint(projectPath: string): Promise<{ relativePath: string; pathAbsolute: string; contents: string; lineNumber: number; }>; /** * If a string has a leading slash, remove it */ removeLeadingSlash(thePath: string): string; /** * If a string has a trailing slash, remove it */ removeTrailingSlash(thePath: string): string; } export declare let fileUtils: FileUtils; /** * A tagged template literal function for standardizing the path. */ export declare function standardizePath(stringParts: any, ...expressions: any[]): string;