Add themes to search functionality, including quickswitch between recent themes

This commit is contained in:
Pieter Vander Vennet 2024-08-22 02:54:46 +02:00
parent b4866cdbac
commit 329865a15e
22 changed files with 679 additions and 431 deletions

View file

@ -263,14 +263,14 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return res
}
public static NoNull<T>(array: T[] | undefined): T[] | undefined
public static NoNull<T>(array: ReadonlyArray<T> | undefined): T[] | undefined
public static NoNull<T>(array: undefined): undefined
public static NoNull<T>(array: T[]): T[]
public static NoNull<T>(array: T[]): NonNullable<T>[] {
public static NoNull<T>(array: ReadonlyArray<T>): T[]
public static NoNull<T>(array: ReadonlyArray<T>): NonNullable<T>[] {
return <any>array?.filter((o) => o !== undefined && o !== null)
}
public static Hist(array: string[]): Map<string, number> {
public static Hist(array: ReadonlyArray<string>): Map<string, number> {
const hist = new Map<string, number>()
for (const s of array) {
hist.set(s, 1 + (hist.get(s) ?? 0))