/** * The metadata class used for {@link Piece}s. */ declare class PieceLocation { /** * The full path to the file. */ readonly full: string; /** * The root directory the file was found from. */ readonly root: string; /** * @param full The full path to the file. * @param root The root directory the file was found from. */ constructor(full: string, root: string); /** * Whether the file is virtual or not. */ get virtual(): boolean; /** * The relative path between {@link PieceLocation.root} and {@link PieceLocation.full}. * @example * ```typescript * const location = new PieceLocation( * '/usr/src/app/commands', * '/usr/src/app/commands/general/ping.js' * ); * * console.log(location.relative); * // → 'general/ping.js' * ``` */ get relative(): string; /** * The names of the directories that separate {@link PieceLocation.root} and {@link PieceLocation.full}. * @example * ```typescript * const location = new PieceLocation( * '/usr/src/app/commands', * '/usr/src/app/commands/games/multiplayer/connect-four.js' * ); * * console.log(location.directories); * // → ['games', 'multiplayer'] * ``` */ get directories(): string[]; /** * The name and extension of the file that was loaded, extracted from {@link PieceLocation.full}. * @example * ```typescript * const location = new PieceLocation( * '/usr/src/app/commands', * '/usr/src/app/commands/games/multiplayer/connect-four.js' * ); * * console.log(location.name); * // → 'connect-four.js' * ``` */ get name(): string; /** * Defines the `JSON.stringify` behavior of this structure. */ toJSON(): PieceLocationJSON; } /** * The return type of {@link PieceLocation.toJSON}. */ interface PieceLocationJSON { directories: string[]; full: string; name: string; relative: string; root: string; } export { PieceLocation, type PieceLocationJSON };