diff --git a/src/types/Converters.d.ts b/src/types/Converters.d.ts index 0676d4e..4b35af5 100644 --- a/src/types/Converters.d.ts +++ b/src/types/Converters.d.ts @@ -1,19 +1,14 @@ -import type { - IEffectMapLibrary, - IFigureDataPalette, - IFigureDataSetType, - IFigureMapLibrary, - IFurni, - IProduct -} from './SubConverters' +import type { IFigureDataPalette, IFigureDataSetType, IFigureMapLibrary, IFurni, IProduct } from './SubConverters' +import type { KeyValuePairs } from './global' export interface IFigureData { palettes: IFigureDataPalette[] - setTypes: IFigureDataSetType[] + setTypes: KeyValuePairs } export interface IFigureMap { libraries: IFigureMapLibrary[] + parts: KeyValuePairs> } export interface IFurniData { @@ -21,9 +16,7 @@ export interface IFurniData { wallItemTypes: IFurni[] } -export interface IEffectMap { - effects: IEffectMapLibrary[] -} +export type IEffectMap = KeyValuePairs> export interface IProductData { productData: { product: IProduct } diff --git a/src/types/SubConverters.d.ts b/src/types/SubConverters.d.ts index 2ecd1f3..9c5ee8a 100644 --- a/src/types/SubConverters.d.ts +++ b/src/types/SubConverters.d.ts @@ -1,3 +1,5 @@ +import type { KeyValuePairs } from './global' + export interface IFurni { id: number classname: string @@ -26,47 +28,43 @@ export interface IFurni { rare: boolean } -export interface IFigureDataColor { - id: number +export type Club = 'idle' | 'HC' | 'VIP' + +export interface IFigureDataPaletteType { index: number - club: number // must be changed to something, either 0, 1, 2 - selectable: boolean // has been changed to boolean, can be either 1, 0 - hexCode: string + club: number + selectable: boolean + color: string } -export interface IFigureDataPalette { - id: number - color: IFigureDataColor[] -} +export type IFigureDataPalette = KeyValuePairs export interface IFigureDataPart { id: number - type: string // must be changed (i guess) - colorable: boolean // has been changed to boolean, can be either 1, 0 + type: string + colorable: boolean index: number colorindex: number } export interface IFigureDataSet { - id: number - gender: 'M' | 'F' | 'U' // has been changed - club: number // must be changed to something, either 0, 1, 2 - colorable: boolean // has been changed to boolean, can be either 1, 0 - selectable: boolean // has been changed to boolean, can be either 1, 0 - preselectable: boolean // has been changed to boolean, can be either 1, 0 - sellable?: boolean // has been changed to boolean, can be either 1, 0, null + gender: 'M' | 'F' | 'U' + club: number + colorable: boolean + selectable: boolean + preselectable: boolean + sellable?: boolean + hiddenLayers?: string[] parts: IFigureDataPart[] - hiddenLayers: Array<{ partType: string }> // !! can be empty } export interface IFigureDataSetType { - type: string // must be changed (i guess) paletteId: number - mandatoryF0: boolean // has been changed to boolean, can be either 1, 0 - mandatoryF1: boolean // has been changed to boolean, can be either 1, 0 - mandatoryM0: boolean // has been changed to boolean, can be either 1, 0 - mandatoryM1: boolean // has been changed to boolean, can be either 1, 0 - sets: IFigureDataSet[] + mandatoryF0: boolean + mandatoryF1: boolean + mandatoryM0: boolean + mandatoryM1: boolean + sets: KeyValuePairs } export interface IFigureMapLibraryPart { @@ -77,14 +75,6 @@ export interface IFigureMapLibraryPart { export interface IFigureMapLibrary { id: string revision: number - part: IFigureMapLibraryPart[] -} - -export interface IEffectMapLibrary { - id: number - lib: string - type: string // dance || fx - revision: number } export interface IProduct { diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 37ea629..ef14f23 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,6 +1,6 @@ export type StateTypes = 'idle' | 'loading' | 'error' | 'success' export type ConvertionHandler = (message: string, state: StateTypes) => void -export interface KeyValuePairs { - [index: string]: string +export type KeyValuePairs = { + [key in KeyType]: ValueType }