/** * Represents an array of strings or numbers that represents a path. */ type PathArray = (string | number)[]; /** * Represents a type that can be either a `PathArray` or a string. */ export type PathArrayableType = PathArray | string; /** * Represents a path that can be converted to an array or a string. */ export default class PathArrayable { path: PathArrayableType; constructor(path: PathArrayableType); /** * Sanitises the path by expanding, trimming, and filtering its elements. * If the path is a string, it expands it and then sanitises it. * If the path is an object, it trims and filters each element. * @returns A new sanitized PathArrayable object. * @throws {Error} If the path is of an invalid type. */ sanitise(): PathArrayable; /** * Condenses the path into a PathArrayable object. * If the path is an array, it joins the elements with '/' separator. * If the path is a string, it returns a new PathArrayable object with the same path. * * @returns A new PathArrayable object with the condensed path. */ condense(): PathArrayable; /** * Returns the condensed path as a string. * @returns The condensed path as a string. */ condenseEnd(): string; /** * Expands the path into a PathArrayable object. * If the path is a string, it splits it by '/' and returns a new PathArrayable object. * If the path is already an array, it returns a new PathArrayable object with the same path. * @returns A new PathArrayable object representing the expanded path. */ expand(): PathArrayable; /** * Expands the path and returns the expanded path as an array. * @returns The expanded path as an array. */ expandEnd(): PathArray; /** * Returns the path as an array if it is not empty, otherwise returns null. * @returns The path as an array or null. */ getNullablePath(): PathArrayableType | null; /** * Appends the given path to the current path. * * @param path - The path to append. * @returns A new `PathArrayable` instance with the appended path. */ append(path: PathArrayableType): PathArrayable; } export {}; //# sourceMappingURL=Path.d.ts.map