import type { ExecutionEnv } from "../internal/harness-types.js";
import { type PathFamily } from "../tools/fs/safety.js";
/**
 * What the reader learned of a leaf symlink chain: the hops (`ok` — `[]` only when the environment was asked and
 * answered that there are none), or that no hop could be read (`ok: false`). `asked` separates a fact about the
 * environment (it was asked and could not answer) from a chain nobody asked about (no `canonicalChain` declared, or a
 * spelling it does not walk).
 */
export type ChainHopsReading = {
    readonly ok: true;
    readonly hops: readonly string[];
} | {
    readonly ok: false;
    readonly cause: string;
    readonly asked: boolean;
};
/**
 * The leaf symlink chain of `path` — the ONE place where a chain read becomes "read" or "not read". The spelling is
 * anchored as the canonicalizer anchors it (`baseCwd`). A refused namespace spelling and a win-form UNC spelling are
 * not walked (the reference CLI's variant set stops at a network spelling); the share is recognized by the throat's
 * own `isUncSpelling`. Each caller holds its own posture on `ok: false`: a path guard (deny side) lets a view that
 * cannot answer not vote ({@link chainHopsOrNone}), an allow admits nothing it could not see.
 */
export declare function symlinkChainHops(env: ExecutionEnv, path: string, signal: AbortSignal | undefined, family: PathFamily, baseCwd?: string): Promise<ChainHopsReading>;
/**
 * Whether a target's leaf chain can hold a hop, once the environment said where the target lands: a link may be on the way
 * when what was walked climbs a `..` (the lexical fold of `..` across a linked parent names another file than the one the
 * filesystem walks to) or when the reader cannot say the target landed at its own lexical spelling (`landedElsewhere`: a
 * link resolved elsewhere, or a resolution that rejoined a missing tail as spelled — the leaf may be a link whose target is
 * not there yet). Where neither holds nothing on the way is a link, and the chain is not asked. The readers that skip the chain where no
 * link can be on the way take this one gate before {@link symlinkChainHops}: a call's target views (`readPath`) and the shell read
 * station's establishment. The write-protection table and the sensitive-path deny set do not: they read the chain whenever one of
 * their rows can hear a hop.
 */
export declare function leafChainMayHold(walked: readonly (string | undefined)[], landedElsewhere: boolean, family: PathFamily): boolean;
/** A path guard's reading of a chain: the hops, or none — a view that cannot answer does not vote (its absence law). */
export declare function chainHopsOrNone(reading: ChainHopsReading): readonly string[];
