Skip to content

Commit 605da5b

Browse files
feat: add schema features and type defs
1 parent 8f85f29 commit 605da5b

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const schemaFeatures = {
2+
schemas: "schemas",
3+
} as const;
4+
5+
export type SchemaFeatures = typeof schemaFeatures;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { z } from 'zod'
2+
export type AnyZodSchema = z.ZodTypeAny
3+
4+
export interface SchemaDefinition<T extends AnyZodSchema = AnyZodSchema> {
5+
schema: T
6+
description?: string
7+
}
8+
9+
export type SchemaRegistry = Map<string, SchemaDefinition>
10+
11+
declare module 'nitro/types' {
12+
interface NitroApp {
13+
schemaRegistry: SchemaRegistry
14+
}
15+
}

0 commit comments

Comments
 (0)