UNPKG

1.31 kBTypeScriptView Raw
1import { DocumentRegistry } from '@jupyterlab/docregistry';
2import { Contents } from '@jupyterlab/services';
3import { ITranslator } from '@jupyterlab/translation';
4import { JSONObject } from '@lumino/coreutils';
5import { IDocumentManager } from './';
6/**
7 * A stripped-down interface for a file container.
8 */
9export interface IFileContainer extends JSONObject {
10 /**
11 * The list of item names in the current working directory.
12 */
13 items: string[];
14 /**
15 * The current working directory of the file container.
16 */
17 path: string;
18}
19/**
20 * Rename a file with a dialog.
21 */
22export declare function renameDialog(manager: IDocumentManager, context: DocumentRegistry.Context, translator?: ITranslator): Promise<void | null>;
23/**
24 * Rename a file, asking for confirmation if it is overwriting another.
25 */
26export declare function renameFile(manager: IDocumentManager, oldPath: string, newPath: string): Promise<Contents.IModel | null>;
27/**
28 * Ask the user whether to overwrite a file.
29 */
30export declare function shouldOverwrite(path: string, translator?: ITranslator): Promise<boolean>;
31/**
32 * Test whether a name is a valid file name
33 *
34 * Disallows "/", "\", and ":" in file names, as well as names with zero length.
35 */
36export declare function isValidFileName(name: string): boolean;