@nonphoto/sanity-image 3.2.0 → 5.0.0
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 +516 -68
- package/dist/index.js +278 -114
- package/package.json +5 -2
- package/src/asset.ts +120 -9
- package/src/constants.ts +7 -0
- package/src/crop.ts +14 -0
- package/src/hotspot.ts +14 -0
- package/src/image.ts +69 -0
- package/src/index.ts +6 -5
- package/src/rect.ts +28 -0
- package/src/transformations.ts +155 -0
- package/src/imageObject.ts +0 -15
- package/src/params.ts +0 -118
- package/src/reference.ts +0 -12
- package/src/stub.ts +0 -44
- package/src/url.ts +0 -76
package/dist/index.d.ts
CHANGED
|
@@ -1,79 +1,527 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare function isSanityImageAssetLike(x: any): x is SanityImageAssetLike;
|
|
1
|
+
import * as valibot from 'valibot';
|
|
2
|
+
import { InferOutput } from 'valibot';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
declare const transformationsSchema: Omit<valibot.ObjectSchema<{
|
|
5
|
+
readonly auto: valibot.LiteralSchema<"format", undefined>;
|
|
6
|
+
readonly background: valibot.StringSchema<undefined>;
|
|
7
|
+
readonly blur: valibot.NumberSchema<undefined>;
|
|
8
|
+
readonly crop: valibot.UnionSchema<[valibot.LiteralSchema<"top", undefined>, valibot.LiteralSchema<"bottom", undefined>, valibot.LiteralSchema<"left", undefined>, valibot.LiteralSchema<"right", undefined>, valibot.LiteralSchema<"center", undefined>, valibot.LiteralSchema<"focalpoint", undefined>, valibot.LiteralSchema<"entropy", undefined>], undefined>;
|
|
9
|
+
readonly download: valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.BooleanSchema<undefined>], undefined>;
|
|
10
|
+
readonly dpr: valibot.UnionSchema<[valibot.LiteralSchema<1, undefined>, valibot.LiteralSchema<2, undefined>, valibot.LiteralSchema<3, undefined>], undefined>;
|
|
11
|
+
readonly fit: valibot.UnionSchema<[valibot.LiteralSchema<"clip", undefined>, valibot.LiteralSchema<"crop", undefined>, valibot.LiteralSchema<"fill", undefined>, valibot.LiteralSchema<"fillmax", undefined>, valibot.LiteralSchema<"max", undefined>, valibot.LiteralSchema<"scale", undefined>, valibot.LiteralSchema<"min", undefined>], undefined>;
|
|
12
|
+
readonly flipHorizontal: valibot.BooleanSchema<undefined>;
|
|
13
|
+
readonly flipVertical: valibot.BooleanSchema<undefined>;
|
|
14
|
+
readonly focalPoint: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
15
|
+
readonly format: valibot.UnionSchema<[valibot.LiteralSchema<"jpg", undefined>, valibot.LiteralSchema<"pjpg", undefined>, valibot.LiteralSchema<"png", undefined>, valibot.LiteralSchema<"webp", undefined>], undefined>;
|
|
16
|
+
readonly frame: valibot.NumberSchema<undefined>;
|
|
17
|
+
readonly height: valibot.NumberSchema<undefined>;
|
|
18
|
+
readonly invert: valibot.BooleanSchema<undefined>;
|
|
19
|
+
readonly maxHeight: valibot.NumberSchema<undefined>;
|
|
20
|
+
readonly maxWidth: valibot.NumberSchema<undefined>;
|
|
21
|
+
readonly minHeight: valibot.NumberSchema<undefined>;
|
|
22
|
+
readonly minWidth: valibot.NumberSchema<undefined>;
|
|
23
|
+
readonly orientation: valibot.UnionSchema<[valibot.LiteralSchema<0, undefined>, valibot.LiteralSchema<90, undefined>, valibot.LiteralSchema<180, undefined>, valibot.LiteralSchema<270, undefined>], undefined>;
|
|
24
|
+
readonly pad: valibot.NumberSchema<undefined>;
|
|
25
|
+
readonly quality: valibot.NumberSchema<undefined>;
|
|
26
|
+
readonly rect: valibot.ObjectSchema<{
|
|
27
|
+
readonly pos: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
28
|
+
readonly size: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
readonly saturation: valibot.NumberSchema<undefined>;
|
|
31
|
+
readonly sharpen: valibot.NumberSchema<undefined>;
|
|
32
|
+
readonly width: valibot.NumberSchema<undefined>;
|
|
33
|
+
}, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
|
|
34
|
+
readonly entries: {
|
|
35
|
+
readonly auto: valibot.OptionalSchema<valibot.LiteralSchema<"format", undefined>, undefined>;
|
|
36
|
+
readonly background: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
37
|
+
readonly blur: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
38
|
+
readonly crop: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"top", undefined>, valibot.LiteralSchema<"bottom", undefined>, valibot.LiteralSchema<"left", undefined>, valibot.LiteralSchema<"right", undefined>, valibot.LiteralSchema<"center", undefined>, valibot.LiteralSchema<"focalpoint", undefined>, valibot.LiteralSchema<"entropy", undefined>], undefined>, undefined>;
|
|
39
|
+
readonly download: valibot.OptionalSchema<valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.BooleanSchema<undefined>], undefined>, undefined>;
|
|
40
|
+
readonly dpr: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<1, undefined>, valibot.LiteralSchema<2, undefined>, valibot.LiteralSchema<3, undefined>], undefined>, undefined>;
|
|
41
|
+
readonly fit: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"clip", undefined>, valibot.LiteralSchema<"crop", undefined>, valibot.LiteralSchema<"fill", undefined>, valibot.LiteralSchema<"fillmax", undefined>, valibot.LiteralSchema<"max", undefined>, valibot.LiteralSchema<"scale", undefined>, valibot.LiteralSchema<"min", undefined>], undefined>, undefined>;
|
|
42
|
+
readonly flipHorizontal: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
43
|
+
readonly flipVertical: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
44
|
+
readonly focalPoint: valibot.OptionalSchema<valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>, undefined>;
|
|
45
|
+
readonly format: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"jpg", undefined>, valibot.LiteralSchema<"pjpg", undefined>, valibot.LiteralSchema<"png", undefined>, valibot.LiteralSchema<"webp", undefined>], undefined>, undefined>;
|
|
46
|
+
readonly frame: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
47
|
+
readonly height: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
48
|
+
readonly invert: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
49
|
+
readonly maxHeight: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
50
|
+
readonly maxWidth: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
51
|
+
readonly minHeight: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
52
|
+
readonly minWidth: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
53
|
+
readonly orientation: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<0, undefined>, valibot.LiteralSchema<90, undefined>, valibot.LiteralSchema<180, undefined>, valibot.LiteralSchema<270, undefined>], undefined>, undefined>;
|
|
54
|
+
readonly pad: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
55
|
+
readonly quality: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
56
|
+
readonly rect: valibot.OptionalSchema<valibot.ObjectSchema<{
|
|
57
|
+
readonly pos: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
58
|
+
readonly size: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
59
|
+
}, undefined>, undefined>;
|
|
60
|
+
readonly saturation: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
61
|
+
readonly sharpen: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
62
|
+
readonly width: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
63
|
+
};
|
|
64
|
+
readonly '~standard': valibot.StandardProps<{
|
|
65
|
+
auto?: "format" | undefined;
|
|
66
|
+
background?: string | undefined;
|
|
67
|
+
blur?: number | undefined;
|
|
68
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
69
|
+
download?: string | boolean | undefined;
|
|
70
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
71
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
72
|
+
flipHorizontal?: boolean | undefined;
|
|
73
|
+
flipVertical?: boolean | undefined;
|
|
74
|
+
focalPoint?: [number, number] | undefined;
|
|
75
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
76
|
+
frame?: number | undefined;
|
|
77
|
+
height?: number | undefined;
|
|
78
|
+
invert?: boolean | undefined;
|
|
79
|
+
maxHeight?: number | undefined;
|
|
80
|
+
maxWidth?: number | undefined;
|
|
81
|
+
minHeight?: number | undefined;
|
|
82
|
+
minWidth?: number | undefined;
|
|
83
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
84
|
+
pad?: number | undefined;
|
|
85
|
+
quality?: number | undefined;
|
|
86
|
+
rect?: {
|
|
87
|
+
pos: [number, number];
|
|
88
|
+
size: [number, number];
|
|
89
|
+
} | undefined;
|
|
90
|
+
saturation?: number | undefined;
|
|
91
|
+
sharpen?: number | undefined;
|
|
92
|
+
width?: number | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
auto?: "format" | undefined;
|
|
95
|
+
background?: string | undefined;
|
|
96
|
+
blur?: number | undefined;
|
|
97
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
98
|
+
download?: string | boolean | undefined;
|
|
99
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
100
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
101
|
+
flipHorizontal?: boolean | undefined;
|
|
102
|
+
flipVertical?: boolean | undefined;
|
|
103
|
+
focalPoint?: [number, number] | undefined;
|
|
104
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
105
|
+
frame?: number | undefined;
|
|
106
|
+
height?: number | undefined;
|
|
107
|
+
invert?: boolean | undefined;
|
|
108
|
+
maxHeight?: number | undefined;
|
|
109
|
+
maxWidth?: number | undefined;
|
|
110
|
+
minHeight?: number | undefined;
|
|
111
|
+
minWidth?: number | undefined;
|
|
112
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
113
|
+
pad?: number | undefined;
|
|
114
|
+
quality?: number | undefined;
|
|
115
|
+
rect?: {
|
|
116
|
+
pos: [number, number];
|
|
117
|
+
size: [number, number];
|
|
118
|
+
} | undefined;
|
|
119
|
+
saturation?: number | undefined;
|
|
120
|
+
sharpen?: number | undefined;
|
|
121
|
+
width?: number | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
readonly '~run': (dataset: valibot.UnknownDataset, config: valibot.Config<valibot.BaseIssue<unknown>>) => valibot.OutputDataset<{
|
|
124
|
+
auto?: "format" | undefined;
|
|
125
|
+
background?: string | undefined;
|
|
126
|
+
blur?: number | undefined;
|
|
127
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
128
|
+
download?: string | boolean | undefined;
|
|
129
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
130
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
131
|
+
flipHorizontal?: boolean | undefined;
|
|
132
|
+
flipVertical?: boolean | undefined;
|
|
133
|
+
focalPoint?: [number, number] | undefined;
|
|
134
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
135
|
+
frame?: number | undefined;
|
|
136
|
+
height?: number | undefined;
|
|
137
|
+
invert?: boolean | undefined;
|
|
138
|
+
maxHeight?: number | undefined;
|
|
139
|
+
maxWidth?: number | undefined;
|
|
140
|
+
minHeight?: number | undefined;
|
|
141
|
+
minWidth?: number | undefined;
|
|
142
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
143
|
+
pad?: number | undefined;
|
|
144
|
+
quality?: number | undefined;
|
|
145
|
+
rect?: {
|
|
146
|
+
pos: [number, number];
|
|
147
|
+
size: [number, number];
|
|
148
|
+
} | undefined;
|
|
149
|
+
saturation?: number | undefined;
|
|
150
|
+
sharpen?: number | undefined;
|
|
151
|
+
width?: number | undefined;
|
|
152
|
+
}, valibot.NumberIssue | valibot.ObjectIssue | valibot.TupleIssue | valibot.StringIssue | valibot.LiteralIssue | valibot.UnionIssue<valibot.LiteralIssue> | valibot.BooleanIssue | valibot.UnionIssue<valibot.StringIssue | valibot.BooleanIssue>>;
|
|
153
|
+
readonly '~types'?: {
|
|
154
|
+
readonly input: {
|
|
155
|
+
auto?: "format" | undefined;
|
|
156
|
+
background?: string | undefined;
|
|
157
|
+
blur?: number | undefined;
|
|
158
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
159
|
+
download?: string | boolean | undefined;
|
|
160
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
161
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
162
|
+
flipHorizontal?: boolean | undefined;
|
|
163
|
+
flipVertical?: boolean | undefined;
|
|
164
|
+
focalPoint?: [number, number] | undefined;
|
|
165
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
166
|
+
frame?: number | undefined;
|
|
167
|
+
height?: number | undefined;
|
|
168
|
+
invert?: boolean | undefined;
|
|
169
|
+
maxHeight?: number | undefined;
|
|
170
|
+
maxWidth?: number | undefined;
|
|
171
|
+
minHeight?: number | undefined;
|
|
172
|
+
minWidth?: number | undefined;
|
|
173
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
174
|
+
pad?: number | undefined;
|
|
175
|
+
quality?: number | undefined;
|
|
176
|
+
rect?: {
|
|
177
|
+
pos: [number, number];
|
|
178
|
+
size: [number, number];
|
|
179
|
+
} | undefined;
|
|
180
|
+
saturation?: number | undefined;
|
|
181
|
+
sharpen?: number | undefined;
|
|
182
|
+
width?: number | undefined;
|
|
183
|
+
};
|
|
184
|
+
readonly output: {
|
|
185
|
+
auto?: "format" | undefined;
|
|
186
|
+
background?: string | undefined;
|
|
187
|
+
blur?: number | undefined;
|
|
188
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
189
|
+
download?: string | boolean | undefined;
|
|
190
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
191
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
192
|
+
flipHorizontal?: boolean | undefined;
|
|
193
|
+
flipVertical?: boolean | undefined;
|
|
194
|
+
focalPoint?: [number, number] | undefined;
|
|
195
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
196
|
+
frame?: number | undefined;
|
|
197
|
+
height?: number | undefined;
|
|
198
|
+
invert?: boolean | undefined;
|
|
199
|
+
maxHeight?: number | undefined;
|
|
200
|
+
maxWidth?: number | undefined;
|
|
201
|
+
minHeight?: number | undefined;
|
|
202
|
+
minWidth?: number | undefined;
|
|
203
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
204
|
+
pad?: number | undefined;
|
|
205
|
+
quality?: number | undefined;
|
|
206
|
+
rect?: {
|
|
207
|
+
pos: [number, number];
|
|
208
|
+
size: [number, number];
|
|
209
|
+
} | undefined;
|
|
210
|
+
saturation?: number | undefined;
|
|
211
|
+
sharpen?: number | undefined;
|
|
212
|
+
width?: number | undefined;
|
|
213
|
+
};
|
|
214
|
+
readonly issue: valibot.NumberIssue | valibot.ObjectIssue | valibot.TupleIssue | valibot.StringIssue | valibot.LiteralIssue | valibot.UnionIssue<valibot.LiteralIssue> | valibot.BooleanIssue | valibot.UnionIssue<valibot.StringIssue | valibot.BooleanIssue>;
|
|
215
|
+
} | undefined;
|
|
216
|
+
};
|
|
217
|
+
type Transformations = InferOutput<typeof transformationsSchema>;
|
|
218
|
+
declare function isTransformations(input: unknown): input is Transformations;
|
|
219
|
+
declare function transformationsToURLSearch({ auto, background, blur, crop, download, dpr, fit, flipHorizontal, flipVertical, focalPoint, format, frame, height, invert, maxHeight, maxWidth, minHeight, minWidth, orientation, pad, quality, rect, saturation, sharpen, width, }: Transformations): string;
|
|
10
220
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
221
|
+
type ImageSource = ImageObject | ImageAsset | AssetLike | ReferenceLike | string;
|
|
222
|
+
type AssetLike = InferOutput<typeof assetLikeSchema>;
|
|
223
|
+
type ReferenceLike = InferOutput<typeof referenceLikeSchema>;
|
|
224
|
+
type ImageObject = InferOutput<typeof imageObjectSchema>;
|
|
225
|
+
type ImageAsset = InferOutput<typeof imageAssetSchema>;
|
|
226
|
+
declare const assetLikeSchema: valibot.ObjectSchema<{
|
|
227
|
+
readonly _id: valibot.StringSchema<undefined>;
|
|
228
|
+
}, undefined>;
|
|
229
|
+
declare const referenceLikeSchema: valibot.ObjectSchema<{
|
|
230
|
+
readonly _ref: valibot.StringSchema<undefined>;
|
|
231
|
+
}, undefined>;
|
|
232
|
+
declare const imageObjectSchema: valibot.ObjectSchema<{
|
|
233
|
+
readonly asset: valibot.NullishSchema<valibot.UnionSchema<[valibot.ObjectSchema<{
|
|
234
|
+
readonly _id: valibot.StringSchema<undefined>;
|
|
235
|
+
}, undefined>, valibot.ObjectSchema<{
|
|
236
|
+
readonly _ref: valibot.StringSchema<undefined>;
|
|
237
|
+
}, undefined>, valibot.StringSchema<undefined>], undefined>, undefined>;
|
|
238
|
+
readonly crop: valibot.NullishSchema<valibot.ObjectSchema<{
|
|
239
|
+
readonly top: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
240
|
+
readonly bottom: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
241
|
+
readonly left: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
242
|
+
readonly right: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
243
|
+
}, undefined>, undefined>;
|
|
244
|
+
readonly hotspot: valibot.NullishSchema<valibot.ObjectSchema<{
|
|
245
|
+
readonly x: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
246
|
+
readonly y: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
247
|
+
readonly width: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
248
|
+
readonly height: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
249
|
+
}, undefined>, undefined>;
|
|
250
|
+
}, undefined>;
|
|
251
|
+
declare const imageAssetSchema: valibot.ObjectSchema<{
|
|
252
|
+
readonly _id: valibot.StringSchema<undefined>;
|
|
253
|
+
readonly assetId: valibot.StringSchema<undefined>;
|
|
254
|
+
readonly width: valibot.NumberSchema<undefined>;
|
|
255
|
+
readonly height: valibot.NumberSchema<undefined>;
|
|
256
|
+
readonly extension: valibot.StringSchema<undefined>;
|
|
257
|
+
readonly vanityName: valibot.NullishSchema<valibot.StringSchema<undefined>, undefined>;
|
|
258
|
+
readonly transformations: valibot.NullishSchema<Omit<valibot.ObjectSchema<{
|
|
259
|
+
readonly auto: valibot.LiteralSchema<"format", undefined>;
|
|
260
|
+
readonly background: valibot.StringSchema<undefined>;
|
|
261
|
+
readonly blur: valibot.NumberSchema<undefined>;
|
|
262
|
+
readonly crop: valibot.UnionSchema<[valibot.LiteralSchema<"top", undefined>, valibot.LiteralSchema<"bottom", undefined>, valibot.LiteralSchema<"left", undefined>, valibot.LiteralSchema<"right", undefined>, valibot.LiteralSchema<"center", undefined>, valibot.LiteralSchema<"focalpoint", undefined>, valibot.LiteralSchema<"entropy", undefined>], undefined>;
|
|
263
|
+
readonly download: valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.BooleanSchema<undefined>], undefined>;
|
|
264
|
+
readonly dpr: valibot.UnionSchema<[valibot.LiteralSchema<1, undefined>, valibot.LiteralSchema<2, undefined>, valibot.LiteralSchema<3, undefined>], undefined>;
|
|
265
|
+
readonly fit: valibot.UnionSchema<[valibot.LiteralSchema<"clip", undefined>, valibot.LiteralSchema<"crop", undefined>, valibot.LiteralSchema<"fill", undefined>, valibot.LiteralSchema<"fillmax", undefined>, valibot.LiteralSchema<"max", undefined>, valibot.LiteralSchema<"scale", undefined>, valibot.LiteralSchema<"min", undefined>], undefined>;
|
|
266
|
+
readonly flipHorizontal: valibot.BooleanSchema<undefined>;
|
|
267
|
+
readonly flipVertical: valibot.BooleanSchema<undefined>;
|
|
268
|
+
readonly focalPoint: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
269
|
+
readonly format: valibot.UnionSchema<[valibot.LiteralSchema<"jpg", undefined>, valibot.LiteralSchema<"pjpg", undefined>, valibot.LiteralSchema<"png", undefined>, valibot.LiteralSchema<"webp", undefined>], undefined>;
|
|
270
|
+
readonly frame: valibot.NumberSchema<undefined>;
|
|
271
|
+
readonly height: valibot.NumberSchema<undefined>;
|
|
272
|
+
readonly invert: valibot.BooleanSchema<undefined>;
|
|
273
|
+
readonly maxHeight: valibot.NumberSchema<undefined>;
|
|
274
|
+
readonly maxWidth: valibot.NumberSchema<undefined>;
|
|
275
|
+
readonly minHeight: valibot.NumberSchema<undefined>;
|
|
276
|
+
readonly minWidth: valibot.NumberSchema<undefined>;
|
|
277
|
+
readonly orientation: valibot.UnionSchema<[valibot.LiteralSchema<0, undefined>, valibot.LiteralSchema<90, undefined>, valibot.LiteralSchema<180, undefined>, valibot.LiteralSchema<270, undefined>], undefined>;
|
|
278
|
+
readonly pad: valibot.NumberSchema<undefined>;
|
|
279
|
+
readonly quality: valibot.NumberSchema<undefined>;
|
|
280
|
+
readonly rect: valibot.ObjectSchema<{
|
|
281
|
+
readonly pos: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
282
|
+
readonly size: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
283
|
+
}, undefined>;
|
|
284
|
+
readonly saturation: valibot.NumberSchema<undefined>;
|
|
285
|
+
readonly sharpen: valibot.NumberSchema<undefined>;
|
|
286
|
+
readonly width: valibot.NumberSchema<undefined>;
|
|
287
|
+
}, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
|
|
288
|
+
readonly entries: {
|
|
289
|
+
readonly auto: valibot.OptionalSchema<valibot.LiteralSchema<"format", undefined>, undefined>;
|
|
290
|
+
readonly background: valibot.OptionalSchema<valibot.StringSchema<undefined>, undefined>;
|
|
291
|
+
readonly blur: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
292
|
+
readonly crop: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"top", undefined>, valibot.LiteralSchema<"bottom", undefined>, valibot.LiteralSchema<"left", undefined>, valibot.LiteralSchema<"right", undefined>, valibot.LiteralSchema<"center", undefined>, valibot.LiteralSchema<"focalpoint", undefined>, valibot.LiteralSchema<"entropy", undefined>], undefined>, undefined>;
|
|
293
|
+
readonly download: valibot.OptionalSchema<valibot.UnionSchema<[valibot.StringSchema<undefined>, valibot.BooleanSchema<undefined>], undefined>, undefined>;
|
|
294
|
+
readonly dpr: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<1, undefined>, valibot.LiteralSchema<2, undefined>, valibot.LiteralSchema<3, undefined>], undefined>, undefined>;
|
|
295
|
+
readonly fit: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"clip", undefined>, valibot.LiteralSchema<"crop", undefined>, valibot.LiteralSchema<"fill", undefined>, valibot.LiteralSchema<"fillmax", undefined>, valibot.LiteralSchema<"max", undefined>, valibot.LiteralSchema<"scale", undefined>, valibot.LiteralSchema<"min", undefined>], undefined>, undefined>;
|
|
296
|
+
readonly flipHorizontal: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
297
|
+
readonly flipVertical: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
298
|
+
readonly focalPoint: valibot.OptionalSchema<valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>, undefined>;
|
|
299
|
+
readonly format: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<"jpg", undefined>, valibot.LiteralSchema<"pjpg", undefined>, valibot.LiteralSchema<"png", undefined>, valibot.LiteralSchema<"webp", undefined>], undefined>, undefined>;
|
|
300
|
+
readonly frame: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
301
|
+
readonly height: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
302
|
+
readonly invert: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, undefined>;
|
|
303
|
+
readonly maxHeight: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
304
|
+
readonly maxWidth: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
305
|
+
readonly minHeight: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
306
|
+
readonly minWidth: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
307
|
+
readonly orientation: valibot.OptionalSchema<valibot.UnionSchema<[valibot.LiteralSchema<0, undefined>, valibot.LiteralSchema<90, undefined>, valibot.LiteralSchema<180, undefined>, valibot.LiteralSchema<270, undefined>], undefined>, undefined>;
|
|
308
|
+
readonly pad: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
309
|
+
readonly quality: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
310
|
+
readonly rect: valibot.OptionalSchema<valibot.ObjectSchema<{
|
|
311
|
+
readonly pos: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
312
|
+
readonly size: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
313
|
+
}, undefined>, undefined>;
|
|
314
|
+
readonly saturation: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
315
|
+
readonly sharpen: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
316
|
+
readonly width: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
317
|
+
};
|
|
318
|
+
readonly '~standard': valibot.StandardProps<{
|
|
319
|
+
auto?: "format" | undefined;
|
|
320
|
+
background?: string | undefined;
|
|
321
|
+
blur?: number | undefined;
|
|
322
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
323
|
+
download?: string | boolean | undefined;
|
|
324
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
325
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
326
|
+
flipHorizontal?: boolean | undefined;
|
|
327
|
+
flipVertical?: boolean | undefined;
|
|
328
|
+
focalPoint?: [number, number] | undefined;
|
|
329
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
330
|
+
frame?: number | undefined;
|
|
331
|
+
height?: number | undefined;
|
|
332
|
+
invert?: boolean | undefined;
|
|
333
|
+
maxHeight?: number | undefined;
|
|
334
|
+
maxWidth?: number | undefined;
|
|
335
|
+
minHeight?: number | undefined;
|
|
336
|
+
minWidth?: number | undefined;
|
|
337
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
338
|
+
pad?: number | undefined;
|
|
339
|
+
quality?: number | undefined;
|
|
340
|
+
rect?: {
|
|
341
|
+
pos: [number, number];
|
|
342
|
+
size: [number, number];
|
|
343
|
+
} | undefined;
|
|
344
|
+
saturation?: number | undefined;
|
|
345
|
+
sharpen?: number | undefined;
|
|
346
|
+
width?: number | undefined;
|
|
347
|
+
}, {
|
|
348
|
+
auto?: "format" | undefined;
|
|
349
|
+
background?: string | undefined;
|
|
350
|
+
blur?: number | undefined;
|
|
351
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
352
|
+
download?: string | boolean | undefined;
|
|
353
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
354
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
355
|
+
flipHorizontal?: boolean | undefined;
|
|
356
|
+
flipVertical?: boolean | undefined;
|
|
357
|
+
focalPoint?: [number, number] | undefined;
|
|
358
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
359
|
+
frame?: number | undefined;
|
|
360
|
+
height?: number | undefined;
|
|
361
|
+
invert?: boolean | undefined;
|
|
362
|
+
maxHeight?: number | undefined;
|
|
363
|
+
maxWidth?: number | undefined;
|
|
364
|
+
minHeight?: number | undefined;
|
|
365
|
+
minWidth?: number | undefined;
|
|
366
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
367
|
+
pad?: number | undefined;
|
|
368
|
+
quality?: number | undefined;
|
|
369
|
+
rect?: {
|
|
370
|
+
pos: [number, number];
|
|
371
|
+
size: [number, number];
|
|
372
|
+
} | undefined;
|
|
373
|
+
saturation?: number | undefined;
|
|
374
|
+
sharpen?: number | undefined;
|
|
375
|
+
width?: number | undefined;
|
|
376
|
+
}>;
|
|
377
|
+
readonly '~run': (dataset: valibot.UnknownDataset, config: valibot.Config<valibot.BaseIssue<unknown>>) => valibot.OutputDataset<{
|
|
378
|
+
auto?: "format" | undefined;
|
|
379
|
+
background?: string | undefined;
|
|
380
|
+
blur?: number | undefined;
|
|
381
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
382
|
+
download?: string | boolean | undefined;
|
|
383
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
384
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
385
|
+
flipHorizontal?: boolean | undefined;
|
|
386
|
+
flipVertical?: boolean | undefined;
|
|
387
|
+
focalPoint?: [number, number] | undefined;
|
|
388
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
389
|
+
frame?: number | undefined;
|
|
390
|
+
height?: number | undefined;
|
|
391
|
+
invert?: boolean | undefined;
|
|
392
|
+
maxHeight?: number | undefined;
|
|
393
|
+
maxWidth?: number | undefined;
|
|
394
|
+
minHeight?: number | undefined;
|
|
395
|
+
minWidth?: number | undefined;
|
|
396
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
397
|
+
pad?: number | undefined;
|
|
398
|
+
quality?: number | undefined;
|
|
399
|
+
rect?: {
|
|
400
|
+
pos: [number, number];
|
|
401
|
+
size: [number, number];
|
|
402
|
+
} | undefined;
|
|
403
|
+
saturation?: number | undefined;
|
|
404
|
+
sharpen?: number | undefined;
|
|
405
|
+
width?: number | undefined;
|
|
406
|
+
}, valibot.NumberIssue | valibot.ObjectIssue | valibot.TupleIssue | valibot.StringIssue | valibot.LiteralIssue | valibot.UnionIssue<valibot.LiteralIssue> | valibot.BooleanIssue | valibot.UnionIssue<valibot.StringIssue | valibot.BooleanIssue>>;
|
|
407
|
+
readonly '~types'?: {
|
|
408
|
+
readonly input: {
|
|
409
|
+
auto?: "format" | undefined;
|
|
410
|
+
background?: string | undefined;
|
|
411
|
+
blur?: number | undefined;
|
|
412
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
413
|
+
download?: string | boolean | undefined;
|
|
414
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
415
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
416
|
+
flipHorizontal?: boolean | undefined;
|
|
417
|
+
flipVertical?: boolean | undefined;
|
|
418
|
+
focalPoint?: [number, number] | undefined;
|
|
419
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
420
|
+
frame?: number | undefined;
|
|
421
|
+
height?: number | undefined;
|
|
422
|
+
invert?: boolean | undefined;
|
|
423
|
+
maxHeight?: number | undefined;
|
|
424
|
+
maxWidth?: number | undefined;
|
|
425
|
+
minHeight?: number | undefined;
|
|
426
|
+
minWidth?: number | undefined;
|
|
427
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
428
|
+
pad?: number | undefined;
|
|
429
|
+
quality?: number | undefined;
|
|
430
|
+
rect?: {
|
|
431
|
+
pos: [number, number];
|
|
432
|
+
size: [number, number];
|
|
433
|
+
} | undefined;
|
|
434
|
+
saturation?: number | undefined;
|
|
435
|
+
sharpen?: number | undefined;
|
|
436
|
+
width?: number | undefined;
|
|
437
|
+
};
|
|
438
|
+
readonly output: {
|
|
439
|
+
auto?: "format" | undefined;
|
|
440
|
+
background?: string | undefined;
|
|
441
|
+
blur?: number | undefined;
|
|
442
|
+
crop?: "top" | "bottom" | "left" | "right" | "center" | "focalpoint" | "entropy" | undefined;
|
|
443
|
+
download?: string | boolean | undefined;
|
|
444
|
+
dpr?: 1 | 2 | 3 | undefined;
|
|
445
|
+
fit?: "fill" | "crop" | "clip" | "fillmax" | "max" | "scale" | "min" | undefined;
|
|
446
|
+
flipHorizontal?: boolean | undefined;
|
|
447
|
+
flipVertical?: boolean | undefined;
|
|
448
|
+
focalPoint?: [number, number] | undefined;
|
|
449
|
+
format?: "jpg" | "pjpg" | "png" | "webp" | undefined;
|
|
450
|
+
frame?: number | undefined;
|
|
451
|
+
height?: number | undefined;
|
|
452
|
+
invert?: boolean | undefined;
|
|
453
|
+
maxHeight?: number | undefined;
|
|
454
|
+
maxWidth?: number | undefined;
|
|
455
|
+
minHeight?: number | undefined;
|
|
456
|
+
minWidth?: number | undefined;
|
|
457
|
+
orientation?: 0 | 90 | 180 | 270 | undefined;
|
|
458
|
+
pad?: number | undefined;
|
|
459
|
+
quality?: number | undefined;
|
|
460
|
+
rect?: {
|
|
461
|
+
pos: [number, number];
|
|
462
|
+
size: [number, number];
|
|
463
|
+
} | undefined;
|
|
464
|
+
saturation?: number | undefined;
|
|
465
|
+
sharpen?: number | undefined;
|
|
466
|
+
width?: number | undefined;
|
|
467
|
+
};
|
|
468
|
+
readonly issue: valibot.NumberIssue | valibot.ObjectIssue | valibot.TupleIssue | valibot.StringIssue | valibot.LiteralIssue | valibot.UnionIssue<valibot.LiteralIssue> | valibot.BooleanIssue | valibot.UnionIssue<valibot.StringIssue | valibot.BooleanIssue>;
|
|
469
|
+
} | undefined;
|
|
470
|
+
}, undefined>;
|
|
471
|
+
}, undefined>;
|
|
472
|
+
declare function isAssetLike(input: unknown): input is AssetLike;
|
|
473
|
+
declare function isReferenceLike(input: unknown): input is ReferenceLike;
|
|
474
|
+
declare function isImageObject(input: unknown): input is ImageObject;
|
|
475
|
+
declare function isImageAsset(input: unknown): input is ImageAsset;
|
|
476
|
+
declare function assetIdFromSource(source: ImageSource): string | undefined;
|
|
477
|
+
declare function parseAssetId(id: string): ImageAsset | undefined;
|
|
478
|
+
declare function imageAssetFromSource(source: ImageSource): ImageAsset | undefined;
|
|
479
|
+
declare function imageAssetWithTransformations(asset: ImageAsset, transformations: Transformations): ImageAsset;
|
|
15
480
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type AutoMode = "format";
|
|
20
|
-
type Orientation = 0 | 90 | 180 | 270;
|
|
21
|
-
type Dpr = 1 | 2 | 3;
|
|
22
|
-
type SanityImageParams = {
|
|
23
|
-
auto?: AutoMode;
|
|
24
|
-
background?: string;
|
|
25
|
-
blur?: number;
|
|
26
|
-
crop?: CropMode;
|
|
27
|
-
download?: boolean | string;
|
|
28
|
-
dpr?: Dpr;
|
|
29
|
-
fit?: FitMode;
|
|
30
|
-
flipHorizontal?: boolean;
|
|
31
|
-
flipVertical?: boolean;
|
|
32
|
-
focalPoint?: {
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
};
|
|
36
|
-
format?: ImageFormat;
|
|
37
|
-
frame?: number;
|
|
38
|
-
height?: number;
|
|
39
|
-
invert?: boolean;
|
|
40
|
-
maxHeight?: number;
|
|
41
|
-
maxWidth?: number;
|
|
42
|
-
minHeight?: number;
|
|
43
|
-
minWidth?: number;
|
|
44
|
-
orientation?: Orientation;
|
|
45
|
-
pad?: number;
|
|
46
|
-
quality?: number;
|
|
47
|
-
rect?: {
|
|
48
|
-
left: number;
|
|
49
|
-
top: number;
|
|
50
|
-
width: number;
|
|
51
|
-
height: number;
|
|
52
|
-
};
|
|
53
|
-
saturation?: number;
|
|
54
|
-
sharpen?: number;
|
|
55
|
-
width?: number;
|
|
481
|
+
declare const srcsetWidths: {
|
|
482
|
+
default: number[];
|
|
483
|
+
expanded: number[];
|
|
56
484
|
};
|
|
57
|
-
declare function sanityImageParamsToSearchParamEntries({ auto, background, blur, crop, download, dpr, fit, flipHorizontal, flipVertical, focalPoint, format, frame, height, invert, maxHeight, maxWidth, minHeight, minWidth, orientation, pad, quality, rect, saturation, sharpen, width, }: SanityImageParams): string[][];
|
|
58
485
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
declare
|
|
69
|
-
|
|
486
|
+
declare const cropSchema: valibot.ObjectSchema<{
|
|
487
|
+
readonly top: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
488
|
+
readonly bottom: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
489
|
+
readonly left: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
490
|
+
readonly right: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
491
|
+
}, undefined>;
|
|
492
|
+
type Crop = InferOutput<typeof cropSchema>;
|
|
493
|
+
declare function isCrop(input: unknown): input is Crop;
|
|
494
|
+
|
|
495
|
+
declare const hotspotSchema: valibot.ObjectSchema<{
|
|
496
|
+
readonly x: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
497
|
+
readonly y: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
498
|
+
readonly width: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
499
|
+
readonly height: valibot.OptionalSchema<valibot.NumberSchema<undefined>, undefined>;
|
|
500
|
+
}, undefined>;
|
|
501
|
+
type Hotspot = InferOutput<typeof hotspotSchema>;
|
|
502
|
+
declare function isHotspot(input: unknown): input is Hotspot;
|
|
70
503
|
|
|
71
|
-
declare const defaultSrcsetWidths: number[];
|
|
72
504
|
interface SanityClientLike {
|
|
73
505
|
projectId: string;
|
|
74
506
|
dataset: string;
|
|
75
507
|
}
|
|
76
|
-
declare function
|
|
77
|
-
declare function
|
|
508
|
+
declare function imageUrl(client: SanityClientLike, asset: ImageAsset): string;
|
|
509
|
+
declare function imageSrcset(client: SanityClientLike, asset: ImageAsset, widths?: number[]): string | undefined;
|
|
510
|
+
/**
|
|
511
|
+
* Calculates the aspect ratio of an image, taking its transformations into account.
|
|
512
|
+
* @param asset - The asset to calculate the aspect ratio of
|
|
513
|
+
* @returns The aspect ratio of the image
|
|
514
|
+
* @todo This function currently ignores the `crop` mode settings including focal point
|
|
515
|
+
* and min/max height/width.
|
|
516
|
+
*/
|
|
517
|
+
declare function imageAspectRatio(asset: ImageAsset): number;
|
|
518
|
+
|
|
519
|
+
declare const rectSchema: valibot.ObjectSchema<{
|
|
520
|
+
readonly pos: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
521
|
+
readonly size: valibot.TupleSchema<[valibot.NumberSchema<undefined>, valibot.NumberSchema<undefined>], undefined>;
|
|
522
|
+
}, undefined>;
|
|
523
|
+
type Rect = InferOutput<typeof rectSchema>;
|
|
524
|
+
declare function isRect(input: unknown): input is Rect;
|
|
525
|
+
declare function rectFromCrop(asset: Pick<ImageAsset, "width" | "height">, crop: Crop): Rect;
|
|
78
526
|
|
|
79
|
-
export { type
|
|
527
|
+
export { type AssetLike, type Crop, type Hotspot, type ImageAsset, type ImageObject, type ImageSource, type Rect, type ReferenceLike, type SanityClientLike, type Transformations, assetIdFromSource, assetLikeSchema, cropSchema, hotspotSchema, imageAspectRatio, imageAssetFromSource, imageAssetSchema, imageAssetWithTransformations, imageObjectSchema, imageSrcset, imageUrl, isAssetLike, isCrop, isHotspot, isImageAsset, isImageObject, isRect, isReferenceLike, isTransformations, parseAssetId, rectFromCrop, rectSchema, referenceLikeSchema, srcsetWidths, transformationsSchema, transformationsToURLSearch };
|