Skip to content

Commit

Permalink
Update lib and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nfhipona committed Apr 8, 2024
1 parent 933c86d commit 055f4a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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.

0 comments on commit 055f4a9

Please sign in to comment.