From 830b24a393d147edd9f92cf014858be301ba119b Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 11 Dec 2021 12:08:43 +0000 Subject: [PATCH] chore(mobx): clean up documentation --- package.json | 3 +++ src/mobx/stores/Auth.ts | 2 -- src/mobx/stores/Draft.ts | 2 -- src/mobx/stores/Experiments.ts | 19 +++++++++++++------ src/mobx/stores/LastOpened.ts | 2 -- src/mobx/stores/LocaleOptions.ts | 2 -- src/mobx/stores/NotificationOptions.ts | 2 -- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index e92fd235..76746ba4 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,9 @@ "ClassDeclaration": true, "ArrowFunctionExpression": false, "FunctionExpression": false + }, + "ignore": { + "MethodDefinition": ["toJSON", "hydrate"] } } ] diff --git a/src/mobx/stores/Auth.ts b/src/mobx/stores/Auth.ts index 153f83d6..36e16057 100644 --- a/src/mobx/stores/Auth.ts +++ b/src/mobx/stores/Auth.ts @@ -26,7 +26,6 @@ export default class Auth implements Persistent { makeAutoObservable(this); } - // eslint-disable-next-line require-jsdoc toJSON() { return { sessions: this.sessions, @@ -34,7 +33,6 @@ export default class Auth implements Persistent { }; } - // eslint-disable-next-line require-jsdoc hydrate(data: Data) { Object.keys(data.sessions).forEach((id) => this.sessions.set(id, data.sessions[id]), diff --git a/src/mobx/stores/Draft.ts b/src/mobx/stores/Draft.ts index 5bb51d26..593fb6a3 100644 --- a/src/mobx/stores/Draft.ts +++ b/src/mobx/stores/Draft.ts @@ -20,14 +20,12 @@ export default class Draft implements Persistent { 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]), diff --git a/src/mobx/stores/Experiments.ts b/src/mobx/stores/Experiments.ts index bb0a35dc..d3058c44 100644 --- a/src/mobx/stores/Experiments.ts +++ b/src/mobx/stores/Experiments.ts @@ -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 { 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) { diff --git a/src/mobx/stores/LastOpened.ts b/src/mobx/stores/LastOpened.ts index 091bc012..e0ff249f 100644 --- a/src/mobx/stores/LastOpened.ts +++ b/src/mobx/stores/LastOpened.ts @@ -22,14 +22,12 @@ export default class Experiments implements Persistent { 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) => diff --git a/src/mobx/stores/LocaleOptions.ts b/src/mobx/stores/LocaleOptions.ts index aed6e70a..2812b1b7 100644 --- a/src/mobx/stores/LocaleOptions.ts +++ b/src/mobx/stores/LocaleOptions.ts @@ -63,14 +63,12 @@ export default class LocaleOptions implements Persistent { 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); } diff --git a/src/mobx/stores/NotificationOptions.ts b/src/mobx/stores/NotificationOptions.ts index c79e7a79..28ba0a03 100644 --- a/src/mobx/stores/NotificationOptions.ts +++ b/src/mobx/stores/NotificationOptions.ts @@ -44,7 +44,6 @@ export default class NotificationOptions implements Persistent { makeAutoObservable(this); } - // eslint-disable-next-line require-jsdoc toJSON() { return { server: this.server, @@ -52,7 +51,6 @@ export default class NotificationOptions implements Persistent { }; } - // eslint-disable-next-line require-jsdoc @action hydrate(data: Data) { if (data.server) { Object.keys(data.server).forEach((key) =>