import type { AppState } from "../utils.js";
interface PathQuery {
    volume?: string;
    path: string;
}
interface ListQuery {
    volume?: string;
    path?: string;
}
interface FindQuery {
    volume?: string;
    path?: string;
    pattern: string;
    limit?: number;
}
interface WriteBody {
    volume?: string;
    path: string;
    content: string;
    create_dirs?: boolean;
}
interface RemoveBody {
    volume?: string;
    path: string;
    recursive?: boolean;
}
interface MkdirBody {
    volume?: string;
    path: string;
    recursive?: boolean;
}
interface MoveCopyBody {
    volume?: string;
    from: string;
    to: string;
    create_dirs?: boolean;
}
export declare function fsList(state: AppState, q: ListQuery): Promise<import("../utils.js").ApiEnvelope<{
    name: string;
    path: string;
    relativePath: string;
    is_dir: boolean;
    size: number;
    created_at: string | null;
    modified_at: string | null;
}[]>>;
export declare function fsRead(state: AppState, q: PathQuery): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
    content: string;
}>>;
/**
 * Read a file as raw binary Buffer (for serving images, PDFs, etc.).
 * Unlike fsRead which returns UTF-8 text inside JSON, this returns { path, buffer }
 * so the HTTP layer can stream the raw bytes with the correct Content-Type.
 */
export declare function fsDownload(state: AppState, q: PathQuery): Promise<{
    path: string;
    buffer: Buffer;
}>;
export declare function fsStat(state: AppState, q: PathQuery): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
    is_dir: boolean;
    size: number;
    created_at: string | null;
    modified_at: string | null;
}>>;
export declare function fsExists(state: AppState, q: PathQuery): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
    exists: boolean;
}>>;
export declare function fsFind(state: AppState, q: FindQuery): Promise<import("../utils.js").ApiEnvelope<{
    name: string;
    path: string;
    is_dir: boolean;
    size: number;
}[]>>;
export declare function fsWrite(state: AppState, body: WriteBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
    content: string;
}>>;
export declare function fsAppend(state: AppState, body: WriteBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
}>>;
export declare function fsMkdir(state: AppState, body: MkdirBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
}>>;
export declare function fsRemove(state: AppState, body: RemoveBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
}>>;
export declare function fsMove(state: AppState, body: MoveCopyBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
}>>;
export declare function fsCopy(state: AppState, body: MoveCopyBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
}>>;
export interface UploadedFile {
    fieldname: string;
    filename: string;
    path: string;
    size: number;
}
export interface UploadResult {
    files: UploadedFile[];
}
/**
 * Handle multipart/form-data file upload.
 * Expects form field "path" for target directory and one or more "file" parts.
 */
export declare function fsUpload(state: AppState, parts: {
    fields: Record<string, string>;
    files: Array<{
        filename: string;
        data: Buffer;
    }>;
}): Promise<import("../utils.js").ApiEnvelope<{
    files: UploadedFile[];
}>>;
interface WriteFromUrlBody {
    volume?: string;
    path: string;
    url: string;
    create_dirs?: boolean;
    timeout_ms?: number;
    idle_timeout_ms?: number;
    headers?: Record<string, string>;
}
/**
 * Stream a remote URL into a file under the volume root.
 * The daemon fetches the URL itself and pipes the body to a temp file,
 * then renames to the final path. No buffering of the full body.
 */
export declare function fsWriteFromUrl(state: AppState, body: WriteFromUrlBody): Promise<import("../utils.js").ApiEnvelope<{
    path: string;
    size: number;
    contentType: string | null;
}>>;
export {};
//# sourceMappingURL=fs.d.ts.map