mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve typing to prevent errors in the future.
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
83b72f1eb7
commit
ea7a24d016
@ -4,14 +4,22 @@
|
|||||||
*/
|
*/
|
||||||
import type { InjectionToken } from "@ogre-tools/injectable";
|
import type { InjectionToken } from "@ogre-tools/injectable";
|
||||||
import { lifecycleEnum, getInjectable } from "@ogre-tools/injectable";
|
import { lifecycleEnum, getInjectable } from "@ogre-tools/injectable";
|
||||||
import type Conf from "conf/dist/source";
|
|
||||||
import type { Migrations } from "conf/dist/source/types";
|
import type { Migrations } from "conf/dist/source/types";
|
||||||
import loggerInjectable from "../logger.injectable";
|
import loggerInjectable from "../logger.injectable";
|
||||||
import { getOrInsert, iter } from "@k8slens/utilities";
|
import { getOrInsert, iter } from "@k8slens/utilities";
|
||||||
|
|
||||||
|
export interface MigrationStore {
|
||||||
|
get(key: string): unknown;
|
||||||
|
delete(key: string): void;
|
||||||
|
has(key: string): boolean;
|
||||||
|
clear(): void;
|
||||||
|
set(key: string, value: number | string | boolean | unknown[]): void;
|
||||||
|
set<Key extends string>(key: string, value: Record<Key, unknown>): void;
|
||||||
|
}
|
||||||
|
|
||||||
export interface MigrationDeclaration {
|
export interface MigrationDeclaration {
|
||||||
version: string;
|
version: string;
|
||||||
run(store: Conf<Partial<Record<string, unknown>>>): void;
|
run(store: MigrationStore): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const persistentStorageMigrationsInjectable = getInjectable({
|
const persistentStorageMigrationsInjectable = getInjectable({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user