import { type Stats } from 'node:fs'; import { PrivateArtifactPublicationConflictError } from './private-artifact-backend.js'; import { type DirectoryIdentity } from './private-path-identity.js'; export { PrivateArtifactPublicationConflictError }; export interface PrivateDirectoryReadSnapshot { readonly path: string; readonly stat: Stats; readonly ancestorIdentities: readonly DirectoryIdentity[]; } export type PrivateFileState = { readonly path: string; readonly exists: false; } | { readonly path: string; readonly exists: true; readonly stat: Stats; readonly contentSha256: string; }; export type PrivateFileReadSnapshot = { readonly state: Extract; } | { readonly state: Extract; readonly content: Buffer; }; export declare function ensurePrivateDirectory(directoryPath: string): void; export declare function repairPrivateDirectory(directoryPath: string): void; type PublicationGuardResult = boolean | { publish: boolean; content: string | Buffer; }; export declare function readRegularFileNoFollow(filePath: string, expectedStat: Stats): Buffer; export declare function readPrivateFileState(filePath: string): PrivateFileReadSnapshot; export declare function capturePrivateDirectoryReadSnapshot(directoryPath: string): PrivateDirectoryReadSnapshot; export declare function assertPrivateDirectoryReadSnapshot(snapshot: PrivateDirectoryReadSnapshot): void; export declare function publishPrivateDirectory(parentPath: string, stagingPath: string, targetPath: string, parentStat: Stats, stagingStat: Stats, targetStat: Stats | undefined): void; export declare function removePrivateDirectory(parentPath: string, stagingPath: string, parentStat: Stats, stagingStat: Stats): void; export declare function appendPrivateFile(filePath: string, content: string): void; export declare function writePrivateFile(filePath: string, content: string): void; export declare function writePrivateFileWithMode(filePath: string, content: string | Buffer, mode: number): void; export declare function writePrivateFileWithModeGuarded(filePath: string, content: string | Buffer, mode: number, publicationGuard: () => PublicationGuardResult): boolean; export declare function writePrivateFileWithModeExpected(filePath: string, content: string | Buffer, mode: number, expectedState: PrivateFileState): void; export declare function publishPrivateFileWithModeExpected(filePath: string, content: string | Buffer, mode: number, expectedState: PrivateFileState): Stats; export declare function writePrivateFileWithModeExpectedGuarded(filePath: string, content: string | Buffer, mode: number, expectedState: PrivateFileState, publicationGuard: () => PublicationGuardResult): boolean; export declare function writeNewPrivateFileWithMode(filePath: string, content: string | Buffer, mode: number): void; //# sourceMappingURL=private-file.d.ts.map