Compare commits
2 Commits
5f4b882d79
...
c464983440
Author | SHA1 | Date |
---|---|---|
Bauke | c464983440 | |
Bauke | 9fc2dbcbcb |
|
@ -2,7 +2,7 @@ import browser from "webextension-polyfill";
|
||||||
|
|
||||||
export type StorageArea = browser.Storage.StorageArea;
|
export type StorageArea = browser.Storage.StorageArea;
|
||||||
|
|
||||||
type ValueOptions<T> = {
|
export type ValueOptions<T> = {
|
||||||
/** A function to convert a string to the type `T`. */
|
/** A function to convert a string to the type `T`. */
|
||||||
deserialize: (input: string) => T;
|
deserialize: (input: string) => T;
|
||||||
/** The key to use for storage. */
|
/** The key to use for storage. */
|
||||||
|
@ -35,10 +35,10 @@ export async function createValue<T>(
|
||||||
type Props<T> = Required<ValueOptions<T>>;
|
type Props<T> = Required<ValueOptions<T>>;
|
||||||
|
|
||||||
export class Value<T> implements Props<T> {
|
export class Value<T> implements Props<T> {
|
||||||
public readonly deserialize: Props<T>["deserialize"];
|
public deserialize: Props<T>["deserialize"];
|
||||||
public readonly key: Props<T>["key"];
|
public key: Props<T>["key"];
|
||||||
public readonly serialize: Props<T>["serialize"];
|
public serialize: Props<T>["serialize"];
|
||||||
public readonly storage: Props<T>["storage"];
|
public storage: Props<T>["storage"];
|
||||||
|
|
||||||
private inner: Props<T>["value"];
|
private inner: Props<T>["value"];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue