/// import type { EncryptedFS } from 'encryptedfs'; import type { VaultRef, VaultAction, CommitId, FileSystemReadable, FileSystemWritable } from './types.js'; import type { NodeId } from '../ids/types.js'; import { tagLast, refs } from './types.js'; /** * Vault history is designed for linear-history. * The canonical branch represents the one and only true timeline. * In the future, we can introduce non-linear history where branches are * automatically made when new timelines are created. */ declare const canonicalBranch = "master"; declare const canonicalBranchRef: string; /** * Vault reference can be HEAD, any of the special tags, or a commit ID. */ declare function validateRef(ref: any): ref is VaultRef; declare function assertRef(ref: any): asserts ref is VaultRef; /** * Commit IDs are SHA1 hashes encoded as 40-character long lowercase * hexadecimal strings. */ declare function validateCommitId(commitId: any): commitId is CommitId; declare function commitAuthor(nodeId: NodeId): { name: string; email: string; }; declare function readDirRecursively(fs: any, dir?: string): AsyncGenerator; declare function walkFs(efs: FileSystemReadable, path?: string): AsyncGenerator; declare function isVaultAction(action: any): action is VaultAction; declare function parseVaultAction(data: any): VaultAction; declare function deleteObject(fs: EncryptedFS, gitdir: string, ref: string): Promise; declare function mkdirExists(efs: FileSystemWritable, directory: string): Promise; /** * Converts a `Buffer` to a `Uint8Array` without copying the contents. */ declare function bufferToUint8ArrayCopyless(data: Buffer): Uint8Array; /** * Converts a `Uint8Array` to a `Buffer` without copying the contents. */ declare function uint8ArrayToBufferCopyless(data: Uint8Array): Buffer; /** * Concatenates `Buffers` or `Uint8Array`s into a `Uint8Array`. */ declare function uint8ArrayConcat(list: Array): Uint8Array; export { tagLast, refs, canonicalBranch, canonicalBranchRef, validateRef, assertRef, validateCommitId, commitAuthor, isVaultAction, parseVaultAction, readDirRecursively, walkFs, deleteObject, mkdirExists, bufferToUint8ArrayCopyless, uint8ArrayToBufferCopyless, uint8ArrayConcat, }; export { createVaultIdGenerator, encodeVaultId, decodeVaultId, } from '../ids/index.js';