import { ISignal } from "@lumino/signaling"; import { DocumentRegistry } from "@jupyterlab/docregistry"; import { Contents, ServerConnection } from "@jupyterlab/services"; /** * A Contents.IDrive implementation for s3-api-compatible object storage. */ export declare class S3Drive implements Contents.IDrive { /** * Construct a new drive object. * * @param options - The options used to initialize the object. */ constructor(registry: DocumentRegistry); _registry: DocumentRegistry; /** * The name of the drive. */ get name(): "S3"; /** * Settings for the notebook server. */ readonly serverSettings: ServerConnection.ISettings; /** * A signal emitted when a file operation takes place. */ get fileChanged(): ISignal; /** * Test whether the manager has been disposed. */ get isDisposed(): boolean; /** * Dispose of the resources held by the manager. */ dispose(): void; /** * Get a file or directory. * * @param path: The path to the file. * * @param options: The options used to fetch the file. * * @returns A promise which resolves with the file content. */ get(path: string, options?: Contents.IFetchOptions): Promise; /** * Get an encoded download url given a file path. * * @param path - An absolute POSIX file path on the server. * * #### Notes * It is expected that the path contains no relative paths, * use [[ContentsManager.getAbsolutePath]] to get an absolute * path if necessary. */ getDownloadUrl(path: string): Promise; /** * Create a new untitled file or directory in the specified directory path. * * @param options: The options used to create the file. * * @returns A promise which resolves with the created file content when the * file is created. */ newUntitled(options?: Contents.ICreateOptions): Promise; /** * Delete a file. * * @param path - The path to the file. * * @returns A promise which resolves when the file is deleted. */ delete(path: string): Promise; /** * Rename a file or directory. * * @param path - The original file path. * * @param newPath - The new file path. * * @returns A promise which resolves with the new file contents model when * the file is renamed. */ rename(path: string, newPath: string): Promise; /** * Save a file. * * @param path - The desired file path. * * @param options - Optional overrides to the model. * * @returns A promise which resolves with the file content model when the * file is saved. */ save(path: string, options: Partial): Promise; /** * Copy a file into a given directory. * * @param path - The original file path. * * @param toDir - The destination directory path. * * @returns A promise which resolves with the new contents model when the * file is copied. */ copy(fromFile: string, toDir: string): Promise; /** * Create a checkpoint for a file. * * @param path - The path of the file. * * @returns A promise which resolves with the new checkpoint model when the * checkpoint is created. */ createCheckpoint(path: string): Promise; /** * List available checkpoints for a file. * * @param path - The path of the file. * * @returns A promise which resolves with a list of checkpoint models for * the file. */ listCheckpoints(path: string): Promise; /** * Restore a file to a known checkpoint state. * * @param path - The path of the file. * * @param checkpointID - The id of the checkpoint to restore. * * @returns A promise which resolves when the checkpoint is restored. */ restoreCheckpoint(path: string, checkpointID: string): Promise; /** * Delete a checkpoint for a file. * * @param path - The path of the file. * * @param checkpointID - The id of the checkpoint to delete. * * @returns A promise which resolves when the checkpoint is deleted. */ deleteCheckpoint(path: string, checkpointID: string): Promise; private _isDisposed; private _fileChanged; jupyterPathToS3Path(path: string, isDir: boolean): string; s3ToJupyterContents(s3Content: any): Contents.IModel; pathToJupyterContents(path: string): Promise; getBucketNameFromLastPath(): string; getPathInBucketFromLastPath(): string; }