VaultMigrator
Constructors
constructor
Usage
_10const legacyVaultConfig = {_10 unlockOnAccess: true,_10 hideScreenOnBackground: true,_10 lockAfter: 5000,_10 // and more ...._10}_10const migrator = new VaultMigrator(legacyVaultConfig, customPasscodePrompt);
Parameters
Name | Type | Description |
---|---|---|
options | VaultOptions | The legacy vault configuration options |
onPasscodeRequest? | (isPasscodeSetRequest : boolean) => Promise<undefined | string> | An optional callback function that will be called when the vault attempts to request a passcode. The function returns a promise with a boolean that indicates if the passcode is being setup for the first time for the vault or not. |
descriptor? | VaultDescriptor | An optional interface that describes the legacy vault. |
Returns: VaultMigrator
Methods
clear
Clears out the legacy vault and removes it from the system. Be sure to run VaultMigrator.exportVault before calling this method.
Usage
_10const data = await migrator.exportVault();_10await importVault(data);_10await migrator.clear();
Returns: Promise<void>
exportVault
Exports the data of the legacy vault in its entirety.
Usage
_10const data = await migrator.exportVault();_10console.log("@@VAULT DATA: ", JSON.stringify(data));
Returns: Promise<any>