export declare class MediaKeyError extends Error { constructor(message: string); } /** * Resolve a caller-supplied media key against the configured mediaRoot. * * @throws {MediaKeyError} when the key is empty, absolute, contains a NUL * byte, uses path traversal, or escapes mediaRoot. */ export declare function resolveKey(mediaRoot: string, rawKey: unknown, options?: { decode?: boolean; }): string; /** * Resolve a caller-supplied listing directory into a relative prefix. * * The directory is optional: an empty / root directory returns `''` (list the * mediaRoot itself). Otherwise leading/trailing slashes are stripped (matching * the historical handler behaviour) and the result is normalised so it cannot * traverse upward — `path.join(mediaRoot, directory)` would otherwise collapse * `..` and list objects outside mediaRoot. Returns a prefix with a trailing * slash so it can be joined onto mediaRoot directly. * * @throws {MediaKeyError} when the directory contains a NUL byte or backslash, * or uses upward path traversal. */ export declare function resolveDirectory(rawDirectory: unknown): string;