import { type RouteContext, type RouteResult } from "./routes.js";
import type { UiHandlerDeps } from "./deps.js";
import type { UiStore } from "./store/index.js";
export interface FilesDirectoryRoot {
    readonly label: string;
    readonly path: string;
}
export interface FilesDirectoryEntry {
    readonly name: string;
    readonly path: string;
}
export interface FilesDirectoryListing {
    readonly path: string;
    readonly parent: string | null;
    readonly entries: readonly FilesDirectoryEntry[];
    readonly roots: readonly FilesDirectoryRoot[];
}
export type FilesEntryKind = "directory" | "file" | "symlink";
export interface FilesTreeEntry {
    readonly name: string;
    readonly path: string;
    readonly kind: FilesEntryKind;
    readonly sizeBytes: number;
    readonly modifiedAt: number;
    readonly extension: string | null;
    readonly symlink: boolean;
    readonly readable: boolean;
}
export interface FilesTreeResponse {
    readonly root: string;
    readonly path: string;
    readonly entries: readonly FilesTreeEntry[];
    readonly truncated: boolean;
}
interface FilesPreviewBase {
    readonly root: string;
    readonly path: string;
    readonly name: string;
    readonly sizeBytes: number;
    readonly modifiedAt: number;
    readonly extension: string | null;
    readonly mime: string;
    readonly symlink: boolean;
}
export type FilesPreviewResponse = (FilesPreviewBase & {
    readonly kind: "text";
    readonly content: string;
    readonly truncated: boolean;
    readonly maxBytes: number;
}) | (FilesPreviewBase & {
    readonly kind: "image";
    readonly dataUrl: string;
    readonly maxBytes: number;
}) | (FilesPreviewBase & {
    readonly kind: "binary";
    readonly reason: "unsupported" | "too_large";
    readonly maxBytes?: number | undefined;
});
export declare function listFilesDirectories(store: UiStore, rootInput: string | null, pathInput?: string): Promise<FilesDirectoryListing>;
export declare function readFilesTree(store: UiStore, rootInput: string | null, pathInput: string | null): Promise<FilesTreeResponse>;
export declare function readFilesPreview(store: UiStore, rootInput: string | null, pathInput: string | null, redactor: UiHandlerDeps["redactor"]): Promise<FilesPreviewResponse>;
export declare function handleFilesDirectories(ctx: RouteContext, deps: UiHandlerDeps): Promise<RouteResult>;
export declare function handleFilesTree(ctx: RouteContext, deps: UiHandlerDeps): Promise<RouteResult>;
export declare function handleFilesPreview(ctx: RouteContext, deps: UiHandlerDeps): Promise<RouteResult>;
export {};
//# sourceMappingURL=files.d.ts.map