Explicitly use the AnonymizeUsernamesData type for Value.
This commit is contained in:
parent
36bf5ece75
commit
be5ccaf0c1
|
@ -1,6 +1,9 @@
|
||||||
import {createValue, type Value} from "@holllo/webextension-storage";
|
import {createValue, type Value} from "@holllo/webextension-storage";
|
||||||
import browser from "webextension-polyfill";
|
import browser from "webextension-polyfill";
|
||||||
import {type AnonymizeUsernamesData} from "./anonymize-usernames.js";
|
import {
|
||||||
|
type AnonymizeUsernamesData,
|
||||||
|
ReplacementType,
|
||||||
|
} from "./anonymize-usernames.js";
|
||||||
import {Data, Feature, MiscellaneousFeature} from "./enums.js";
|
import {Data, Feature, MiscellaneousFeature} from "./enums.js";
|
||||||
import {collectHideTopicsData} from "./hide-topics.js";
|
import {collectHideTopicsData} from "./hide-topics.js";
|
||||||
import {defaultKnownGroups} from "./known-groups.js";
|
import {defaultKnownGroups} from "./known-groups.js";
|
||||||
|
@ -75,12 +78,12 @@ export const storageValues = {
|
||||||
value: false,
|
value: false,
|
||||||
storage: browser.storage.sync,
|
storage: browser.storage.sync,
|
||||||
}),
|
}),
|
||||||
[Feature.AnonymizeUsernames]: createValue({
|
[Feature.AnonymizeUsernames]: createValue<AnonymizeUsernamesData>({
|
||||||
deserialize: (input) => JSON.parse(input) as AnonymizeUsernamesData,
|
deserialize: (input) => JSON.parse(input) as AnonymizeUsernamesData,
|
||||||
serialize: (input) => JSON.stringify(input),
|
serialize: (input) => JSON.stringify(input),
|
||||||
key: Feature.AnonymizeUsernames,
|
key: Feature.AnonymizeUsernames,
|
||||||
value: {
|
value: {
|
||||||
replacementType: "numerical",
|
replacementType: ReplacementType.Numerical,
|
||||||
},
|
},
|
||||||
storage: browser.storage.sync,
|
storage: browser.storage.sync,
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue