@itwin/presentation-testing
Version:
Testing utilities for iTwin.js Presentation library
47 lines • 1.91 kB
TypeScript
import { LocalFileName } from "@itwin/core-common";
/**
* Get the output directory used by `setupOutputFileLocation` utility.
* @public
*/
export declare function getTestOutputDir(): string;
/**
* Set the output directory used by `setupOutputFileLocation` utility.
* @public
*/
export declare function setTestOutputDir(directoryPath: string | undefined): void;
/**
* Prepare for an output file path by:
* - Resolving the output file name under the known test output directory (see `getTestOutputDir` & `setTestOutputDir`).
* - Making sure the output directories exist.
* - Removing a previous copy of the output file.
*
* @param fileName Name of output file. The actual file name may get modified to fit within the file system limits.
*
* @public
*/
export declare function setupOutputFileLocation(fileName: string): LocalFileName;
/**
* An utility to create a valid file name from any string. Sanitizes all invalid characters,
* replaces spaces with `-`, makes everything lower case.
*
* @public
*/
export declare function createFileNameFromString(str: string): string;
/**
* `itwinjs-core` creates some accompanying files for each iModels and their names are formed by appending
* a suffix to iModel file name. This constant should account for the maximum suffix length.
* @internal
*/
export declare const FILE_PATH_RESERVED_CHARACTERS = 13;
/**
* An utility to make sure file path is shorter than 260 characters.
*
* 1. Takes a full file path, splits into directory and file name parts.
* 2. If the path is already short enough, returns it.
* 3. Else, calculates tha max allowed file name length, and shortens the file name by replacing the middle part with `...`.
* 4. Joins back the directory with the shortened file name and returns it.
*
* @public
*/
export declare function limitFilePathLength(filePath: string): string;
//# sourceMappingURL=FilenameUtils.d.ts.map