@sanity/media-library-types 1.2.0 → 1.3.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/lib/index.d.cts +1481 -1203
- package/lib/index.d.ts +1481 -1203
- package/package.json +16 -16
- package/src/assets.ts +1 -0
- package/src/schema.types.ts +154 -41
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/media-library-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Type definitions for common Sanity Media Library data structures",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"media",
|
|
8
|
-
"library",
|
|
6
|
+
"content",
|
|
9
7
|
"headless",
|
|
8
|
+
"library",
|
|
9
|
+
"media",
|
|
10
10
|
"realtime",
|
|
11
|
-
"
|
|
11
|
+
"sanity",
|
|
12
12
|
"types",
|
|
13
13
|
"typescript"
|
|
14
14
|
],
|
|
@@ -18,8 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Sanity.io <hello@sanity.io>",
|
|
21
|
-
"
|
|
21
|
+
"files": [
|
|
22
|
+
"lib",
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
22
25
|
"type": "module",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"main": "./lib/index.cjs",
|
|
28
|
+
"module": "./lib/index.js",
|
|
29
|
+
"types": "./lib/index.d.ts",
|
|
23
30
|
"exports": {
|
|
24
31
|
".": {
|
|
25
32
|
"source": "./src/index.ts",
|
|
@@ -29,17 +36,10 @@
|
|
|
29
36
|
},
|
|
30
37
|
"./package.json": "./package.json"
|
|
31
38
|
},
|
|
32
|
-
"main": "./lib/index.cjs",
|
|
33
|
-
"module": "./lib/index.js",
|
|
34
|
-
"types": "./lib/index.d.ts",
|
|
35
|
-
"files": [
|
|
36
|
-
"lib",
|
|
37
|
-
"src"
|
|
38
|
-
],
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@sanity/pkg-utils": "
|
|
41
|
-
"@sanity/types": "
|
|
42
|
-
"rimraf": "
|
|
40
|
+
"@sanity/pkg-utils": "10.4.10",
|
|
41
|
+
"@sanity/types": "5.18.0",
|
|
42
|
+
"rimraf": "5.0.10"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "cp ../../../apps/huey/src/lib/schema.types.ts ./src/ && pkg-utils build --strict --check --clean",
|
package/src/assets.ts
CHANGED
|
@@ -25,6 +25,7 @@ export type AssetInstanceDocument = SanityImageAsset | SanityVideoAsset | Sanity
|
|
|
25
25
|
|
|
26
26
|
export interface Asset<AssetInstance extends AssetInstanceDocument = AssetInstanceDocument> {
|
|
27
27
|
_id: string
|
|
28
|
+
_originalId?: string
|
|
28
29
|
_type: SanityAsset['_type']
|
|
29
30
|
title: string
|
|
30
31
|
assetType: AssetInstance['_type']
|
package/src/schema.types.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export declare const internalGroqTypeReferenceTo: unique symbol
|
|
2
|
-
|
|
3
1
|
export type SanitySystem = {
|
|
4
2
|
_type: 'sanity.system'
|
|
5
3
|
createdBy?: string
|
|
6
4
|
}
|
|
7
5
|
|
|
6
|
+
export type SanityAssetReference = {
|
|
7
|
+
_ref: string
|
|
8
|
+
_type: 'reference'
|
|
9
|
+
_weak?: boolean
|
|
10
|
+
[internalGroqTypeReferenceTo]?: 'sanity.asset'
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
export type SanityAssetUploadSession = {
|
|
9
14
|
_id: string
|
|
10
15
|
_type: 'sanity.asset.upload-session'
|
|
@@ -12,16 +17,39 @@ export type SanityAssetUploadSession = {
|
|
|
12
17
|
_updatedAt: string
|
|
13
18
|
_rev: string
|
|
14
19
|
title: string
|
|
15
|
-
assets?: Array<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[internalGroqTypeReferenceTo]?: 'sanity.asset'
|
|
21
|
-
}>
|
|
20
|
+
assets?: Array<
|
|
21
|
+
{
|
|
22
|
+
_key: string
|
|
23
|
+
} & SanityAssetReference
|
|
24
|
+
>
|
|
22
25
|
_system?: SanitySystem
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
export type SanityDirectoryReference = {
|
|
29
|
+
_ref: string
|
|
30
|
+
_type: 'reference'
|
|
31
|
+
_weak?: boolean
|
|
32
|
+
[internalGroqTypeReferenceTo]?: 'sanity.directory'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type SanitySymlink = {
|
|
36
|
+
_id: string
|
|
37
|
+
_type: 'sanity.symlink'
|
|
38
|
+
_createdAt: string
|
|
39
|
+
_updatedAt: string
|
|
40
|
+
_rev: string
|
|
41
|
+
parent?: SanityDirectoryReference
|
|
42
|
+
rootDirectory?: SanityDirectoryReference
|
|
43
|
+
target?: SanityAssetReference
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type SanityTreeReference = {
|
|
47
|
+
_ref: string
|
|
48
|
+
_type: 'reference'
|
|
49
|
+
_weak?: boolean
|
|
50
|
+
[internalGroqTypeReferenceTo]?: 'sanity.tree'
|
|
51
|
+
}
|
|
52
|
+
|
|
25
53
|
export type SanityAssetCollection = {
|
|
26
54
|
_id: string
|
|
27
55
|
_type: 'sanity.asset.collection'
|
|
@@ -30,13 +58,13 @@ export type SanityAssetCollection = {
|
|
|
30
58
|
_rev: string
|
|
31
59
|
title: string
|
|
32
60
|
description?: string
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
parent?: SanityDirectoryReference | SanityTreeReference
|
|
62
|
+
rootDirectory?: SanityDirectoryReference
|
|
63
|
+
assets?: Array<
|
|
64
|
+
{
|
|
65
|
+
_key: string
|
|
66
|
+
} & SanityAssetReference
|
|
67
|
+
>
|
|
40
68
|
}
|
|
41
69
|
|
|
42
70
|
export type SanityVideoMetadataRendition = {
|
|
@@ -52,6 +80,13 @@ export type SanityVideoMetadataPlayback = {
|
|
|
52
80
|
policy: string
|
|
53
81
|
}
|
|
54
82
|
|
|
83
|
+
export type SanityAssetSubtitleReference = {
|
|
84
|
+
_ref: string
|
|
85
|
+
_type: 'reference'
|
|
86
|
+
_weak?: boolean
|
|
87
|
+
[internalGroqTypeReferenceTo]?: 'sanity.asset.subtitle'
|
|
88
|
+
}
|
|
89
|
+
|
|
55
90
|
export type SanityVideoMetadata = {
|
|
56
91
|
_type: 'sanity.videoMetadata'
|
|
57
92
|
aspectRatio?: string
|
|
@@ -67,6 +102,11 @@ export type SanityVideoMetadata = {
|
|
|
67
102
|
_key: string
|
|
68
103
|
} & SanityVideoMetadataRendition
|
|
69
104
|
>
|
|
105
|
+
subtitles?: Array<
|
|
106
|
+
{
|
|
107
|
+
_key: string
|
|
108
|
+
} & SanityAssetSubtitleReference
|
|
109
|
+
>
|
|
70
110
|
}
|
|
71
111
|
|
|
72
112
|
export type SanityImageExifTags = {
|
|
@@ -146,6 +186,13 @@ export type SanityImageMetadata = {
|
|
|
146
186
|
isOpaque: boolean
|
|
147
187
|
}
|
|
148
188
|
|
|
189
|
+
export type SanityAssetVersionReference = {
|
|
190
|
+
_ref: string
|
|
191
|
+
_type: 'reference'
|
|
192
|
+
_weak?: boolean
|
|
193
|
+
[internalGroqTypeReferenceTo]?: 'sanity.asset.version'
|
|
194
|
+
}
|
|
195
|
+
|
|
149
196
|
export type SanityAsset = {
|
|
150
197
|
_id: string
|
|
151
198
|
_type: 'sanity.asset'
|
|
@@ -154,12 +201,7 @@ export type SanityAsset = {
|
|
|
154
201
|
_rev: string
|
|
155
202
|
title?: string
|
|
156
203
|
aspects?: Record<string, unknown>
|
|
157
|
-
currentVersion:
|
|
158
|
-
_ref: string
|
|
159
|
-
_type: 'reference'
|
|
160
|
-
_weak?: boolean
|
|
161
|
-
[internalGroqTypeReferenceTo]?: 'sanity.asset.version'
|
|
162
|
-
}
|
|
204
|
+
currentVersion: SanityAssetVersionReference
|
|
163
205
|
versions: Array<
|
|
164
206
|
{
|
|
165
207
|
_key: string
|
|
@@ -167,31 +209,37 @@ export type SanityAsset = {
|
|
|
167
209
|
>
|
|
168
210
|
assetType: 'sanity.imageAsset' | 'sanity.videoAsset' | 'sanity.fileAsset'
|
|
169
211
|
cdnAccessPolicy: 'public' | 'private'
|
|
212
|
+
parent?: SanityDirectoryReference | SanityTreeReference
|
|
213
|
+
rootDirectory?: SanityDirectoryReference
|
|
170
214
|
url?: string
|
|
215
|
+
_system?: SanitySystem
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export type SanityImageAssetReference = {
|
|
219
|
+
_ref: string
|
|
220
|
+
_type: 'reference'
|
|
221
|
+
_weak?: boolean
|
|
222
|
+
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type SanityFileAssetReference = {
|
|
226
|
+
_ref: string
|
|
227
|
+
_type: 'reference'
|
|
228
|
+
_weak?: boolean
|
|
229
|
+
[internalGroqTypeReferenceTo]?: 'sanity.fileAsset'
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type SanityVideoAssetReference = {
|
|
233
|
+
_ref: string
|
|
234
|
+
_type: 'reference'
|
|
235
|
+
_weak?: boolean
|
|
236
|
+
[internalGroqTypeReferenceTo]?: 'sanity.videoAsset'
|
|
171
237
|
}
|
|
172
238
|
|
|
173
239
|
export type SanityAssetVersion = {
|
|
174
240
|
_type: 'sanity.asset.version'
|
|
175
241
|
title?: string
|
|
176
|
-
instance:
|
|
177
|
-
| {
|
|
178
|
-
_ref: string
|
|
179
|
-
_type: 'reference'
|
|
180
|
-
_weak?: boolean
|
|
181
|
-
[internalGroqTypeReferenceTo]?: 'sanity.imageAsset'
|
|
182
|
-
}
|
|
183
|
-
| {
|
|
184
|
-
_ref: string
|
|
185
|
-
_type: 'reference'
|
|
186
|
-
_weak?: boolean
|
|
187
|
-
[internalGroqTypeReferenceTo]?: 'sanity.fileAsset'
|
|
188
|
-
}
|
|
189
|
-
| {
|
|
190
|
-
_ref: string
|
|
191
|
-
_type: 'reference'
|
|
192
|
-
_weak?: boolean
|
|
193
|
-
[internalGroqTypeReferenceTo]?: 'sanity.videoAsset'
|
|
194
|
-
}
|
|
242
|
+
instance: SanityImageAssetReference | SanityFileAssetReference | SanityVideoAssetReference
|
|
195
243
|
}
|
|
196
244
|
|
|
197
245
|
export type SanityVideoAsset = {
|
|
@@ -234,6 +282,8 @@ export type SanityVideoAsset = {
|
|
|
234
282
|
url?: string
|
|
235
283
|
}
|
|
236
284
|
metadata: SanityVideoMetadata
|
|
285
|
+
rootDirectory?: SanityDirectoryReference
|
|
286
|
+
_system?: SanitySystem
|
|
237
287
|
}
|
|
238
288
|
|
|
239
289
|
export type SanityAssetInstanceState = string
|
|
@@ -273,6 +323,8 @@ export type SanityFileAsset = {
|
|
|
273
323
|
extension?: string
|
|
274
324
|
url: string
|
|
275
325
|
previewUrl?: string
|
|
326
|
+
rootDirectory?: SanityDirectoryReference
|
|
327
|
+
_system?: SanitySystem
|
|
276
328
|
}
|
|
277
329
|
|
|
278
330
|
export type SanityImageAsset = {
|
|
@@ -292,6 +344,8 @@ export type SanityImageAsset = {
|
|
|
292
344
|
extension?: string
|
|
293
345
|
url: string
|
|
294
346
|
metadata: SanityImageMetadata
|
|
347
|
+
rootDirectory?: SanityDirectoryReference
|
|
348
|
+
_system?: SanitySystem
|
|
295
349
|
}
|
|
296
350
|
|
|
297
351
|
export type Geopoint = {
|
|
@@ -301,12 +355,62 @@ export type Geopoint = {
|
|
|
301
355
|
alt?: number
|
|
302
356
|
}
|
|
303
357
|
|
|
358
|
+
export type SanityAssetSubtitle = {
|
|
359
|
+
_id: string
|
|
360
|
+
_type: 'sanity.asset.subtitle'
|
|
361
|
+
_createdAt: string
|
|
362
|
+
_updatedAt: string
|
|
363
|
+
_rev: string
|
|
364
|
+
languageCode?: string
|
|
365
|
+
closedCaptions?: boolean
|
|
366
|
+
status?: string
|
|
367
|
+
origin?: string
|
|
368
|
+
source?: {
|
|
369
|
+
id?: string
|
|
370
|
+
name?: string
|
|
371
|
+
url?: string
|
|
372
|
+
}
|
|
373
|
+
segments?: Array<{
|
|
374
|
+
startTime?: number
|
|
375
|
+
endTime?: number
|
|
376
|
+
text?: string
|
|
377
|
+
_key: string
|
|
378
|
+
}>
|
|
379
|
+
error?: string
|
|
380
|
+
rootDirectory?: SanityDirectoryReference
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export type SanityDirectory = {
|
|
384
|
+
_id: string
|
|
385
|
+
_type: 'sanity.directory'
|
|
386
|
+
_createdAt: string
|
|
387
|
+
_updatedAt: string
|
|
388
|
+
_rev: string
|
|
389
|
+
name?: string
|
|
390
|
+
parent?: SanityDirectoryReference | SanityTreeReference
|
|
391
|
+
rootDirectory?: SanityDirectoryReference
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export type SanityTree = {
|
|
395
|
+
_id: string
|
|
396
|
+
_type: 'sanity.tree'
|
|
397
|
+
_createdAt: string
|
|
398
|
+
_updatedAt: string
|
|
399
|
+
_rev: string
|
|
400
|
+
name?: string
|
|
401
|
+
}
|
|
402
|
+
|
|
304
403
|
export type AllSanitySchemaTypes =
|
|
305
404
|
| SanitySystem
|
|
405
|
+
| SanityAssetReference
|
|
306
406
|
| SanityAssetUploadSession
|
|
407
|
+
| SanityDirectoryReference
|
|
408
|
+
| SanitySymlink
|
|
409
|
+
| SanityTreeReference
|
|
307
410
|
| SanityAssetCollection
|
|
308
411
|
| SanityVideoMetadataRendition
|
|
309
412
|
| SanityVideoMetadataPlayback
|
|
413
|
+
| SanityAssetSubtitleReference
|
|
310
414
|
| SanityVideoMetadata
|
|
311
415
|
| SanityImageExifTags
|
|
312
416
|
| SanityImageExifMetadata
|
|
@@ -314,10 +418,19 @@ export type AllSanitySchemaTypes =
|
|
|
314
418
|
| SanityImagePalette
|
|
315
419
|
| SanityImageDimensions
|
|
316
420
|
| SanityImageMetadata
|
|
421
|
+
| SanityAssetVersionReference
|
|
317
422
|
| SanityAsset
|
|
423
|
+
| SanityImageAssetReference
|
|
424
|
+
| SanityFileAssetReference
|
|
425
|
+
| SanityVideoAssetReference
|
|
318
426
|
| SanityAssetVersion
|
|
319
427
|
| SanityVideoAsset
|
|
320
428
|
| SanityAssetInstanceState
|
|
321
429
|
| SanityFileAsset
|
|
322
430
|
| SanityImageAsset
|
|
323
431
|
| Geopoint
|
|
432
|
+
| SanityAssetSubtitle
|
|
433
|
+
| SanityDirectory
|
|
434
|
+
| SanityTree
|
|
435
|
+
|
|
436
|
+
export declare const internalGroqTypeReferenceTo: unique symbol
|