-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanity.types.ts
177 lines (163 loc) · 3.92 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
/**
* ---------------------------------------------------------------------------------
* 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 SanityImageHotspot = {
_type: 'sanity.imageHotspot';
x?: number;
y?: number;
height?: number;
width?: number;
};
export type SanityImageCrop = {
_type: 'sanity.imageCrop';
top?: number;
bottom?: number;
left?: number;
right?: 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 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 SanityImageMetadata = {
_type: 'sanity.imageMetadata';
location?: Geopoint;
dimensions?: SanityImageDimensions;
palette?: SanityImagePalette;
lqip?: string;
blurHash?: string;
hasAlpha?: boolean;
isOpaque?: boolean;
};
export type Slug = {
_type: 'slug';
current?: string;
source?: string;
};
export type SanityAssetSourceData = {
_type: 'sanity.assetSourceData';
name?: string;
id?: string;
url?: string;
};
export type Poi = {
_id: string;
_type: 'poi';
_createdAt: string;
_updatedAt: string;
_rev: string;
address?: string;
description?: string;
type?: string;
position?: Geopoint;
};
export type Geopoint = {
_type: 'geopoint';
lat?: number;
lng?: number;
alt?: number;
};
export type AllSanitySchemaTypes =
| SanityImagePaletteSwatch
| SanityImagePalette
| SanityImageDimensions
| SanityImageHotspot
| SanityImageCrop
| SanityFileAsset
| SanityImageAsset
| SanityImageMetadata
| Slug
| SanityAssetSourceData
| Poi
| Geopoint;
export declare const internalGroqTypeReferenceTo: unique symbol;
// Source: ./src/sanity/lib/queries.ts
// Variable: POIS_QUERY
// Query: *[_type == "poi"][0...12]{ _id, address ,description ,type ,position}
export type POIS_QUERYResult = Array<{
_id: string;
address: string | null;
description: string | null;
type: string | null;
position: Geopoint | null;
}>;
// Query TypeMap
import '@sanity/client';
declare module '@sanity/client' {
interface SanityQueries {
'*[_type == "poi"][0...12]{\n _id, address ,description ,type ,position\n}': POIS_QUERYResult;
}
}