StorageApi
API Functions
get
Get value from storage.
Params:
| Param Name | Description |
|---|---|
key | Key name |
defaultValue | Optional, default value |
Signature:
typescript
get: <T extends BaseType>(key: string, defaultValue?: T) => Promise<T | null>set
Set value in storage.
Params:
| Param Name | Description |
|---|---|
key | Key name |
value | Value to store, can be BaseType or object |
Signature:
typescript
set: (key: string, value: BaseType | object) => Promise<string>getObject
Get object value from storage.
Params:
| Param Name | Description |
|---|---|
key | Key name |
defaultValue | Optional, default value |
Signature:
typescript
getObject: <T>(key: string, defaultValue?: T) => Promise<T | undefined>delete
Delete value from storage.
Params:
| Param Name | Description |
|---|---|
key | Key name |
Signature:
typescript
delete: (key: string) => Promise<void>encryptString
Encrypt a string with the encryption key generated by DPAPI. According to Windows documentation: "Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data". Therefore, the content is protected from other users on the same computer, but not from other applications running in the same user space. @see Safe Storage
Params:
| Param Name | Description |
|---|---|
value | String to encrypt |
Signature:
typescript
encryptString: (value: string) => Promise<string>decryptString
Decrypt the encrypted string.
Params:
| Param Name | Description |
|---|---|
value | String to decrypt |
Signature:
typescript
decryptString: (value: string) => Promise<string>encryptSet
Encrypt string and store.
Params:
| Param Name | Description |
|---|---|
key | Key name |
value | String to encrypt and store |
Signature:
typescript
encryptSet: (key: string, value: string) => Promise<string>decryptGet
Get string value from encrypted storage.
Params:
| Param Name | Description |
|---|---|
key | Key name |
defaultValue | Optional, default value |
Signature:
typescript
decryptGet: (key: string, defaultValue?: string) => Promise<string | undefined>API Events
No events available.
API Constants
No constants available.