UNPKG

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