Skip to content

Commit

Permalink
Merge pull request #29 from nfhipona/update/4.1.0
Browse files Browse the repository at this point in the history
Minor updates for v4.1.1
  • Loading branch information
nfhipona committed Apr 8, 2024
2 parents fb0cf88 + 01d31ce commit 2df4937
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 158 deletions.
20 changes: 10 additions & 10 deletions lib/class/interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type AttributeCompare = {
name: string;
value: string | number;
};
export interface Storage {
export type Storage = {
/**
* keypath delimeter. defaults to '.'.
*/
Expand Down Expand Up @@ -46,8 +46,8 @@ export interface Storage {
* When invoked, will empty all keys out of the storage.
*/
clear(): void;
}
export interface WebStorage extends Storage {
};
export type WebStorage = Storage & {
/**
* Add multiple entries of key value pairs to the storage.
* @param {StorageItem[]} items Items to add individually in the storage.
Expand Down Expand Up @@ -91,8 +91,8 @@ export interface WebStorage extends Storage {
* @param {AttributeCompare} attrCompare data key attribute to be updated.
*/
getItemInItem(key: KeyPath, attrCompare?: AttributeCompare): StorageValue;
}
export interface EncryptedWebStorage extends Storage {
};
export type EncryptedWebStorage = Storage & {
/**
* When passed a key name, will return that key's value.
* @param {KeyPath} key key name.
Expand All @@ -104,21 +104,21 @@ export interface EncryptedWebStorage extends Storage {
* @param {StorageValue} value A string containing the value you want to give the key you are creating/updating.
*/
setEncryptedRawItem(key: KeyPath, value: StorageValue): boolean | Error;
}
};
/**
* Cryptor interface
*/
export interface CryptorOption {
export type CryptorOption = {
salt: string | Buffer;
keyLength: number;
algorithm: string;
password: string | Buffer;
byteLength: number;
}
};
export type KeyOption = string | null;
export type ReturnOption = string | null;
export type VectorIV = string | null;
export interface CryptorModel {
export type CryptorModel = {
/**
* Returns the cryptor's configs
*/
Expand All @@ -140,4 +140,4 @@ export interface CryptorModel {
* Returns the decrypted data from storage.
*/
decrypt(encrypted: string): ReturnOption;
}
};
2 changes: 1 addition & 1 deletion lib/class/interface.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-storage-manager",
"version": "4.1.0",
"version": "4.1.1",
"description": "Web utility storage manager for handling data encryption, save and persist, update and data purge in your local and session storage",
"main": "lib/index.js",
"type": "commonjs",
Expand Down Expand Up @@ -64,4 +64,4 @@
"publishConfig": {
"@nfhipona:registry": "https://npm.pkg.github.com"
}
}
}
Loading

0 comments on commit 2df4937

Please sign in to comment.