Constructor
new JsDrive()
Private constructor, use open() and create() instead.
Classes
Methods
getFile(file)
Parameters:
Name | Type | Description |
---|---|---|
file |
The real file. |
Returns:
The encrypted file.
getPrivateDir() → {IRealFile}
Get a private dir for sharing files with external applications.
Throws:
Exception
Returns:
The private directory.
- Type
- IRealFile
onUnlockError()
When authorization fails.
onUnlockSuccess()
When authorization succeed.
(async, static) create(dir, password, sequencer) → {Promise.<SalmonDrive>}
Helper method that creates and initializes a JsDrive
Parameters:
Name | Type | Description |
---|---|---|
dir |
IRealFile | The real directory that will contain the drive. |
password |
string | Text password to use with this drive. |
sequencer |
ISalmonSequencer | The nonce sequencer that will be used for encryption. |
Returns:
The drive.
- Type
- Promise.<SalmonDrive>
(async, static) open(dir, password, sequencer) → {Promise.<SalmonDrive>}
Helper method that opens and initializes a JsDrive
Parameters:
Name | Type | Default | Description |
---|---|---|---|
dir |
IRealFile | The real directory that contains the drive. | |
password |
string | Text password to use with this drive. | |
sequencer |
ISalmonSequencer | null | Optional nonce sequencer that will be used for importing files. |
Returns:
The drive.
- Type
- Promise.<SalmonDrive>