/** Knobs for callers that confine something other than an existing file. */ export interface ConfineOptions { /** Refuse a path that does not exist yet. Default `true`. */ mustExist?: boolean; /** Accept a path equal to a root, not only one beneath it. Default `true`. */ allowRoot?: boolean; } /** Why {@link confineToRoots} refused a path. */ export type ConfineFailure = 'outside' | 'missing'; /** * Resolve `file` against the first of `roots` and accept it only if it lands * at or beneath one of them and exists. Every caller hands the result to * `launch-editor`, which spawns the developer's editor on it, so this is the * boundary that keeps a request from opening arbitrary files (absolute paths, * `../` traversal, a sibling directory that merely shares a root's prefix, a * symlink out of the tree). * Without roots nothing is allowed. */ export declare const confineToRoots: (roots: readonly string[], file: string, { mustExist, allowRoot }?: ConfineOptions) => { path: string; } | { failure: ConfineFailure; }; //# sourceMappingURL=confine.d.ts.map