import type { FlagView } from '../../../../commands/spec/flag_view.ts';
import type { RedirectResult } from '../../../../context/session_context.ts';
import type { DispatchFn } from '../../../../runtime/types.ts';
import type { FileStat, SetAttrFields } from '../../../../types.ts';
import { PathSpec } from '../../../../types.ts';
import type { MountView, NamespaceLinks } from '../../../../view/types.ts';
import type { NamespaceReader } from '../../../dispatcher/reader.ts';
import type { Namespace } from '../../../mount/namespace/namespace.ts';
import type { SessionState } from '../../../session/session.ts';
export declare function parseOwner(text: string): [number | string | null, number | string | null];
export declare function parseGroup(text: string): number | string | null;
export declare function parseTouchStamp(t: string | null, d: string | null): string | null;
export declare function nowIso(): string;
export declare function permissionError(cmd: string, action: string, name: string, err: unknown): string;
export declare function unreadError(cmd: string, name: string, err: unknown): string;
export declare function setattrVia(dispatch: DispatchFn, path: PathSpec, fields: SetAttrFields): Promise<void>;
export declare function setattrLink(dispatch: DispatchFn, path: PathSpec, fields: SetAttrFields): Promise<void>;
/**
 * Follow symlinks for one operand, collecting the ELOOP error. `action`
 * words the step that failed (`cannot access`, `cannot touch`, `setting
 * times of`). Mirrors Python's follow_operand.
 */
export declare function followOperand(links: NamespaceLinks, cmd: string, action: string, target: PathSpec, errors: string[]): PathSpec | null;
/**
 * Follow symlinks and stat one operand, collecting GNU's errors: the dots
 * the operand was typed with walk first, then the links, then the stat.
 * `links` is the session's link table (`Namespace.sessionLinks`). Mirrors
 * Python's resolve_operand.
 */
export declare function resolveOperand(links: NamespaceLinks, dispatch: DispatchFn, cmd: string, target: PathSpec, errors: string[]): Promise<[PathSpec, FileStat] | null>;
export declare function beforeRecursiveChange(mounts: MountView, dispatch: DispatchFn, root: PathSpec, cmd: string): Promise<void>;
export type WalkEntry = [PathSpec, FileStat, unknown];
export declare function walkStats(links: NamespaceReader, dispatch: DispatchFn, root: PathSpec, rootStat: FileStat): Promise<WalkEntry[]>;
export declare function walkOwned(links: NamespaceReader, dispatch: DispatchFn, root: PathSpec, rootStat: FileStat): Promise<{
    walked: WalkEntry[];
    owned: string[];
}>;
export declare function verbosity(fl: FlagView): string | null;
export declare function walkedName(typed: string, root: PathSpec, path: PathSpec): string;
export declare function followsLinks(cmd: string, fl: FlagView): [boolean, RedirectResult | null];
export declare function ownerSpec(user: string | null, group: string | null): string | null;
export declare function ownerLine(name: string, status: string, old: [string, string] | null, user: string | null, group: string | null): string;
/**
 * Set the owner and group of every operand, the way chown and chgrp do: -R
 * walks under an implicit -P, -h changes a link itself, -v and -c report,
 * -f drops the per-file errors. Mirrors Python's change_owner.
 */
export declare function changeOwner(namespace: Namespace, dispatch: DispatchFn, session: SessionState, cmd: string, fl: FlagView, operands: readonly PathSpec[], uid: number | string | null, gid: number | string | null): Promise<RedirectResult>;
//# sourceMappingURL=metadata.d.ts.map