1 | import { DocumentRegistry } from '@jupyterlab/docregistry';
|
2 | import { IDisposable } from '@lumino/disposable';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare class SaveHandler implements IDisposable {
|
10 | |
11 |
|
12 |
|
13 | constructor(options: SaveHandler.IOptions);
|
14 | /**
|
15 | * The save interval used by the timer (in seconds).
|
16 | */
|
17 | get saveInterval(): number;
|
18 | set saveInterval(value: number);
|
19 | /**
|
20 | * Get whether the handler is active.
|
21 | */
|
22 | get isActive(): boolean;
|
23 | /**
|
24 | * Get whether the save handler is disposed.
|
25 | */
|
26 | get isDisposed(): boolean;
|
27 | /**
|
28 | * Dispose of the resources used by the save handler.
|
29 | */
|
30 | dispose(): void;
|
31 | /**
|
32 | * Start the autosaver.
|
33 | */
|
34 | start(): void;
|
35 | /**
|
36 | * Stop the autosaver.
|
37 | */
|
38 | stop(): void;
|
39 | /**
|
40 | * Set the timer.
|
41 | */
|
42 | private _setTimer;
|
43 | /**
|
44 | * Handle an autosave timeout.
|
45 | */
|
46 | private _save;
|
47 | private _autosaveTimer;
|
48 | private _minInterval;
|
49 | private _interval;
|
50 | private _context;
|
51 | private _isConnectedCallback;
|
52 | private _isActive;
|
53 | private _inDialog;
|
54 | private _isDisposed;
|
55 | private _multiplier;
|
56 | }
|
57 | /**
|
58 | * A namespace for `SaveHandler` statics.
|
59 | */
|
60 | export declare namespace SaveHandler {
|
61 | |
62 |
|
63 |
|
64 | interface IOptions {
|
65 | |
66 |
|
67 |
|
68 | context: DocumentRegistry.Context;
|
69 | |
70 |
|
71 |
|
72 |
|
73 | isConnectedCallback?: () => boolean;
|
74 | |
75 |
|
76 |
|
77 | saveInterval?: number;
|
78 | }
|
79 | }
|