mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 04:46:06 +00:00
0a40bcebf0
## Description: Enable the `sort-imports` eslint rule. Fixes #1784 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { RequiredPatternSchema } from "./Schemas";
|
|
import { z } from "zod";
|
|
|
|
export const ProductSchema = z.object({
|
|
productId: z.string(),
|
|
/* eslint-disable sort-keys */
|
|
priceId: z.string(),
|
|
price: z.string(),
|
|
/* eslint-enable sort-keys */
|
|
});
|
|
|
|
const PatternSchema = z.object({
|
|
name: z.string(),
|
|
pattern: RequiredPatternSchema,
|
|
product: ProductSchema.nullable(),
|
|
});
|
|
|
|
// Schema for resources/cosmetics/cosmetics.json
|
|
export const CosmeticsSchema = z.object({
|
|
patterns: z.record(z.string(), PatternSchema),
|
|
/* eslint-disable sort-keys */
|
|
flag: z
|
|
.object({
|
|
layers: z.record(
|
|
z.string(),
|
|
z.object({
|
|
name: z.string(),
|
|
flares: z.string().array().optional(),
|
|
}),
|
|
),
|
|
color: z.record(
|
|
z.string(),
|
|
z.object({
|
|
color: z.string(),
|
|
name: z.string(),
|
|
flares: z.string().array().optional(),
|
|
}),
|
|
),
|
|
})
|
|
.optional(),
|
|
/* eslint-enable sort-keys */
|
|
});
|
|
export type Cosmetics = z.infer<typeof CosmeticsSchema>;
|
|
export type Pattern = z.infer<typeof PatternSchema>;
|
|
export type Product = z.infer<typeof ProductSchema>;
|