@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.
66 lines (65 loc) • 1.78 kB
TypeScript
/// <reference types="node" resolution-mode="require"/>
import * as plugins from './smartbucket.plugins.js';
import { Bucket } from './smartbucket.classes.bucket.js';
import { File } from './smartbucket.classes.file.js';
export declare class Directory {
bucketRef: Bucket;
parentDirectoryRef: Directory;
name: string;
tree: string[];
files: string[];
folders: string[];
constructor(bucketRefArg: Bucket, parentDiretory: Directory, name: string);
/**
* returns an array of parent directories
*/
getParentDirectories(): Directory[];
/**
* returns the directory level
*/
getDirectoryLevel(): number;
/**
* updates the base path
*/
getBasePath(): string;
/**
* lists all files
*/
listFiles(): Promise<File[]>;
/**
* lists all folders
*/
listDirectories(): Promise<Directory[]>;
/**
* gets an array that has all objects with a certain prefix;
*/
getTreeArray(): Promise<void>;
/**
* gets a sub directory
*/
getSubDirectoryByName(dirNameArg: string): Promise<Directory>;
/**
* moves the directory
*/
move(): Promise<void>;
/**
* creates a file within this directory
* @param relativePathArg
*/
createEmptyFile(relativePathArg: string): Promise<void>;
fastPut(optionsArg: {
path: string;
contents: string | Buffer;
}): Promise<void>;
fastGet(optionsArg: {
path: string;
}): Promise<Buffer>;
fastGetStream(pathArg: string): Promise<plugins.smartrx.rxjs.ReplaySubject<Buffer>>;
fastRemove(optionsArg: {
path: string;
}): Promise<void>;
/**
* deletes the directory with all its contents
*/
delete(): Promise<void>;
}