// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

import { SettingsPage } from './Nav.std.ts';

// Should be in sync with isBackupPage()
export type PreferencesBackupPage =
  | SettingsPage.Backups
  | SettingsPage.BackupsDetails
  | SettingsPage.LocalBackups
  | SettingsPage.LocalBackupsKeyReference;

// Should be in sync with PreferencesBackupPage
export function isBackupPage(
  page: SettingsPage
): page is PreferencesBackupPage {
  return (
    page === SettingsPage.Backups ||
    page === SettingsPage.BackupsDetails ||
    page === SettingsPage.LocalBackups ||
    page === SettingsPage.LocalBackupsKeyReference
  );
}
