git-documentdb
Version:
Offline-first database that syncs with Git
37 lines • 1.58 kB
TypeScript
/**
* GitDocumentDB
* Copyright (c) Hidekazu Kubota
*
* This source code is licensed under the Mozilla Public License Version 2.0
* found in the LICENSE file in the root directory of gitDDB source tree.
*/
import { PutOptions, PutResult } from '../types';
import { GitDDBInterface } from '../types_gitddb';
/**
* Common implementation of put-like commands.
*
* @throws {@link Err.DatabaseClosingError}
* @throws {@link Err.RepositoryNotOpenError}
* @throws {@link Err.TaskCancelError}
*
* @throws # Errors from putWorker
* @throws {@link Err.UndefinedDBError}
* @throws {@link Err.CannotCreateDirectoryError}
* @throws {@link Err.SameIdExistsError}
* @throws {@link Err.DocumentNotFoundError}
* @throws {@link Err.CannotWriteDataError}
*
* @internal
*/
export declare function putImpl(gitDDB: GitDDBInterface, collectionPath: string, shortId: string | undefined, shortName: string, data: Uint8Array | string, options?: PutOptions): Promise<Pick<PutResult, 'commit' | 'fileOid' | 'name'>>;
/**
* Add and commit a file
*
* @throws {@link Err.UndefinedDBError}
* @throws {@link Err.CannotCreateDirectoryError}
* @throws {@link Err.SameIdExistsError}
* @throws {@link Err.DocumentNotFoundError}
* @throws {@link Err.CannotWriteDataError}
*/
export declare function putWorker(gitDDB: GitDDBInterface, collectionPath: string, shortName: string, data: Uint8Array | string, commitMessage: string, insertOrUpdate?: 'insert' | 'update'): Promise<Pick<PutResult, 'commit' | 'fileOid' | 'name'>>;
//# sourceMappingURL=put.d.ts.map