feat: jsdocs for generated types, by using admin.description (#9917)
This makes use of admin.description to generate JSDocs for field,
collection and global generated types.


For the future, we should add a dedicated property to override these
JSDocs.
You can view the effect of this PR on our test suite generated types
here:
05f552bbbc
This commit is contained in:
@@ -310,6 +310,9 @@ export interface LexicalMigrateField {
|
||||
export interface LexicalLocalizedField {
|
||||
id: string;
|
||||
title: string;
|
||||
/**
|
||||
* Non-localized field with localized block subfields
|
||||
*/
|
||||
lexicalBlocksSubLocalized?: {
|
||||
root: {
|
||||
type: string;
|
||||
@@ -325,6 +328,9 @@ export interface LexicalLocalizedField {
|
||||
};
|
||||
[k: string]: unknown;
|
||||
} | null;
|
||||
/**
|
||||
* Localized field with localized block subfields
|
||||
*/
|
||||
lexicalBlocksLocalized?: {
|
||||
root: {
|
||||
type: string;
|
||||
@@ -475,6 +481,9 @@ export interface ArrayField {
|
||||
id?: string | null;
|
||||
}[]
|
||||
| null;
|
||||
/**
|
||||
* Row labels rendered as react components.
|
||||
*/
|
||||
rowLabelAsComponent?:
|
||||
| {
|
||||
title?: string | null;
|
||||
@@ -589,6 +598,9 @@ export interface BlockField {
|
||||
}
|
||||
)[]
|
||||
| null;
|
||||
/**
|
||||
* The purpose of this field is to test validateExistingBlockIsIdentical works with similar blocks with group fields
|
||||
*/
|
||||
blocksWithSimilarGroup?:
|
||||
| (
|
||||
| {
|
||||
@@ -777,9 +789,18 @@ export interface TextField {
|
||||
id: string;
|
||||
text: string;
|
||||
hiddenTextField?: string | null;
|
||||
/**
|
||||
* This field should be hidden
|
||||
*/
|
||||
adminHiddenTextField?: string | null;
|
||||
/**
|
||||
* This field should be disabled
|
||||
*/
|
||||
disabledTextField?: string | null;
|
||||
localizedText?: string | null;
|
||||
/**
|
||||
* en description
|
||||
*/
|
||||
i18nText?: string | null;
|
||||
defaultString?: string | null;
|
||||
defaultEmptyString?: string | null;
|
||||
@@ -900,8 +921,14 @@ export interface ConditionalLogic {
|
||||
userConditional?: string | null;
|
||||
parentGroup?: {
|
||||
enableParentGroupFields?: boolean | null;
|
||||
/**
|
||||
* Ensures we can rely on nested fields within `data`.
|
||||
*/
|
||||
siblingField?: string | null;
|
||||
};
|
||||
/**
|
||||
* Ensures we can rely on nested fields within `siblingsData`.
|
||||
*/
|
||||
reliesOnParentGroup?: string | null;
|
||||
groupSelection?: ('group1' | 'group2') | null;
|
||||
group1?: {
|
||||
@@ -981,6 +1008,9 @@ export interface EmailField {
|
||||
email: string;
|
||||
localizedEmail?: string | null;
|
||||
emailWithAutocomplete?: string | null;
|
||||
/**
|
||||
* en description
|
||||
*/
|
||||
i18nEmail?: string | null;
|
||||
defaultEmail?: string | null;
|
||||
defaultEmptyString?: string | null;
|
||||
@@ -1010,6 +1040,9 @@ export interface RadioField {
|
||||
*/
|
||||
export interface GroupField {
|
||||
id: string;
|
||||
/**
|
||||
* This is a group.
|
||||
*/
|
||||
group: {
|
||||
text: string;
|
||||
defaultParent?: string | null;
|
||||
@@ -1402,6 +1435,9 @@ export interface RichTextField {
|
||||
[k: string]: unknown;
|
||||
};
|
||||
lexicalCustomFields_html?: string | null;
|
||||
/**
|
||||
* This rich text field uses the lexical editor.
|
||||
*/
|
||||
lexical?: {
|
||||
root: {
|
||||
type: string;
|
||||
@@ -1417,6 +1453,9 @@ export interface RichTextField {
|
||||
};
|
||||
[k: string]: unknown;
|
||||
} | null;
|
||||
/**
|
||||
* This select field is rendered here to ensure its options dropdown renders above the rich text toolbar.
|
||||
*/
|
||||
selectHasMany?: ('one' | 'two' | 'three' | 'four' | 'five' | 'six')[] | null;
|
||||
richText: {
|
||||
[k: string]: unknown;
|
||||
@@ -1505,6 +1544,9 @@ export interface TabsFields2 {
|
||||
*/
|
||||
export interface TabsField {
|
||||
id: string;
|
||||
/**
|
||||
* This should not collapse despite there being many tabs pushing the main fields open.
|
||||
*/
|
||||
sidebarField?: string | null;
|
||||
array: {
|
||||
text: string;
|
||||
|
||||
Reference in New Issue
Block a user