Interface: IContents
#
@jupyterlite/contents.IContents
The interface for the contents service.
Properties#
ready
#
ready
:Promise
<void
>
A promise that resolves after the contents have been full initialized.
Defined in#
Methods#
copy
#
copy
(path
,toDir
):Promise
<IModel
>
Copy a file into a given directory.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The original file path. |
|
|
The destination directory path. |
Returns#
Promise
<IModel
>
A promise which resolves with the new contents model when the file is copied.
Notes#
The server will select the name of the copied file.
Defined in#
createCheckpoint
#
createCheckpoint
(path
):Promise
<ICheckpointModel
>
Create a checkpoint for a file.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The path of the file. |
Returns#
Promise
<ICheckpointModel
>
A promise which resolves with the new checkpoint model when the checkpoint is created.
Defined in#
delete
#
delete
(path
):Promise
<void
>
Delete a file.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The path to the file. |
Returns#
Promise
<void
>
Defined in#
deleteCheckpoint
#
deleteCheckpoint
(path
,checkpointID
):Promise
<void
>
Delete a checkpoint for a file.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The path of the file. |
|
|
The id of the checkpoint to delete. |
Returns#
Promise
<void
>
A promise which resolves when the checkpoint is deleted.
Defined in#
get
#
get
(path
,options?
):Promise
<null
|IModel
>
Get a file or directory.
Parameters#
Name |
Type |
---|---|
|
|
|
|
Returns#
Promise
<null
| IModel
>
A promise which resolves with the file content.
Defined in#
listCheckpoints
#
listCheckpoints
(path
):Promise
<ICheckpointModel
[]>
List available checkpoints for a file.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The path of the file. |
Returns#
Promise
<ICheckpointModel
[]>
A promise which resolves with a list of checkpoint models for the file.
Defined in#
newUntitled
#
newUntitled
(options?
):Promise
<null
|IModel
>
Create a new untitled file or directory in the specified directory path.
Parameters#
Name |
Type |
---|---|
|
|
Returns#
Promise
<null
| IModel
>
A promise which resolves with the created file content when the file is created.
Defined in#
rename
#
rename
(oldLocalPath
,newLocalPath
):Promise
<IModel
>
Rename a file or directory.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The original file path. |
|
|
The new file path. |
Returns#
Promise
<IModel
>
A promise which resolves with the new file content model when the file is renamed.
Defined in#
restoreCheckpoint
#
restoreCheckpoint
(path
,checkpointID
):Promise
<void
>
Restore a file to a known checkpoint state.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The path of the file. |
|
|
The id of the checkpoint to restore. |
Returns#
Promise
<void
>
A promise which resolves when the checkpoint is restored.
Defined in#
save
#
save
(path
,options?
):Promise
<null
|IModel
>
Save a file.
Parameters#
Name |
Type |
Description |
---|---|---|
|
|
The desired file path. |
|
|
Optional overrides to the model. |
Returns#
Promise
<null
| IModel
>
A promise which resolves with the file content model when the file is saved.