From 6e8c0babd8f2d8ebcdf06ee768b3c763d7fa0416 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 17 May 2023 13:21:37 +0200 Subject: [PATCH] Docs(typing): improve typing of MenuState-tab options --- Models/MenuState.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Models/MenuState.ts b/Models/MenuState.ts index 40ecff535..9cb84a00f 100644 --- a/Models/MenuState.ts +++ b/Models/MenuState.ts @@ -4,6 +4,9 @@ import UserRelatedState from "../Logic/State/UserRelatedState" import { Utils } from "../Utils" import { LocalStorageSource } from "../Logic/Web/LocalStorageSource" +export type ThemeViewTabStates = typeof MenuState._themeviewTabs[number] +export type MenuViewTabStates = typeof MenuState._menuviewTabs[number] + /** * Indicates if a menu is open, and if so, which tab is selected; * Some tabs allow to highlight an element. @@ -11,15 +14,15 @@ import { LocalStorageSource } from "../Logic/Web/LocalStorageSource" * Some convenience methods are provided for this as well */ export class MenuState { - private static readonly _themeviewTabs = ["intro", "filters", "download", "copyright"] as const + public static readonly _themeviewTabs = ["intro", "filters", "download", "copyright"] as const public readonly themeIsOpened: UIEventSource public readonly themeViewTabIndex: UIEventSource - public readonly themeViewTab: UIEventSource + public readonly themeViewTab: UIEventSource - private static readonly _menuviewTabs = ["about", "settings", "community", "privacy"] as const + public static readonly _menuviewTabs = ["about", "settings", "community", "privacy"] as const public readonly menuIsOpened: UIEventSource public readonly menuViewTabIndex: UIEventSource - public readonly menuViewTab: UIEventSource + public readonly menuViewTab: UIEventSource public readonly highlightedLayerInFilters: UIEventSource = new UIEventSource( undefined