chore(mobx): clean up documentation

This commit is contained in:
Paul 2021-12-11 12:08:43 +00:00
parent 49f45aa5aa
commit 830b24a393
7 changed files with 16 additions and 16 deletions

View file

@ -47,6 +47,9 @@
"ClassDeclaration": true,
"ArrowFunctionExpression": false,
"FunctionExpression": false
},
"ignore": {
"MethodDefinition": ["toJSON", "hydrate"]
}
}
]

View file

@ -26,7 +26,6 @@ export default class Auth implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
sessions: this.sessions,
@ -34,7 +33,6 @@ export default class Auth implements Persistent<Data> {
};
}
// eslint-disable-next-line require-jsdoc
hydrate(data: Data) {
Object.keys(data.sessions).forEach((id) =>
this.sessions.set(id, data.sessions[id]),

View file

@ -20,14 +20,12 @@ export default class Draft implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
drafts: this.drafts,
};
}
// eslint-disable-next-line require-jsdoc
@action hydrate(data: Data) {
Object.keys(data.drafts).forEach((key) =>
this.drafts.set(key, data.drafts[key]),

View file

@ -2,16 +2,25 @@ import { action, computed, makeAutoObservable, ObservableSet } from "mobx";
import Persistent from "../Persistent";
export type Experiment = "search" | "theme_shop";
/**
* Union type of available experiments.
*/
export type Experiment = "dummy" | "theme_shop";
/**
* Currently active experiments.
*/
export const AVAILABLE_EXPERIMENTS: Experiment[] = ["theme_shop"];
/**
* Definitions for experiments listed by {@link Experiment}.
*/
export const EXPERIMENTS: {
[key in Experiment]: { title: string; description: string };
} = {
search: {
title: "Search",
description: "Allows you to search for messages in channels.",
dummy: {
title: "Dummy Experiment",
description: "This is a dummy experiment.",
},
theme_shop: {
title: "Theme Shop",
@ -37,14 +46,12 @@ export default class Experiments implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
enabled: this.enabled,
};
}
// eslint-disable-next-line require-jsdoc
@action hydrate(data: Data) {
if (data.enabled) {
for (const experiment of data.enabled) {

View file

@ -22,14 +22,12 @@ export default class Experiments implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
server: this.server,
};
}
// eslint-disable-next-line require-jsdoc
@action hydrate(data: Data) {
if (data.server) {
Object.keys(data.server).forEach((key) =>

View file

@ -63,14 +63,12 @@ export default class LocaleOptions implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
lang: this.lang,
};
}
// eslint-disable-next-line require-jsdoc
@action hydrate(data: Data) {
this.setLanguage(data.lang);
}

View file

@ -44,7 +44,6 @@ export default class NotificationOptions implements Persistent<Data> {
makeAutoObservable(this);
}
// eslint-disable-next-line require-jsdoc
toJSON() {
return {
server: this.server,
@ -52,7 +51,6 @@ export default class NotificationOptions implements Persistent<Data> {
};
}
// eslint-disable-next-line require-jsdoc
@action hydrate(data: Data) {
if (data.server) {
Object.keys(data.server).forEach((key) =>