feat!: type auto-generation (#6657)
Types are now auto-generated by default.
You can opt-out of this behavior by setting:
```ts
buildConfig({
// Rest of config
typescript: {
autoGenerate: false
},
})
```
This commit is contained in:
@@ -11,6 +11,7 @@ export interface Config {
|
||||
posts: Post;
|
||||
'relation-a': RelationA;
|
||||
'relation-b': RelationB;
|
||||
'pg-migrations': PgMigration;
|
||||
'custom-schema': CustomSchema;
|
||||
users: User;
|
||||
'payload-preferences': PayloadPreference;
|
||||
@@ -87,6 +88,40 @@ export interface RelationB {
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "pg-migrations".
|
||||
*/
|
||||
export interface PgMigration {
|
||||
id: string;
|
||||
relation1?: (string | null) | RelationA;
|
||||
myArray?:
|
||||
| {
|
||||
relation2?: (string | null) | RelationB;
|
||||
mySubArray?:
|
||||
| {
|
||||
relation3?: (string | null) | RelationB;
|
||||
id?: string | null;
|
||||
}[]
|
||||
| null;
|
||||
id?: string | null;
|
||||
}[]
|
||||
| null;
|
||||
myGroup?: {
|
||||
relation4?: (string | null) | RelationB;
|
||||
};
|
||||
myBlocks?:
|
||||
| {
|
||||
relation5?: (string | null) | RelationA;
|
||||
relation6?: (string | null) | RelationB;
|
||||
id?: string | null;
|
||||
blockName?: string | null;
|
||||
blockType: 'myBlock';
|
||||
}[]
|
||||
| null;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-schema".
|
||||
@@ -116,6 +151,7 @@ export interface CustomSchema {
|
||||
| null;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
_status?: ('draft' | 'published') | null;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
|
||||
Reference in New Issue
Block a user