|
1 | 1 | 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 | + */ |
2 | 8 | interval?: number
|
3 | 9 | }
|
4 | 10 |
|
5 | 11 | 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 | + */ |
6 | 16 | autosave?: Autosave | boolean
|
| 17 | + /** |
| 18 | + * Allow for editors to schedule publish / unpublish events in the future. |
| 19 | + */ |
7 | 20 | schedulePublish?: boolean
|
| 21 | + /** |
| 22 | + * Set validate to true to validate draft documents when saved. |
| 23 | + * |
| 24 | + * @default false |
| 25 | + */ |
8 | 26 | validate?: boolean
|
9 | 27 | }
|
10 | 28 |
|
11 | 29 | 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 | + */ |
12 | 34 | autosave: Autosave | false
|
| 35 | + /** |
| 36 | + * Allow for editors to schedule publish / unpublish events in the future. |
| 37 | + */ |
13 | 38 | schedulePublish: boolean
|
| 39 | + /** |
| 40 | + * Set validate to true to validate draft documents when saved. |
| 41 | + * |
| 42 | + * @default false |
| 43 | + */ |
14 | 44 | validate: boolean
|
15 | 45 | }
|
16 | 46 |
|
17 | 47 | 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 | + */ |
18 | 52 | 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 | + */ |
19 | 59 | maxPerDoc?: number
|
20 | 60 | }
|
21 | 61 |
|
22 | 62 | 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 | + */ |
23 | 67 | 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 | + */ |
24 | 74 | maxPerDoc: number
|
25 | 75 | }
|
26 | 76 |
|
27 | 77 | export type IncomingGlobalVersions = {
|
28 | 78 | 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 | + */ |
29 | 83 | max?: number
|
30 | 84 | }
|
31 | 85 |
|
32 | 86 | export type SanitizedGlobalVersions = {
|
| 87 | + /** |
| 88 | + * Enable Drafts mode for this global. To enable, set to true or pass an object with draft options |
| 89 | + */ |
33 | 90 | 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 | + */ |
34 | 95 | max: number
|
35 | 96 | }
|
36 | 97 |
|
|
0 commit comments