From cd72ad0008ea583e9ecb22362f7bb15cc50153f6 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 14 Jul 2026 12:02:36 +0200 Subject: [PATCH] Create service interruptions view model --- knip.ts | 7 +++++- src/state/ServiceInterruptionsViewModel.ts | 27 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/state/ServiceInterruptionsViewModel.ts diff --git a/knip.ts b/knip.ts index dcc7231c1..8412d5915 100644 --- a/knip.ts +++ b/knip.ts @@ -20,7 +20,12 @@ export default { // This is a shell built-in. "printf", ], - ignoreFiles: ["scripts/.pnpmfile.cjs"], + ignoreFiles: [ + "scripts/.pnpmfile.cjs", + // Deliberately added prior to any component or business logic + // implementation + "src/state/ServiceInterruptionsViewModel.ts", + ], ignoreDependencies: [ // Used in CSS "normalize.css", diff --git a/src/state/ServiceInterruptionsViewModel.ts b/src/state/ServiceInterruptionsViewModel.ts new file mode 100644 index 000000000..94d6a05b7 --- /dev/null +++ b/src/state/ServiceInterruptionsViewModel.ts @@ -0,0 +1,27 @@ +/* +Copyright 2026 Element Creations Ltd. + +SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial +Please see LICENSE in the repository root for full details. +*/ + +export type Service = + | { name: "encryption-keys" } + | { name: "reactions" } + | { name: "screen-sharing" } + | { name: "local-media" } + | { + name: "remote-media"; + /** + * The number of users affected, for the purpose of pluralising the + * strings. + */ + count: number; + }; + +export interface ServiceInterruptionsViewModel { + /** + * A non-empty array of services which are temporarily unavailable. + */ + unavailable: Service[]; +}