beaker.shell
beaker.shell.drivePropertiesDialog(url)
Create a dialog for editing the properties of the given hyperdrive.
- url String. The URL of the drive to view.
- Returns Promise<Void>
beaker.shell.selectFileDialog([opts])
Create a dialog for selecting files or folders.
- opts Object
- title String. The title of the selection dialog.
- buttonLabel String. The label on the "OK" button.
- drive String. The initial drive to explore.
- defaultPath String. The initial path to explore.
- select Array<String>. What kind of entries to accept. Must contain 'file', 'folder', 'mount'.
- filters Object
- extensions Array<String>. The extensions of the files to accept.
- writable Boolean. If true, only accept writable files. If false, only accept unwritable files.
- allowMultiple Boolean. If true, allow multiple files to be selected.
- disallowCreate Boolean. If true, require the selected file to exist.
- Returns Promise<Array<Object>>
- path String. The path of the selected file or folder.
- origin String. The URL of the hyperdrive that contains the file or folder.
- url String. The URL of the file or folder.
beaker.shell.saveFileDialog([opts])
Create a dialog for selecting where to save a file.
- opts Object
- title String. The title of the selection dialog.
- buttonLabel String. The label on the "OK" button.
- drive String. The initial drive to explore.
- defaultPath String. The initial path to explore.
- defaultFilename String. The suggested default filename.
- extension String. The extension of the saved file.
- filters Object
- extensions Array<String>. The extensions of the files to accept.
- writable Boolean. If true, only accept writable files. If false, only accept unwritable files.
- Returns Promise<Array<Object>>
- path String. The path of the selected file or folder.
- origin String. The URL of the hyperdrive that contains the file or folder.
- url String. The URL of the file or folder.
beaker.shell.selectDriveDialog([opts])
Create a dialog for selecting a hyperdrive from the user's library.
- opts Object
- title String. The title of the selection dialog.
- buttonLabel String. The label on the "OK" button.
- writable Boolean. If true, only accept writable drives. If false, only accept unwritable drives.
- allowMultiple Boolean. If true, allow multiple drives to be selected.
- tag String. Filters the drives to items that include the given tag.
- template String. The URL of a hyperdrive which will be used as the template for a new drive if the user chooses "new drive."
- Returns Promise<String|Array<String>>
If a .template
is specified, .writable
is not false
, and no drives in the user's library matches the filtering criteria, the modal will automatically jump to the "create drive" flow.
beaker.shell.saveDriveDialog(url[, opts])
Create a dialog for saving a hyperdrive to the user's library.
- url String. The URL of the hyperdrive to save.
- opts Object
- tags String. A space-separated list of tags to suggest saving the hyperdrive under.
beaker.shell.listDrives([opts])
List saved drives according to a filter. Requires user to grant permission.
- opts Object
- tag String. Only list drives saved with the given tag.
- writable Boolean. Only list drives which are or aren't writable.
beaker.shell.tagDrive(url, tags)
Ask the user to add tags to the given hyperdrive. If the drive isn't already saved, will trigger the "save drive" dialog.
- url String. The URL of the hyperdrive to save.
- tags String. A space-separated list of tags to assign the drive.
beaker.shell.unsaveDrive(url)
Remove a hyperdrive from the user's library. Requires user to grant permission.
- url String. The URL of the hyperdrive to unsave.