Files
brave-core/components/common/strings.ts
T
Jay Harris 266cb4db0e [Brave News]: Use the new strings system for Brave News (#29847)
* [Brave News]: Migrate to new strings system

* [i18n]: Make it possible to combine const enums
2025-07-02 08:18:23 +12:00

29 lines
1.0 KiB
TypeScript

// Copyright (c) 2025 The Brave Authors. All rights reserved.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
// Converts `A | B | C` to `A & B & C`
type UnionToIntersection<U> =
(U extends any ? (x: U) => void : never) extends ((x: infer I) => void) ? I : never
declare global {
// Global interface containing all available strings. This lets WebUIs
// extend the available strings via
// import { MyStrings } from 'gen/components/grit/brave_components_webui_strings'
// declare global {
// interface Strings {
// MyStrings: typeof MyStrings
// }
// }
// and have them available in the global scope as `S.MY_STRINGS_XXX`
interface Strings {
}
// S is the intersection of all the enums exposed on the Strings interface.
const S: UnionToIntersection<Strings[keyof Strings]>
}
// Empty default export to make this a module
export {}