TS7005

Variable 'HistoryOrderDataPageSchema' implicitly has an 'any' type.

Broken Code ❌

const HistoryOrderDataPageSchema<T> = z.object({
  items: z.array(HistoryOrderDataSchema),
  nextPagePath: z.union([z.string(), z.null()]),
});

Solution:

Define the type parameter T correctly by making HistoryOrderDataPageSchema a function or using a generic type annotation:

Fixed Code ✔️

const HistoryOrderDataPageSchema = <T>() =>
  z.object({
    items: z.array(HistoryOrderDataSchema<T>()),
    nextPagePath: z.union([z.string(), z.null()]),
  });