import type { CellType, CellUpdateAttrsType, MarkdownCellType, CodeCellType, CellErrorType } from '@srcbook/shared'; import type { SessionType } from './types.mjs'; export declare function createSession(srcbookDir: string): Promise; export declare function deleteSessionByDirname(dirName: string): Promise; export declare function listSessions(): Promise>; export declare function addCell(session: SessionType, cell: MarkdownCellType | CodeCellType, index: number): Promise; export declare function updateSession(session: SessionType, updates: Partial, flush?: boolean): Promise; export declare function exportSrcmdFile(session: SessionType, destinationPath: string): Promise; export declare function findSession(id: string): Promise; type UpdateResultType = { success: true; cell: CellType; } | { success: false; errors: CellErrorType[]; }; /** * Use this to rename a code cell's filename. */ export declare function updateCodeCellFilename(session: SessionType, cell: CodeCellType, filename: string): Promise; export declare function updateCell(session: SessionType, cell: CellType, updates: CellUpdateAttrsType): Promise; export declare function sessionToResponse(session: SessionType): Pick; export declare function readPackageJsonContentsFromDisk(session: SessionType): Promise; export declare function findCell(session: SessionType, id: string): { id: string; type: "title"; text: string; } | { id: string; type: "markdown"; text: string; } | { id: string; type: "package.json"; status: "idle" | "running"; source: string; filename: "package.json"; } | { id: string; type: "code"; status: "idle" | "running"; source: string; filename: string; language: "typescript" | "javascript"; } | undefined; export declare function replaceCell(session: SessionType, cell: CellType): ({ id: string; type: "title"; text: string; } | { id: string; type: "markdown"; text: string; } | { id: string; type: "package.json"; status: "idle" | "running"; source: string; filename: "package.json"; } | { id: string; type: "code"; status: "idle" | "running"; source: string; filename: string; language: "typescript" | "javascript"; })[]; export declare function insertCellAt(session: SessionType, cell: CellType, index: number): ({ id: string; type: "title"; text: string; } | { id: string; type: "markdown"; text: string; } | { id: string; type: "package.json"; status: "idle" | "running"; source: string; filename: "package.json"; } | { id: string; type: "code"; status: "idle" | "running"; source: string; filename: string; language: "typescript" | "javascript"; })[]; export declare function removeCell(session: SessionType, id: string): ({ id: string; type: "title"; text: string; } | { id: string; type: "markdown"; text: string; } | { id: string; type: "package.json"; status: "idle" | "running"; source: string; filename: "package.json"; } | { id: string; type: "code"; status: "idle" | "running"; source: string; filename: string; language: "typescript" | "javascript"; })[]; export {}; //# sourceMappingURL=session.d.mts.map