@caiquecamargo/vite-plugin-netlify-cms 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +523 -4
- package/dist/index.js +239 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -40
- package/dist/admin/config.yml +0 -70
- package/dist/index.es.js +0 -4800
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -135
- package/dist/index.umd.js.map +0 -1
- package/dist/src/demo.d.ts +0 -1
- package/dist/src/plugin.d.ts +0 -29
- package/dist/src/types.d.ts +0 -336
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,523 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
type Widgets = 'boolean' | 'code' | 'color' | 'datetime' | 'hidden' | 'file' | 'image' | 'list' | 'map' | 'number' | 'object' | 'relation' | 'select' | 'string' | 'text' | 'markdown';
|
|
4
|
+
interface Widget {
|
|
5
|
+
name: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
widget: Widgets;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
pattern?: string[];
|
|
10
|
+
comment?: string;
|
|
11
|
+
}
|
|
12
|
+
interface BooleanWidget extends Widget {
|
|
13
|
+
widget: 'boolean';
|
|
14
|
+
default?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface CodeWidget extends Widget {
|
|
17
|
+
widget: 'code';
|
|
18
|
+
default_language?: string;
|
|
19
|
+
allow_language_selection?: boolean;
|
|
20
|
+
keys?: string;
|
|
21
|
+
output_code_only?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface ColorWidget extends Widget {
|
|
24
|
+
widget: 'color';
|
|
25
|
+
default?: string;
|
|
26
|
+
allowInput?: boolean;
|
|
27
|
+
enableAlpha?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface DateTimeWidget extends Widget {
|
|
30
|
+
widget: 'datetime';
|
|
31
|
+
default?: string;
|
|
32
|
+
format?: string;
|
|
33
|
+
date_format?: string | boolean;
|
|
34
|
+
time_format?: string | boolean;
|
|
35
|
+
picker_utc?: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface HiddenWidget extends Widget {
|
|
38
|
+
widget: 'hidden';
|
|
39
|
+
default?: any;
|
|
40
|
+
}
|
|
41
|
+
interface FileWidget extends Widget {
|
|
42
|
+
widget: 'file';
|
|
43
|
+
default?: string;
|
|
44
|
+
media_library?: Record<string, unknown>;
|
|
45
|
+
allow_multiple?: boolean;
|
|
46
|
+
config?: Record<string, unknown>;
|
|
47
|
+
media_folder?: string;
|
|
48
|
+
choose_url?: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface ImageWidget extends Widget {
|
|
51
|
+
widget: 'image';
|
|
52
|
+
default?: string;
|
|
53
|
+
media_library?: Record<string, unknown>;
|
|
54
|
+
allow_multiple?: boolean;
|
|
55
|
+
config?: Record<string, unknown>;
|
|
56
|
+
media_folder?: string;
|
|
57
|
+
choose_url?: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface ListWidget extends Widget {
|
|
60
|
+
widget: 'list';
|
|
61
|
+
default?: string[] | CollectionField[];
|
|
62
|
+
allow_add?: boolean;
|
|
63
|
+
collapsed?: boolean;
|
|
64
|
+
summary?: string;
|
|
65
|
+
minimize_collapsed?: boolean;
|
|
66
|
+
label_singular?: string;
|
|
67
|
+
field?: CollectionField;
|
|
68
|
+
fields?: CollectionField[];
|
|
69
|
+
types?: ObjectWidget[];
|
|
70
|
+
max?: number;
|
|
71
|
+
min?: number;
|
|
72
|
+
add_to_top?: boolean;
|
|
73
|
+
}
|
|
74
|
+
interface MapWidget extends Widget {
|
|
75
|
+
widget: 'map';
|
|
76
|
+
default?: string;
|
|
77
|
+
decimals?: number;
|
|
78
|
+
type?: 'Point' | 'LineString' | 'Polygon';
|
|
79
|
+
}
|
|
80
|
+
interface NumberWidget extends Widget {
|
|
81
|
+
widget: 'number';
|
|
82
|
+
default?: string | number;
|
|
83
|
+
value_type?: 'int' | 'float';
|
|
84
|
+
min?: number;
|
|
85
|
+
max?: number;
|
|
86
|
+
step?: number;
|
|
87
|
+
}
|
|
88
|
+
interface ObjectWidget extends Widget {
|
|
89
|
+
widget: 'object';
|
|
90
|
+
default?: CollectionField[];
|
|
91
|
+
collapsed?: boolean;
|
|
92
|
+
summary?: string;
|
|
93
|
+
fields: CollectionField[];
|
|
94
|
+
}
|
|
95
|
+
interface RelationWidget extends Widget {
|
|
96
|
+
widget: 'relation';
|
|
97
|
+
default?: any;
|
|
98
|
+
collection: string;
|
|
99
|
+
value_field: string;
|
|
100
|
+
search_fields: string[];
|
|
101
|
+
file?: string;
|
|
102
|
+
display_fields?: string[];
|
|
103
|
+
multiple?: boolean;
|
|
104
|
+
min?: number;
|
|
105
|
+
max?: number;
|
|
106
|
+
options_length?: number;
|
|
107
|
+
}
|
|
108
|
+
interface SelectWidget extends Widget {
|
|
109
|
+
widget: 'select';
|
|
110
|
+
default?: string | {
|
|
111
|
+
label: string;
|
|
112
|
+
value: string;
|
|
113
|
+
};
|
|
114
|
+
options?: string[] | {
|
|
115
|
+
label: string;
|
|
116
|
+
value: string;
|
|
117
|
+
}[];
|
|
118
|
+
multiple?: boolean;
|
|
119
|
+
min?: number;
|
|
120
|
+
max?: number;
|
|
121
|
+
}
|
|
122
|
+
interface StringWidget extends Widget {
|
|
123
|
+
widget: 'string';
|
|
124
|
+
default?: string;
|
|
125
|
+
}
|
|
126
|
+
interface TextWidget extends Widget {
|
|
127
|
+
widget: 'text';
|
|
128
|
+
default?: string;
|
|
129
|
+
}
|
|
130
|
+
type MarkdownButtons = 'bold' | 'italic' | 'code' | 'link' | 'heading-one' | 'heading-two' | 'heading-three | heading-four' | 'heading-five' | 'heading-six' | 'quote' | 'bulleted-list' | 'numbered-list';
|
|
131
|
+
interface MarkdownWidget extends Widget {
|
|
132
|
+
widget: 'markdown';
|
|
133
|
+
default?: string;
|
|
134
|
+
buttons?: MarkdownButtons[];
|
|
135
|
+
editor_components?: ('image' | 'code-block')[];
|
|
136
|
+
modes?: ('raw' | 'rich_text')[];
|
|
137
|
+
sanitize_preview?: boolean;
|
|
138
|
+
}
|
|
139
|
+
type CollectionField = BooleanWidget | CodeWidget | ColorWidget | DateTimeWidget | HiddenWidget | FileWidget | ImageWidget | ListWidget | MapWidget | NumberWidget | ObjectWidget | RelationWidget | SelectWidget | StringWidget | TextWidget | MarkdownWidget;
|
|
140
|
+
interface Collection {
|
|
141
|
+
/**
|
|
142
|
+
* unique identifier for the collection, used as the key
|
|
143
|
+
* when referenced in other contexts (like the relation widget)
|
|
144
|
+
*/
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* Identifier field for the collection.
|
|
148
|
+
*
|
|
149
|
+
* defaults to title
|
|
150
|
+
*/
|
|
151
|
+
identifier_field?: string;
|
|
152
|
+
/**
|
|
153
|
+
* label for the collection in the editor UI;
|
|
154
|
+
* defaults to the value of name
|
|
155
|
+
*/
|
|
156
|
+
label?: string;
|
|
157
|
+
/**
|
|
158
|
+
* singular label for certain elements in the editor;
|
|
159
|
+
* defaults to the value of label
|
|
160
|
+
*/
|
|
161
|
+
label_singular?: string;
|
|
162
|
+
/**
|
|
163
|
+
* optional text, displayed below the label when viewing a collection
|
|
164
|
+
*/
|
|
165
|
+
description?: string;
|
|
166
|
+
/**
|
|
167
|
+
* for publish_mode: editorial_workflow only;
|
|
168
|
+
* false hides UI publishing controls for a collection;
|
|
169
|
+
*
|
|
170
|
+
* defaults to true
|
|
171
|
+
*/
|
|
172
|
+
publish?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* true hides a collection in the CMS UI;
|
|
175
|
+
*
|
|
176
|
+
* defaults to false.
|
|
177
|
+
* Useful when using the relation widget to hide referenced collections.
|
|
178
|
+
*/
|
|
179
|
+
hide?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* false prevents users from deleting items in a collection;
|
|
182
|
+
*
|
|
183
|
+
* defaults to true
|
|
184
|
+
*/
|
|
185
|
+
delete?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* These settings determine how collection files are parsed and saved.
|
|
188
|
+
*/
|
|
189
|
+
extension?: 'yml' | 'yaml' | 'toml' | 'json' | 'md' | 'markdown' | 'html';
|
|
190
|
+
/**
|
|
191
|
+
* These settings determine how collection files are parsed and saved.
|
|
192
|
+
*/
|
|
193
|
+
format?: 'yml' | 'yaml' | 'toml' | 'json' | 'frontmatter' | 'yaml-frontmatter' | 'toml-frontmatter' | 'json-frontmatter';
|
|
194
|
+
frontmatter_delimiter?: string;
|
|
195
|
+
/**
|
|
196
|
+
* specifies a template for generating new filenames
|
|
197
|
+
* based on a file's creation date and title field
|
|
198
|
+
*/
|
|
199
|
+
slug?: string;
|
|
200
|
+
/**
|
|
201
|
+
* A string representing the path where content in this collection can be found on the live site.
|
|
202
|
+
*/
|
|
203
|
+
preview_path?: string;
|
|
204
|
+
/**
|
|
205
|
+
* The name of a date field for parsing date-based template tags from preview_path
|
|
206
|
+
*/
|
|
207
|
+
preview_path_date_field?: string;
|
|
208
|
+
/**
|
|
209
|
+
* The fields option maps editor UI widgets to field-value pairs in the saved file
|
|
210
|
+
*/
|
|
211
|
+
fields: CollectionField[];
|
|
212
|
+
/**
|
|
213
|
+
* changes options for the editor view of a collection
|
|
214
|
+
*/
|
|
215
|
+
editor?: {
|
|
216
|
+
preview?: boolean;
|
|
217
|
+
};
|
|
218
|
+
summary?: string;
|
|
219
|
+
/**
|
|
220
|
+
* An optional list of sort fields to show in the UI.
|
|
221
|
+
*/
|
|
222
|
+
sortable_fields?: string;
|
|
223
|
+
/**
|
|
224
|
+
* An optional list of predefined view filters to show in the UI.
|
|
225
|
+
*/
|
|
226
|
+
view_filters?: string;
|
|
227
|
+
/**
|
|
228
|
+
* An optional list of predefined view groups to show in the UI.
|
|
229
|
+
*/
|
|
230
|
+
view_groups?: string;
|
|
231
|
+
}
|
|
232
|
+
interface FileCollection {
|
|
233
|
+
name: string;
|
|
234
|
+
label?: string;
|
|
235
|
+
files: FileCollectionEntry[];
|
|
236
|
+
}
|
|
237
|
+
interface FileCollectionEntry extends Collection {
|
|
238
|
+
/**
|
|
239
|
+
* specifies the collection type and location;
|
|
240
|
+
* details in Collection Types
|
|
241
|
+
*/
|
|
242
|
+
file: string;
|
|
243
|
+
}
|
|
244
|
+
interface FolderCollection extends Collection {
|
|
245
|
+
/**
|
|
246
|
+
* specifies the collection type and location;
|
|
247
|
+
* details in Collection Types
|
|
248
|
+
*/
|
|
249
|
+
folder: string;
|
|
250
|
+
/**
|
|
251
|
+
* optional filter for folder collections; details in Collection Types
|
|
252
|
+
*/
|
|
253
|
+
filter?: string;
|
|
254
|
+
/**
|
|
255
|
+
* true allows users to create new items in the collection;
|
|
256
|
+
*
|
|
257
|
+
* defaults to false
|
|
258
|
+
*/
|
|
259
|
+
create?: boolean;
|
|
260
|
+
}
|
|
261
|
+
type Locales = 'bg' | 'ca' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fa' | 'fr' | 'he' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nb_no' | 'nl' | 'nn_no' | 'pl' | 'pt' | 'ro' | 'ru' | 'sl' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh-Hans' | 'zh-Hant';
|
|
262
|
+
interface CloudinaryMediaLibrary {
|
|
263
|
+
name: 'cloudinary';
|
|
264
|
+
config: {
|
|
265
|
+
[key: string]: unknown;
|
|
266
|
+
cloud_name: string;
|
|
267
|
+
api_key: string;
|
|
268
|
+
/**
|
|
269
|
+
* By default, the value provided for a selected image is a complete URL
|
|
270
|
+
* for the asset on Cloudinary's CDN. Setting output_filename_only to true
|
|
271
|
+
* will instead produce just the filename (e.g. image.jpg). This should be
|
|
272
|
+
* true if you will be directly embedding cloudinary transformation urls in page templates
|
|
273
|
+
*
|
|
274
|
+
* @default false
|
|
275
|
+
*/
|
|
276
|
+
output_filename_only?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* If true, uses derived url when available (the url will have image
|
|
279
|
+
* transformation segments included). Has no effect if output_filename_only
|
|
280
|
+
* is set to true
|
|
281
|
+
*
|
|
282
|
+
* @default true
|
|
283
|
+
*/
|
|
284
|
+
use_transformations?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Controls whether an http or https URL is provided.
|
|
287
|
+
* Has no effect if output_filename_only is set to true
|
|
288
|
+
*
|
|
289
|
+
* @default true
|
|
290
|
+
*/
|
|
291
|
+
use_secure_url?: boolean;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
interface UploadcareMediaLibrary {
|
|
295
|
+
name: 'uploadcare';
|
|
296
|
+
/** @see https://uploadcare.com/docs/uploads/file-uploader-options/ */
|
|
297
|
+
config: {
|
|
298
|
+
[key: string]: unknown;
|
|
299
|
+
/**
|
|
300
|
+
* specify whether to add a filename to the end of the url
|
|
301
|
+
*
|
|
302
|
+
* @example http://ucarecdn.com/:uuid/filename.png
|
|
303
|
+
*/
|
|
304
|
+
autoFilename?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* specify a string added at the end of the url.
|
|
307
|
+
* This could be useful to apply a set of CDN operations to each image,
|
|
308
|
+
* for example resizing or compression.
|
|
309
|
+
*
|
|
310
|
+
* @see https://uploadcare.com/docs/transformations/image/#image-transformations-list
|
|
311
|
+
*/
|
|
312
|
+
defaultOperations?: string;
|
|
313
|
+
publicKey: string;
|
|
314
|
+
multiple?: boolean;
|
|
315
|
+
multipleMax?: number;
|
|
316
|
+
multipleMin?: number;
|
|
317
|
+
onlyImages?: boolean;
|
|
318
|
+
crop?: string;
|
|
319
|
+
clearable?: boolean;
|
|
320
|
+
previewStep?: boolean;
|
|
321
|
+
imageShrink?: string;
|
|
322
|
+
inputAcceptTypes?: string;
|
|
323
|
+
locale?: Locales | string;
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
type MediaLibrary = CloudinaryMediaLibrary | UploadcareMediaLibrary;
|
|
327
|
+
interface NetlifyCMSConfig {
|
|
328
|
+
/**
|
|
329
|
+
* Enable the local backend for testing
|
|
330
|
+
*
|
|
331
|
+
* Requires to run a local backend server (npx decap-server)
|
|
332
|
+
*
|
|
333
|
+
* @see https://decapcms.org/docs/beta-features/?#working-with-a-local-git-repository
|
|
334
|
+
*/
|
|
335
|
+
local_backend?: boolean;
|
|
336
|
+
backend: {
|
|
337
|
+
/**
|
|
338
|
+
* The name of the backend to use.
|
|
339
|
+
*/
|
|
340
|
+
name: 'git-gateway' | 'github' | 'gitlab' | 'bitbucket' | 'azure' | 'gitea';
|
|
341
|
+
/**
|
|
342
|
+
* [org-or-username]/[repo-name] Required for github, gitlab,
|
|
343
|
+
* bitbucket, azure, gitea and ignored by git-gateway.
|
|
344
|
+
*/
|
|
345
|
+
repo?: string;
|
|
346
|
+
/**
|
|
347
|
+
* The branch where published content is stored.
|
|
348
|
+
* All CMS commits and PRs are made to this branch.
|
|
349
|
+
*
|
|
350
|
+
* @default master
|
|
351
|
+
*/
|
|
352
|
+
branch?: string;
|
|
353
|
+
/**
|
|
354
|
+
* The API endpoint. Only necessary in certain cases,
|
|
355
|
+
* like with GitHub Enterprise or self-hosted GitLab.
|
|
356
|
+
*
|
|
357
|
+
* @default https://api.github.com (GitHub),
|
|
358
|
+
* @default https://gitlab.com/api/v4 (GitLab)
|
|
359
|
+
* @default https://api.bitbucket.org/2.0 (Bitbucket)
|
|
360
|
+
*/
|
|
361
|
+
api_root?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Sets the site_id query param sent to the API endpoint.
|
|
364
|
+
* Non-Netlify auth setups will often need to set this for
|
|
365
|
+
* local development to work properly.
|
|
366
|
+
*
|
|
367
|
+
* @default location.hostname (or cms.netlify.com when on localhost)
|
|
368
|
+
*/
|
|
369
|
+
site_doamin?: string;
|
|
370
|
+
/**
|
|
371
|
+
* OAuth client hostname (just the base domain, no path).
|
|
372
|
+
* Required when using an external OAuth server or self-hosted GitLab.
|
|
373
|
+
*
|
|
374
|
+
* @default https://api.netlify.com (GitHub, Bitbucket)
|
|
375
|
+
* @default https://gitlab.com (GitLab)
|
|
376
|
+
*/
|
|
377
|
+
base_url?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Path to append to base_url for authentication requests.
|
|
380
|
+
*
|
|
381
|
+
* @default auth (GitHub, Bitbucket)
|
|
382
|
+
* @default oauth/authorize (GitLab)
|
|
383
|
+
*/
|
|
384
|
+
auth_endpoint?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Pull (or Merge) Requests label prefix when using editorial workflow.
|
|
387
|
+
*
|
|
388
|
+
* @default decap-cms/
|
|
389
|
+
*/
|
|
390
|
+
cms_label_prefix?: string;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* By default, all entries created or edited in the Decap CMS are committed directly
|
|
394
|
+
* into the main repository branch.
|
|
395
|
+
*
|
|
396
|
+
* The publish_mode option allows you to enable "Editorial Workflow" mode
|
|
397
|
+
* for more control over the content publishing phases. All unpublished
|
|
398
|
+
* entries will be arranged in a board according to their status,
|
|
399
|
+
* and they can be further reviewed and edited before going live.
|
|
400
|
+
* Note: Editorial workflow works with GitHub repositories,
|
|
401
|
+
* and support for GitLab and Bitbucket is in beta.
|
|
402
|
+
*
|
|
403
|
+
* @see https://decapcms.org/docs/configuration-options/#publish-mode
|
|
404
|
+
*/
|
|
405
|
+
publish_mode?: 'editorial_workflow';
|
|
406
|
+
/**
|
|
407
|
+
* The media_folder option specifies the folder path where
|
|
408
|
+
* uploaded files should be saved, relative to the base of the repo.
|
|
409
|
+
*
|
|
410
|
+
* @example media_folder: "static/images/uploads"
|
|
411
|
+
*/
|
|
412
|
+
media_folder: string;
|
|
413
|
+
/**
|
|
414
|
+
* The public_folder option specifies the folder path where the
|
|
415
|
+
* files uploaded by the media library will be accessed, relative to
|
|
416
|
+
* the base of the built site. For fields controlled by [file] or [image]
|
|
417
|
+
* widgets, the value of the field is generated by prepending this path to
|
|
418
|
+
* the filename of the selected file. Defaults to the value of media_folder,
|
|
419
|
+
* with an opening / if one is not already included.
|
|
420
|
+
*
|
|
421
|
+
* @example public_folder: "/images/uploads"
|
|
422
|
+
*/
|
|
423
|
+
public_folder?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Media library integrations are configured via the media_library property,
|
|
426
|
+
* and its value should be an object with at least a name property.
|
|
427
|
+
* A config property can also be used for options that should be passed to the library in use.
|
|
428
|
+
*/
|
|
429
|
+
media_library?: MediaLibrary;
|
|
430
|
+
site_url?: string;
|
|
431
|
+
display_url?: string;
|
|
432
|
+
logo_url?: string;
|
|
433
|
+
/**
|
|
434
|
+
* Define the cms language,
|
|
435
|
+
*
|
|
436
|
+
* If uses a language not supported, requires to be registered in the cms
|
|
437
|
+
*
|
|
438
|
+
* @see https://decapcms.org/docs/configuration-options/#locale
|
|
439
|
+
*
|
|
440
|
+
* @default en
|
|
441
|
+
*/
|
|
442
|
+
locale?: Locales | string;
|
|
443
|
+
show_preview_links?: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* The search functionally requires loading all collection(s) entries,
|
|
446
|
+
* which can exhaust rate limits on large repositories.
|
|
447
|
+
* It can be disabled by setting the top level search property to false
|
|
448
|
+
*
|
|
449
|
+
* @default true
|
|
450
|
+
*/
|
|
451
|
+
search?: boolean;
|
|
452
|
+
slug?: {
|
|
453
|
+
encoding?: 'unicode' | 'ascii';
|
|
454
|
+
clean_accents?: boolean;
|
|
455
|
+
sanitize_replacement?: string;
|
|
456
|
+
};
|
|
457
|
+
collections: (FileCollection | FolderCollection)[];
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare function defineConfig(config: NetlifyCMSConfig): NetlifyCMSConfig;
|
|
461
|
+
declare function defineFolderCollection(collection: FolderCollection): FolderCollection;
|
|
462
|
+
declare const defineFileCollection: (collection: FileCollection) => FileCollection;
|
|
463
|
+
declare const defineFileCollectionEntry: (collection: FileCollectionEntry) => FileCollectionEntry;
|
|
464
|
+
declare function defineBooleanWidget(widget: Omit<BooleanWidget, 'widget'>): BooleanWidget;
|
|
465
|
+
declare function defineCodeWidget(widget: Omit<CodeWidget, 'widget'>): CodeWidget;
|
|
466
|
+
declare function defineColorWidget(widget: Omit<ColorWidget, 'widget'>): ColorWidget;
|
|
467
|
+
declare function defineDateTimeWidget(widget: Omit<DateTimeWidget, 'widget'>): DateTimeWidget;
|
|
468
|
+
declare function defineHiddenWidget(widget: Omit<HiddenWidget, 'widget'>): HiddenWidget;
|
|
469
|
+
declare function defineFileWidget(widget: Omit<FileWidget, 'widget'>): FileWidget;
|
|
470
|
+
declare function defineImageWidget(widget: Omit<ImageWidget, 'widget'>): ImageWidget;
|
|
471
|
+
declare function defineListWidget(widget: Omit<ListWidget, 'widget'>): ListWidget;
|
|
472
|
+
declare function defineMapWidget(widget: Omit<MapWidget, 'widget'>): MapWidget;
|
|
473
|
+
declare function defineNumberWidget(widget: Omit<NumberWidget, 'widget'>): NumberWidget;
|
|
474
|
+
declare function defineObjectWidget(widget: Omit<ObjectWidget, 'widget'>): ObjectWidget;
|
|
475
|
+
declare function defineRelationWidget(widget: Omit<RelationWidget, 'widget'>): RelationWidget;
|
|
476
|
+
declare function defineSelectWidget(widget: Omit<SelectWidget, 'widget'>): SelectWidget;
|
|
477
|
+
declare function defineStringWidget(widget: Omit<StringWidget, 'widget'>): StringWidget;
|
|
478
|
+
declare function defineTextWidget(widget: Omit<TextWidget, 'widget'>): TextWidget;
|
|
479
|
+
declare function defineMarkdownWidget(widget: Omit<MarkdownWidget, 'widget'>): MarkdownWidget;
|
|
480
|
+
interface NetlifyCMSEntry {
|
|
481
|
+
/**
|
|
482
|
+
* Name of config file
|
|
483
|
+
*
|
|
484
|
+
* @default cms.config
|
|
485
|
+
*/
|
|
486
|
+
configFile?: string;
|
|
487
|
+
/**
|
|
488
|
+
* Netlify CMS config object
|
|
489
|
+
*/
|
|
490
|
+
config?: NetlifyCMSConfig;
|
|
491
|
+
/**
|
|
492
|
+
* Folder to save config file
|
|
493
|
+
*
|
|
494
|
+
* @default ./public/admin
|
|
495
|
+
*/
|
|
496
|
+
saveFolder?: string;
|
|
497
|
+
/**
|
|
498
|
+
* If has to create index.html file in the save folder
|
|
499
|
+
*/
|
|
500
|
+
createIndexHTML?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Title of the admin page
|
|
503
|
+
*
|
|
504
|
+
* @default Admin
|
|
505
|
+
*/
|
|
506
|
+
title?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Icon URL of the admin page
|
|
509
|
+
*
|
|
510
|
+
* @default https://decapcms.org/img/decap-logo.svg
|
|
511
|
+
*/
|
|
512
|
+
iconUrl?: string;
|
|
513
|
+
/**
|
|
514
|
+
* If has to use identity widget
|
|
515
|
+
*
|
|
516
|
+
* @default true
|
|
517
|
+
*/
|
|
518
|
+
useIdentityWidget?: boolean;
|
|
519
|
+
}
|
|
520
|
+
declare function createConfig(root: string, entry?: NetlifyCMSEntry): Promise<void>;
|
|
521
|
+
declare function export_default(entry?: NetlifyCMSEntry): Promise<Plugin>;
|
|
522
|
+
|
|
523
|
+
export { type BooleanWidget, type CodeWidget, type Collection, type CollectionField, type ColorWidget, type DateTimeWidget, type FileCollection, type FileCollectionEntry, type FileWidget, type FolderCollection, type HiddenWidget, type ImageWidget, type ListWidget, type MapWidget, type MarkdownWidget, type NetlifyCMSConfig, type NetlifyCMSEntry, type NumberWidget, type ObjectWidget, type RelationWidget, type SelectWidget, type StringWidget, type TextWidget, type Widget, createConfig, export_default as default, defineBooleanWidget, defineCodeWidget, defineColorWidget, defineConfig, defineDateTimeWidget, defineFileCollection, defineFileCollectionEntry, defineFileWidget, defineFolderCollection, defineHiddenWidget, defineImageWidget, defineListWidget, defineMapWidget, defineMarkdownWidget, defineNumberWidget, defineObjectWidget, defineRelationWidget, defineSelectWidget, defineStringWidget, defineTextWidget };
|