1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-23 23:02:58 +00:00

Marking entity name as key of the mapping for type safety

This commit is contained in:
2025-02-19 03:17:52 +04:00
parent 62dc38b35a
commit 459b1fa779
3 changed files with 3 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ export default abstract class StorageEntity<SettingsType extends Object = {}> {
return this.#settings;
}
public static readonly _entityName: string = "entity";
public static readonly _entityName: keyof App.EntityNamesMap | "entity" = "entity";
async save() {
await EntitiesController.updateEntity(

View File

@@ -30,5 +30,5 @@ export default class MaintenanceProfile extends StorageEntity<MaintenanceProfile
return super.save();
}
public static readonly _entityName = "profiles";
public static readonly _entityName: keyof App.EntityNamesMap = "profiles";
}

View File

@@ -17,5 +17,5 @@ export default class TagGroup extends StorageEntity<TagGroupSettings> {
});
}
static _entityName = 'groups';
public static readonly _entityName: keyof App.EntityNamesMap = "groups";
}