@push.rocks/smartbucket
Version:
A TypeScript library providing a cloud-agnostic interface for managing object storage with functionalities like bucket management, file and directory operations, and advanced features such as metadata handling and file locking.
58 lines (57 loc) • 1.46 kB
TypeScript
import * as plugins from './plugins.js';
import { File } from './classes.file.js';
export declare class MetaData {
static hasMetaData(optionsArg: {
file: File;
}): Promise<boolean>;
static createForFile(optionsArg: {
file: File;
}): Promise<MetaData>;
/**
* the file that contains the metadata
*/
metadataFile: File;
/**
* the file that the metadata is for
*/
fileRef: File;
getFileType(optionsArg?: {
useFileExtension?: boolean;
useMagicBytes?: boolean;
}): Promise<plugins.smartmime.IFileTypeResult | undefined>;
/**
* gets the size of the fileRef
*/
getSizeInBytes(): Promise<number>;
private prefixCustomMetaData;
storeCustomMetaData<T = any>(optionsArg: {
key: string;
value: T;
}): Promise<void>;
getCustomMetaData<T = any>(optionsArg: {
key: string;
}): Promise<T>;
deleteCustomMetaData(optionsArg: {
key: string;
}): Promise<void>;
/**
* set a lock on the ref file
* @param optionsArg
*/
setLock(optionsArg: {
lock: string;
expires: number;
}): Promise<void>;
/**
* remove the lock on the ref file
* @param optionsArg
*/
removeLock(optionsArg: {
force: boolean;
}): Promise<void>;
checkLocked(): Promise<boolean>;
getLockInfo(): Promise<{
lock: string;
expires: number;
}>;
}