1
Fork 0

Move the Anonymize Usernames storage to its own file.

This commit is contained in:
Bauke 2023-08-11 11:23:29 +02:00
parent dc499be4b7
commit b908749d7c
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 25 additions and 7 deletions

View File

@ -0,0 +1,23 @@
/**
* The different types of username replacements for the Anonymize Usernames
* feature.
*/
export enum ReplacementType {
Hashed = "hashed",
Numerical = "numerical",
}
/**
* Type guard check to see if a string is a valid {@link ReplacementType}.
* @param input The string to check.
*/
export function isReplacementType(input: string): input is ReplacementType {
return Object.values(ReplacementType).includes(input as ReplacementType);
}
/**
* The data stored for the Anonymize Usernames feature.
*/
export type AnonymizeUsernamesData = {
replacementType: ReplacementType;
};

View File

@ -1,23 +1,18 @@
import {createValue, type Value} from "@holllo/webextension-storage";
import browser from "webextension-polyfill";
import {type AnonymizeUsernamesData} from "./anonymize-usernames.js";
import {Data, Feature, MiscellaneousFeature} from "./enums.js";
import {collectHideTopicsData} from "./hide-topics.js";
import {defaultKnownGroups} from "./known-groups.js";
import {collectUsernameColors} from "./username-color.js";
import {collectUserLabels} from "./user-label.js";
export * from "./anonymize-usernames.js";
export * from "./enums.js";
export * from "./hide-topics.js";
export * from "./username-color.js";
export * from "./user-label.js";
/**
* The data stored for the Anonymize Usernames feature.
*/
export type AnonymizeUsernamesData = {
replacementType: "numerical" | "hashed";
};
/**
* The data stored for the Hide Votes feature.
*/