1
Fork 0

Compare commits

..

2 Commits

Author SHA1 Message Date
Bauke c464983440
Remove readonly from Value properties. 2022-12-28 12:36:06 +01:00
Bauke 9fc2dbcbcb
Export ValueOptions<T>. 2022-12-28 12:35:46 +01:00
1 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import browser from "webextension-polyfill";
export type StorageArea = browser.Storage.StorageArea;
type ValueOptions<T> = {
export type ValueOptions<T> = {
/** A function to convert a string to the type `T`. */
deserialize: (input: string) => T;
/** The key to use for storage. */
@ -35,10 +35,10 @@ export async function createValue<T>(
type Props<T> = Required<ValueOptions<T>>;
export class Value<T> implements Props<T> {
public readonly deserialize: Props<T>["deserialize"];
public readonly key: Props<T>["key"];
public readonly serialize: Props<T>["serialize"];
public readonly storage: Props<T>["storage"];
public deserialize: Props<T>["deserialize"];
public key: Props<T>["key"];
public serialize: Props<T>["serialize"];
public storage: Props<T>["storage"];
private inner: Props<T>["value"];