@sanity/media-library-types 1.3.0 → 1.4.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 +27 -3
- package/lib/index.d.ts +27 -3
- package/package.json +3 -3
- package/src/plugin.ts +7 -0
- package/src/schema.types.ts +5 -0
package/lib/index.d.cts
CHANGED
|
@@ -57,7 +57,7 @@ declare type ArrayOfType<
|
|
|
57
57
|
TAlias extends IntrinsicTypeName | undefined = undefined,
|
|
58
58
|
> =
|
|
59
59
|
| IntrinsicArrayOfDefinition[TType]
|
|
60
|
-
| ArrayOfEntry<TypeAliasDefinition<
|
|
60
|
+
| ArrayOfEntry<TypeAliasDefinition<AutocompleteString, TAlias>>;
|
|
61
61
|
|
|
62
62
|
/** @public */
|
|
63
63
|
declare interface ArrayOptions<V = unknown>
|
|
@@ -415,6 +415,20 @@ export declare interface AssetVersion<
|
|
|
415
415
|
instance: AssetInstance;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Enhances VSCode autocomplete by using a distinct type for strings.
|
|
420
|
+
*
|
|
421
|
+
* `AllowOtherStrings` is defined as `string & {}`, an intersection that behaves
|
|
422
|
+
* like `string` but is treated differently by TypeScript's type system for
|
|
423
|
+
* internal processing. This helps in improving the specificity and relevance of
|
|
424
|
+
* autocomplete suggestions by potentially prioritizing `IntrinsicTypeName`
|
|
425
|
+
* over general string inputs, addressing issues where `string` type suggestions
|
|
426
|
+
* might overshadow more useful specific literals.
|
|
427
|
+
*
|
|
428
|
+
* @beta
|
|
429
|
+
*/
|
|
430
|
+
declare type AutocompleteString = string & {};
|
|
431
|
+
|
|
418
432
|
export declare type BaseDocument = {
|
|
419
433
|
_id: string;
|
|
420
434
|
_type: string;
|
|
@@ -967,7 +981,10 @@ declare interface EnumListProps<V = unknown> {
|
|
|
967
981
|
declare type FieldDefinition<
|
|
968
982
|
TType extends IntrinsicTypeName = IntrinsicTypeName,
|
|
969
983
|
TAlias extends IntrinsicTypeName | undefined = undefined,
|
|
970
|
-
> = (
|
|
984
|
+
> = (
|
|
985
|
+
| InlineFieldDefinition[TType]
|
|
986
|
+
| TypeAliasDefinition<AutocompleteString, TAlias>
|
|
987
|
+
) &
|
|
971
988
|
FieldDefinitionBase;
|
|
972
989
|
|
|
973
990
|
/** @public */
|
|
@@ -1662,6 +1679,13 @@ export declare type PluginPayload = {
|
|
|
1662
1679
|
scheme: "light" | "dark";
|
|
1663
1680
|
selectAssetTypes: PluginSelectAssetType[];
|
|
1664
1681
|
selectionType: "single" | "multiple";
|
|
1682
|
+
/**
|
|
1683
|
+
* Opaque string the host generates to **partition persisted picker UI state** (e.g. folder path,
|
|
1684
|
+
* search query, filters) in the Media Library iframe. Huey derives `localStorage` key suffixes
|
|
1685
|
+
* from this value; embedders often derive it from project + dataset + workspace (or any stable
|
|
1686
|
+
* context).
|
|
1687
|
+
*/
|
|
1688
|
+
pickerPersistenceKey?: string;
|
|
1665
1689
|
};
|
|
1666
1690
|
|
|
1667
1691
|
export declare type PluginPostMessage =
|
|
@@ -2635,7 +2659,7 @@ declare type SchemaTypeDefinition<
|
|
|
2635
2659
|
TType extends IntrinsicTypeName = IntrinsicTypeName,
|
|
2636
2660
|
> =
|
|
2637
2661
|
| IntrinsicDefinitions[IntrinsicTypeName]
|
|
2638
|
-
| TypeAliasDefinition<
|
|
2662
|
+
| TypeAliasDefinition<AutocompleteString, TType>;
|
|
2639
2663
|
|
|
2640
2664
|
/** @public */
|
|
2641
2665
|
declare interface SchemaValidationError {
|
package/lib/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ declare type ArrayOfType<
|
|
|
57
57
|
TAlias extends IntrinsicTypeName | undefined = undefined,
|
|
58
58
|
> =
|
|
59
59
|
| IntrinsicArrayOfDefinition[TType]
|
|
60
|
-
| ArrayOfEntry<TypeAliasDefinition<
|
|
60
|
+
| ArrayOfEntry<TypeAliasDefinition<AutocompleteString, TAlias>>;
|
|
61
61
|
|
|
62
62
|
/** @public */
|
|
63
63
|
declare interface ArrayOptions<V = unknown>
|
|
@@ -415,6 +415,20 @@ export declare interface AssetVersion<
|
|
|
415
415
|
instance: AssetInstance;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Enhances VSCode autocomplete by using a distinct type for strings.
|
|
420
|
+
*
|
|
421
|
+
* `AllowOtherStrings` is defined as `string & {}`, an intersection that behaves
|
|
422
|
+
* like `string` but is treated differently by TypeScript's type system for
|
|
423
|
+
* internal processing. This helps in improving the specificity and relevance of
|
|
424
|
+
* autocomplete suggestions by potentially prioritizing `IntrinsicTypeName`
|
|
425
|
+
* over general string inputs, addressing issues where `string` type suggestions
|
|
426
|
+
* might overshadow more useful specific literals.
|
|
427
|
+
*
|
|
428
|
+
* @beta
|
|
429
|
+
*/
|
|
430
|
+
declare type AutocompleteString = string & {};
|
|
431
|
+
|
|
418
432
|
export declare type BaseDocument = {
|
|
419
433
|
_id: string;
|
|
420
434
|
_type: string;
|
|
@@ -967,7 +981,10 @@ declare interface EnumListProps<V = unknown> {
|
|
|
967
981
|
declare type FieldDefinition<
|
|
968
982
|
TType extends IntrinsicTypeName = IntrinsicTypeName,
|
|
969
983
|
TAlias extends IntrinsicTypeName | undefined = undefined,
|
|
970
|
-
> = (
|
|
984
|
+
> = (
|
|
985
|
+
| InlineFieldDefinition[TType]
|
|
986
|
+
| TypeAliasDefinition<AutocompleteString, TAlias>
|
|
987
|
+
) &
|
|
971
988
|
FieldDefinitionBase;
|
|
972
989
|
|
|
973
990
|
/** @public */
|
|
@@ -1662,6 +1679,13 @@ export declare type PluginPayload = {
|
|
|
1662
1679
|
scheme: "light" | "dark";
|
|
1663
1680
|
selectAssetTypes: PluginSelectAssetType[];
|
|
1664
1681
|
selectionType: "single" | "multiple";
|
|
1682
|
+
/**
|
|
1683
|
+
* Opaque string the host generates to **partition persisted picker UI state** (e.g. folder path,
|
|
1684
|
+
* search query, filters) in the Media Library iframe. Huey derives `localStorage` key suffixes
|
|
1685
|
+
* from this value; embedders often derive it from project + dataset + workspace (or any stable
|
|
1686
|
+
* context).
|
|
1687
|
+
*/
|
|
1688
|
+
pickerPersistenceKey?: string;
|
|
1665
1689
|
};
|
|
1666
1690
|
|
|
1667
1691
|
export declare type PluginPostMessage =
|
|
@@ -2635,7 +2659,7 @@ declare type SchemaTypeDefinition<
|
|
|
2635
2659
|
TType extends IntrinsicTypeName = IntrinsicTypeName,
|
|
2636
2660
|
> =
|
|
2637
2661
|
| IntrinsicDefinitions[IntrinsicTypeName]
|
|
2638
|
-
| TypeAliasDefinition<
|
|
2662
|
+
| TypeAliasDefinition<AutocompleteString, TType>;
|
|
2639
2663
|
|
|
2640
2664
|
/** @public */
|
|
2641
2665
|
declare interface SchemaValidationError {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/media-library-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Type definitions for common Sanity Media Library data structures",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"content",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@sanity/pkg-utils": "10.4.
|
|
41
|
-
"@sanity/types": "5.
|
|
40
|
+
"@sanity/pkg-utils": "10.4.15",
|
|
41
|
+
"@sanity/types": "5.21.0",
|
|
42
42
|
"rimraf": "5.0.10"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
package/src/plugin.ts
CHANGED
|
@@ -33,6 +33,13 @@ export type PluginPayload = {
|
|
|
33
33
|
scheme: 'light' | 'dark'
|
|
34
34
|
selectAssetTypes: PluginSelectAssetType[]
|
|
35
35
|
selectionType: 'single' | 'multiple'
|
|
36
|
+
/**
|
|
37
|
+
* Opaque string the host generates to **partition persisted picker UI state** (e.g. folder path,
|
|
38
|
+
* search query, filters) in the Media Library iframe. Huey derives `localStorage` key suffixes
|
|
39
|
+
* from this value; embedders often derive it from project + dataset + workspace (or any stable
|
|
40
|
+
* context).
|
|
41
|
+
*/
|
|
42
|
+
pickerPersistenceKey?: string
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
/**
|
package/src/schema.types.ts
CHANGED
|
@@ -186,6 +186,10 @@ export type SanityImageMetadata = {
|
|
|
186
186
|
isOpaque: boolean
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
export type SanityFileMetadata = {
|
|
190
|
+
_type: 'sanity.fileMetadata'
|
|
191
|
+
}
|
|
192
|
+
|
|
189
193
|
export type SanityAssetVersionReference = {
|
|
190
194
|
_ref: string
|
|
191
195
|
_type: 'reference'
|
|
@@ -418,6 +422,7 @@ export type AllSanitySchemaTypes =
|
|
|
418
422
|
| SanityImagePalette
|
|
419
423
|
| SanityImageDimensions
|
|
420
424
|
| SanityImageMetadata
|
|
425
|
+
| SanityFileMetadata
|
|
421
426
|
| SanityAssetVersionReference
|
|
422
427
|
| SanityAsset
|
|
423
428
|
| SanityImageAssetReference
|