Skip to content

Commit ede7bd7

Browse files
authored
docs: add missing jsdocs to version config (#11258)
1 parent 1c4eba4 commit ede7bd7

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

packages/payload/src/versions/types.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,97 @@
11
export type Autosave = {
2+
/**
3+
* Define an `interval` in milliseconds to automatically save progress while documents are edited.
4+
* Document updates are "debounced" at this interval.
5+
*
6+
* @default 800
7+
*/
28
interval?: number
39
}
410

511
export type IncomingDrafts = {
12+
/**
13+
* Enable autosave to automatically save progress while documents are edited.
14+
* To enable, set to true or pass an object with options.
15+
*/
616
autosave?: Autosave | boolean
17+
/**
18+
* Allow for editors to schedule publish / unpublish events in the future.
19+
*/
720
schedulePublish?: boolean
21+
/**
22+
* Set validate to true to validate draft documents when saved.
23+
*
24+
* @default false
25+
*/
826
validate?: boolean
927
}
1028

1129
export type SanitizedDrafts = {
30+
/**
31+
* Enable autosave to automatically save progress while documents are edited.
32+
* To enable, set to true or pass an object with options.
33+
*/
1234
autosave: Autosave | false
35+
/**
36+
* Allow for editors to schedule publish / unpublish events in the future.
37+
*/
1338
schedulePublish: boolean
39+
/**
40+
* Set validate to true to validate draft documents when saved.
41+
*
42+
* @default false
43+
*/
1444
validate: boolean
1545
}
1646

1747
export type IncomingCollectionVersions = {
48+
/**
49+
* Enable Drafts mode for this collection.
50+
* To enable, set to true or pass an object with draft options.
51+
*/
1852
drafts?: boolean | IncomingDrafts
53+
/**
54+
* Use this setting to control how many versions to keep on a document by document basis.
55+
* Must be an integer. Use 0 to save all versions.
56+
*
57+
* @default 100
58+
*/
1959
maxPerDoc?: number
2060
}
2161

2262
export interface SanitizedCollectionVersions extends Omit<IncomingCollectionVersions, 'drafts'> {
63+
/**
64+
* Enable Drafts mode for this collection.
65+
* To enable, set to true or pass an object with draft options.
66+
*/
2367
drafts: false | SanitizedDrafts
68+
/**
69+
* Use this setting to control how many versions to keep on a document by document basis.
70+
* Must be an integer. Use 0 to save all versions.
71+
*
72+
* @default 100
73+
*/
2474
maxPerDoc: number
2575
}
2676

2777
export type IncomingGlobalVersions = {
2878
drafts?: boolean | IncomingDrafts
79+
/**
80+
* Use this setting to control how many versions to keep on a global by global basis.
81+
* Must be an integer.
82+
*/
2983
max?: number
3084
}
3185

3286
export type SanitizedGlobalVersions = {
87+
/**
88+
* Enable Drafts mode for this global. To enable, set to true or pass an object with draft options
89+
*/
3390
drafts: false | SanitizedDrafts
91+
/**
92+
* Use this setting to control how many versions to keep on a global by global basis.
93+
* Must be an integer.
94+
*/
3495
max: number
3596
}
3697

0 commit comments

Comments
 (0)