generated from sanity-io/nextjs-blog-cms-sanity-v3
-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathsanity.types.ts
685 lines (664 loc) · 15.6 KB
/
sanity.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
// Query TypeMap
import '@sanity/client'
/**
* ---------------------------------------------------------------------------------
* This file has been generated by Sanity TypeGen.
* Command: `sanity typegen generate`
*
* Any modifications made directly to this file will be overwritten the next time
* the TypeScript definitions are generated. Please make changes to the Sanity
* schema definitions and/or GROQ queries if you need to update these types.
*
* For more information on how to use Sanity TypeGen, visit the official documentation:
* https://www.sanity.io/docs/sanity-typegen
* ---------------------------------------------------------------------------------
*/
// Source: schema.json
export type SanityImagePaletteSwatch = {
_type: 'sanity.imagePaletteSwatch'
background?: string
foreground?: string
population?: number
title?: string
}
export type SanityImagePalette = {
_type: 'sanity.imagePalette'
darkMuted?: SanityImagePaletteSwatch
lightVibrant?: SanityImagePaletteSwatch
darkVibrant?: SanityImagePaletteSwatch
vibrant?: SanityImagePaletteSwatch
dominant?: SanityImagePaletteSwatch
lightMuted?: SanityImagePaletteSwatch
muted?: SanityImagePaletteSwatch
}
export type SanityImageDimensions = {
_type: 'sanity.imageDimensions'
height?: number
width?: number
aspectRatio?: number
}
export type SanityFileAsset = {
_id: string
_type: 'sanity.fileAsset'
_createdAt: string
_updatedAt: string
_rev: string
originalFilename?: string
label?: string
title?: string
description?: string
altText?: string
sha1hash?: string
extension?: string
mimeType?: string
size?: number
assetId?: string
uploadId?: string
path?: string
url?: string
source?: SanityAssetSourceData
}
export type Geopoint = {
_type: 'geopoint'
lat?: number
lng?: number
alt?: number
}
export type Timeline = {
_type: 'timeline'
items?: Array<{
title?: string
milestones?: Array<
{
_key: string
} & Milestone
>
_type: 'item'
_key: string
}>
}
export type Milestone = {
_type: 'milestone'
title?: string
description?: string
image?: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
}
tags?: Array<string>
duration?: Duration
}
export type Project = {
_id: string
_type: 'project'
_createdAt: string
_updatedAt: string
_rev: string
title?: string
slug?: Slug
overview?: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: null
level?: number
_type: 'block'
_key: string
}>
coverImage?: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
}
duration?: Duration
client?: string
site?: string
tags?: Array<string>
description?: Array<
| {
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}
| ({
_key: string
} & Timeline)
| {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
caption?: string
alt?: string
_type: 'image'
_key: string
}
>
}
export type Page = {
_id: string
_type: 'page'
_createdAt: string
_updatedAt: string
_rev: string
title?: string
slug?: Slug
overview?: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: null
level?: number
_type: 'block'
_key: string
}>
body?: Array<
| {
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}
| ({
_key: string
} & Timeline)
| {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
caption?: string
alt?: string
_type: 'image'
_key: string
}
>
}
export type Slug = {
_type: 'slug'
current?: string
source?: string
}
export type Duration = {
_type: 'duration'
start?: string
end?: string
}
export type Settings = {
_id: string
_type: 'settings'
_createdAt: string
_updatedAt: string
_rev: string
menuItems?: Array<
| {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'home'
}
| {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'page'
}
| {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'project'
}
>
footer?: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'blockquote'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}>
ogImage?: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
}
}
export type SanityImageCrop = {
_type: 'sanity.imageCrop'
top?: number
bottom?: number
left?: number
right?: number
}
export type SanityImageHotspot = {
_type: 'sanity.imageHotspot'
x?: number
y?: number
height?: number
width?: number
}
export type SanityImageAsset = {
_id: string
_type: 'sanity.imageAsset'
_createdAt: string
_updatedAt: string
_rev: string
originalFilename?: string
label?: string
title?: string
description?: string
altText?: string
sha1hash?: string
extension?: string
mimeType?: string
size?: number
assetId?: string
uploadId?: string
path?: string
url?: string
metadata?: SanityImageMetadata
source?: SanityAssetSourceData
}
export type SanityAssetSourceData = {
_type: 'sanity.assetSourceData'
name?: string
id?: string
url?: string
}
export type SanityImageMetadata = {
_type: 'sanity.imageMetadata'
location?: Geopoint
dimensions?: SanityImageDimensions
palette?: SanityImagePalette
lqip?: string
blurHash?: string
hasAlpha?: boolean
isOpaque?: boolean
}
export type Home = {
_id: string
_type: 'home'
_createdAt: string
_updatedAt: string
_rev: string
title?: string
overview?: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}>
showcaseProjects?: Array<{
_ref: string
_type: 'reference'
_weak?: boolean
_key: string
[internalGroqTypeReferenceTo]?: 'project'
}>
}
export type AllSanitySchemaTypes =
| SanityImagePaletteSwatch
| SanityImagePalette
| SanityImageDimensions
| SanityFileAsset
| Geopoint
| Timeline
| Milestone
| Project
| Page
| Slug
| Duration
| Settings
| SanityImageCrop
| SanityImageHotspot
| SanityImageAsset
| SanityAssetSourceData
| SanityImageMetadata
| Home
export declare const internalGroqTypeReferenceTo: unique symbol
// Source: ./sanity/lib/queries.ts
// Variable: homePageQuery
// Query: *[_type == "home"][0]{ _id, _type, overview, showcaseProjects[]{ _key, ...@->{ _id, _type, coverImage, overview, "slug": slug.current, tags, title, } }, title, }
export type HomePageQueryResult = {
_id: string
_type: 'home'
overview: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}> | null
showcaseProjects: Array<{
_key: string
_id: string
_type: 'project'
coverImage: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
} | null
overview: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: null
level?: number
_type: 'block'
_key: string
}> | null
slug: string | null
tags: Array<string> | null
title: string | null
}> | null
title: string | null
} | null
// Variable: pagesBySlugQuery
// Query: *[_type == "page" && slug.current == $slug][0] { _id, _type, body, overview, title, "slug": slug.current, }
export type PagesBySlugQueryResult = {
_id: string
_type: 'page'
body: Array<
| ({
_key: string
} & Timeline)
| {
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}
| {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
caption?: string
alt?: string
_type: 'image'
_key: string
}
> | null
overview: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: null
level?: number
_type: 'block'
_key: string
}> | null
title: string | null
slug: string | null
} | null
// Variable: projectBySlugQuery
// Query: *[_type == "project" && slug.current == $slug][0] { _id, _type, client, coverImage, description, duration, overview, site, "slug": slug.current, tags, title, }
export type ProjectBySlugQueryResult = {
_id: string
_type: 'project'
client: string | null
coverImage: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
} | null
description: Array<
| ({
_key: string
} & Timeline)
| {
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}
| {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
caption?: string
alt?: string
_type: 'image'
_key: string
}
> | null
duration: Duration | null
overview: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'normal'
listItem?: never
markDefs?: null
level?: number
_type: 'block'
_key: string
}> | null
site: string | null
slug: string | null
tags: Array<string> | null
title: string | null
} | null
// Variable: settingsQuery
// Query: *[_type == "settings"][0]{ _id, _type, footer, menuItems[]{ _key, ...@->{ _type, "slug": slug.current, title } }, ogImage, }
export type SettingsQueryResult = {
_id: string
_type: 'settings'
footer: Array<{
children?: Array<{
marks?: Array<string>
text?: string
_type: 'span'
_key: string
}>
style?: 'blockquote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'normal'
listItem?: 'bullet' | 'number'
markDefs?: Array<{
href?: string
_type: 'link'
_key: string
}>
level?: number
_type: 'block'
_key: string
}> | null
menuItems: Array<
| {
_key: null
_type: 'home'
slug: null
title: string | null
}
| {
_key: null
_type: 'page'
slug: string | null
title: string | null
}
| {
_key: null
_type: 'project'
slug: string | null
title: string | null
}
> | null
ogImage: {
asset?: {
_ref: string
_type: 'reference'
_weak?: boolean
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
}
hotspot?: SanityImageHotspot
crop?: SanityImageCrop
_type: 'image'
} | null
} | null
// Variable: slugsByTypeQuery
// Query: *[_type == $type && defined(slug.current)]{"slug": slug.current}
export type SlugsByTypeQueryResult = Array<{
slug: string | null
}>
declare module '@sanity/client' {
interface SanityQueries {
'\n *[_type == "home"][0]{\n _id,\n _type,\n overview,\n showcaseProjects[]{\n _key,\n ...@->{\n _id,\n _type,\n coverImage,\n overview,\n "slug": slug.current,\n tags,\n title,\n }\n },\n title,\n }\n': HomePageQueryResult
'\n *[_type == "page" && slug.current == $slug][0] {\n _id,\n _type,\n body,\n overview,\n title,\n "slug": slug.current,\n }\n': PagesBySlugQueryResult
'\n *[_type == "project" && slug.current == $slug][0] {\n _id,\n _type,\n client,\n coverImage,\n description,\n duration,\n overview,\n site,\n "slug": slug.current,\n tags,\n title,\n }\n': ProjectBySlugQueryResult
'\n *[_type == "settings"][0]{\n _id,\n _type,\n footer,\n menuItems[]{\n _key,\n ...@->{\n _type,\n "slug": slug.current,\n title\n }\n },\n ogImage,\n }\n': SettingsQueryResult
'\n *[_type == $type && defined(slug.current)]{"slug": slug.current}\n': SlugsByTypeQueryResult
}
}