/// import type Logger from '@matrixai/logger'; import type { ContextTimed } from '@matrixai/contexts'; import type { Stat } from 'encryptedfs'; import type { Vault } from './Vault.js'; import type { FileSystem } from '../types.js'; type FileOptions = { recursive?: boolean; }; /** * Adds a secret to the vault */ declare function addSecret(vault: Vault, secretName: string, content: Buffer | string, logger?: Logger, ctx?: ContextTimed): Promise; /** * Changes the name of a secret in a vault */ declare function renameSecret(vault: Vault, secretName: string, secretNameNew: string, logger?: Logger, ctx?: ContextTimed): Promise; /** * Returns the contents of a secret */ declare function getSecret(vault: Vault, secretName: string): Promise; /** * Returns the file stats of a secret */ declare function statSecret(vault: Vault, secretName: string): Promise; /** * Removes a secret from a vault */ declare function deleteSecret(vault: Vault, secretName: string, fileOptions?: FileOptions, logger?: Logger, ctx?: ContextTimed): Promise; /** * Adds an empty directory to the root of the vault. Note that efs does not * track empty directories. */ declare function mkdir(vault: Vault, dirPath: string, fileOptions?: FileOptions, logger?: Logger, ctx?: ContextTimed): Promise; /** * Adds a secret directory to the vault */ declare function addSecretDirectory(vault: Vault, secretDirectory: string, fs?: FileSystem, logger?: Logger, ctx?: ContextTimed): Promise; /** * Retrieves a list of the secrets in a vault */ declare function listSecrets(vault: Vault): Promise; /** * Changes the contents of a secret. Creates a new file if it doesn't exist. */ declare function writeSecret(vault: Vault, secretName: string, content: Buffer | string, logger?: Logger, ctx?: ContextTimed): Promise; /** * Performs a touch operation on a secret by updating all it's timestamps to the * current time. */ declare function touchSecret(vault: Vault, secretName: string, ctx?: ContextTimed): Promise; export { addSecret, renameSecret, getSecret, statSecret, deleteSecret, mkdir, addSecretDirectory, listSecrets, writeSecret, touchSecret, };