Skip to content

Commit b6e1e4a

Browse files
committed
Move type definitions to displayDataTypes module
Relocated several type definitions (such as professionsType, cropsShippedType, generalFormatedItemType, and related types) from savefile.ts to displayDataTypes.ts. Updated imports in Cooking.tsx, Crops.tsx, and Utility.tsx to reference the new module, improving type organization and separation of concerns.
1 parent 31ea99f commit b6e1e4a

4 files changed

Lines changed: 17 additions & 79 deletions

File tree

src/Components/AchieveTabs/Cooking.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import type { generalFormatedItemType } from 'types/savefile';
2+
import type { generalFormatedItemType } from 'types/displayDataTypes';
33

44
interface dishesCookedType {
55
cookedItems: generalFormatedItemType[];

src/Components/AchieveTabs/Crops.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState, useEffect } from 'react'
2-
import type { cropsShippedType } from 'types/savefile';
2+
import type { cropsShippedType } from 'types/displayDataTypes';
33

44
interface CropsShippedWrapperType {
55
cropsShipped: cropsShippedType;

src/Components/Utility/Utility.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,25 @@ import MonsterCat from '@utility/monsterCategorie.json' with { type: "json" };
1212
import Museum from '@utility/museum.json' with { type: "json" };
1313
import townSR from './TownSpecialReq.json' with { type: "json" };
1414
import QiSR from './QiSpecialReq.json' with { type: "json" };
15-
import type {
16-
cropsShippedType,
17-
experienceType,
18-
formatedFriendshipDataType,
19-
formatedMonsterDataType,
15+
import type {
2016
friendshipDataType,
21-
gameLocationType,
22-
generalFormatedItemType,
23-
itemFoundType,
17+
gameLocationType,
2418
itemsType,
25-
itemType,
26-
maxMonoType,
27-
playerType,
28-
professionsType,
19+
itemType,
20+
playerType,
2921
questType,
3022
specialOrderType
3123
} from 'types/savefile';
24+
import type {
25+
cropsShippedType,
26+
generalFormatedItemType,
27+
professionsType,
28+
maxMonoType,
29+
itemFoundType,
30+
experienceType,
31+
formatedFriendshipDataType,
32+
formatedMonsterDataType
33+
} from 'types/displayDataTypes';
3234
import type { fullPlayerDataType, museumCollectionType } from 'types/displayDataTypes';
3335

3436
//Gets the info from the farm hands as an array of the same type

src/types/savefile.ts

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -266,56 +266,6 @@ export type playerType = {
266266
fishCaught: itemType,
267267
}
268268

269-
export type professionsType = {
270-
id: number;
271-
name: string;
272-
}
273-
274-
export type cropsShippedType = {
275-
hasMonoculture: boolean;
276-
hasPolyculture: boolean;
277-
mono_extras: generalFormatedItemType[];
278-
poly_crops: generalFormatedItemType[];
279-
maxMono: null | maxMonoType;
280-
};
281-
282-
export type maxMonoType = {
283-
name: string;
284-
shipped: number;
285-
}
286-
287-
export type generalFormatedItemType = {
288-
id?: number;
289-
image: string;
290-
name: string;
291-
link?: string;
292-
knownDish?: boolean;
293-
times?: number;
294-
shipped?: number;
295-
fished?: boolean;
296-
found?: boolean;
297-
inMuseum?: boolean;
298-
}
299-
300-
export type formatedFriendshipDataType = {
301-
name: string;
302-
dateable: boolean;
303-
points: number;
304-
level: number;
305-
lvlup: number;
306-
}
307-
export type formatedMonsterDataType = {
308-
category: string;
309-
goal: number;
310-
images: monsterImageType[];
311-
timesKilled: number;
312-
};
313-
314-
type monsterImageType = {
315-
img: string;
316-
name: string;
317-
}
318-
319269
type batType = {
320270
goal: number;
321271
monsters: string[];
@@ -343,11 +293,6 @@ type friendshipDataItemType = {
343293
item: friendshipDataType[]
344294
}
345295

346-
export type itemFoundType = {
347-
item: number | string,
348-
timesFound: number
349-
}
350-
351296
export type friendshipDataType = {
352297
key: {
353298
string: "Robin"
@@ -541,13 +486,4 @@ export type questType = {
541486
dueDate: number;
542487
duration: string;
543488
questState: string;
544-
}
545-
546-
export type experienceType = {
547-
levelInfo: {
548-
id: number;
549-
val: number;
550-
};
551-
skill: string;
552-
xp: number;
553-
};
489+
}

0 commit comments

Comments
 (0)