@sanity/types 6.5.1-next.6 → 6.6.0-next.100

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +29 -16
  2. package/package.json +8 -8
package/lib/index.d.ts CHANGED
@@ -8,6 +8,12 @@ interface SanityDocument {
8
8
  _createdAt: string;
9
9
  _updatedAt: string;
10
10
  _rev: string;
11
+ /**
12
+ * System-managed attributes. Which fields are present depends on the document (e.g.
13
+ * `variant`/`scopeId` only exist on version documents, and documents predating the `_system`
14
+ * migration may carry only some of them), hence the partial shape.
15
+ */
16
+ _system?: Partial<DocumentSystem>;
11
17
  [key: string]: unknown;
12
18
  }
13
19
  /**
@@ -23,9 +29,12 @@ interface SanityDocumentLike {
23
29
  _createdAt?: string;
24
30
  _updatedAt?: string;
25
31
  _rev?: string;
26
- _system?: {
27
- delete?: boolean;
28
- };
32
+ /**
33
+ * System-managed attributes. Which fields are present depends on the document (e.g.
34
+ * `variant`/`scopeId` only exist on version documents, and documents predating the `_system`
35
+ * migration may carry only some of them), hence the partial shape.
36
+ */
37
+ _system?: Partial<DocumentSystem>;
29
38
  [key: string]: unknown;
30
39
  }
31
40
  /** @public */
@@ -69,6 +78,10 @@ interface DocumentSystem {
69
78
  * Available only for version documents.
70
79
  */
71
80
  scopeId?: string;
81
+ /**
82
+ * Set when the document is marked for unpublishing inside a release.
83
+ */
84
+ delete?: boolean;
72
85
  }
73
86
  /**
74
87
  * @internal
@@ -186,7 +199,7 @@ type CurrentUserAttribute = { [T in UserAttributeType]: {
186
199
  key: string;
187
200
  type: T;
188
201
  value: UserAttributeValueByType[T];
189
- } }[UserAttributeType];
202
+ }; }[UserAttributeType];
190
203
  /** @public */
191
204
  interface CurrentUser {
192
205
  id: string;
@@ -618,7 +631,7 @@ type Validator<T = any, Value = any> = (constraint: T, value: Value, message: st
618
631
  */
619
632
  type Validators = Partial<{ [P in RuleSpec['flag']]: Validator<Exclude<ConditionalIndexAccess<Extract<RuleSpec, {
620
633
  flag: P;
621
- }>, 'constraint'>, FieldReference>> }>;
634
+ }>, 'constraint'>, FieldReference>>; }>;
622
635
  /** @internal */
623
636
  interface ValidationErrorOptions {
624
637
  paths?: Path[];
@@ -935,27 +948,27 @@ type ArrayActionName =
935
948
  /**
936
949
  * Add any item to the array at any position
937
950
  */
938
- 'add'
951
+ 'add' |
939
952
  /**
940
953
  * Add item after an existing item
941
954
  */
942
- | 'addBefore'
955
+ 'addBefore' |
943
956
  /**
944
957
  * Add item after an existing item
945
958
  */
946
- | 'addAfter'
959
+ 'addAfter' |
947
960
  /**
948
961
  * Remove any item
949
962
  */
950
- | 'remove'
963
+ 'remove' |
951
964
  /**
952
965
  * Duplicate item
953
966
  */
954
- | 'duplicate'
967
+ 'duplicate' |
955
968
  /**
956
969
  * Copy item
957
970
  */
958
- | 'copy';
971
+ 'copy';
959
972
  /** @public */
960
973
  interface ArrayOptions<V = unknown> extends SearchConfiguration, BaseSchemaTypeOptions {
961
974
  list?: TitledListValue<V>[] | V[];
@@ -994,7 +1007,7 @@ type ArrayOfEntry<T> = Omit<T, 'name' | 'hidden'> & {
994
1007
  type IntrinsicArrayOfDefinition = { [K in keyof IntrinsicDefinitions]: Omit<ArrayOfEntry<IntrinsicDefinitions[K]>, 'validation' | 'initialValue'> & {
995
1008
  validation?: SchemaValidationValue;
996
1009
  initialValue?: InitialValueProperty<any, any>;
997
- } };
1010
+ }; };
998
1011
  /** @public */
999
1012
  type ArrayOfType<TType extends IntrinsicTypeName = IntrinsicTypeName, TAlias extends IntrinsicTypeName | undefined = undefined> = IntrinsicArrayOfDefinition[TType] | ArrayOfEntry<TypeAliasDefinition<AutocompleteString, TAlias>>;
1000
1013
  /** @public */
@@ -1748,9 +1761,9 @@ interface DefineSchemaOptions<TStrict extends StrictDefinition, TAlias extends I
1748
1761
  aliasFor?: TAlias extends IntrinsicTypeName ? TAlias : never;
1749
1762
  }
1750
1763
  /** @beta */
1751
- type IntrinsicBase = { [K in keyof IntrinsicDefinitions]: Omit<IntrinsicDefinitions[K], 'preview'> };
1764
+ type IntrinsicBase = { [K in keyof IntrinsicDefinitions]: Omit<IntrinsicDefinitions[K], 'preview'>; };
1752
1765
  /** @beta */
1753
- type IntrinsicArrayOfBase = { [K in keyof IntrinsicDefinitions]: Omit<ArrayOfEntry<IntrinsicDefinitions[K]>, 'preview'> };
1766
+ type IntrinsicArrayOfBase = { [K in keyof IntrinsicDefinitions]: Omit<ArrayOfEntry<IntrinsicDefinitions[K]>, 'preview'>; };
1754
1767
  /** @beta */
1755
1768
  type DefineSchemaBase<TType extends string, TAlias extends IntrinsicTypeName | undefined> = TType extends IntrinsicTypeName ? IntrinsicBase[TType] : TypeAliasDefinition<TType, TAlias>;
1756
1769
  /** @beta */
@@ -2124,7 +2137,7 @@ interface SortOrderingItem {
2124
2137
  type I18nTextRecord<K extends string> = { [P in K]?: {
2125
2138
  key: string;
2126
2139
  ns: string;
2127
- } };
2140
+ }; };
2128
2141
  /** @beta */
2129
2142
  type SortOrdering = {
2130
2143
  title: string;
@@ -2582,7 +2595,7 @@ interface FieldDefinitionBase {
2582
2595
  type InlineFieldDefinition = { [K in keyof IntrinsicDefinitions]: Omit<IntrinsicDefinitions[K], 'initialValue' | 'validation'> & {
2583
2596
  validation?: SchemaValidationValue;
2584
2597
  initialValue?: InitialValueProperty<any, any>;
2585
- } };
2598
+ }; };
2586
2599
  /**
2587
2600
  * The shape of a field definition. Note, it's recommended to use the
2588
2601
  * `defineField` function instead of using this type directly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/types",
3
- "version": "6.5.1-next.6",
3
+ "version": "6.6.0-next.100",
4
4
  "description": "Type definitions for common Sanity data structures",
5
5
  "keywords": [
6
6
  "cms",
@@ -34,8 +34,8 @@
34
34
  "./package.json": "./package.json"
35
35
  },
36
36
  "dependencies": {
37
- "@sanity/client": "^7.23.0",
38
- "@sanity/media-library-types": "^1.5.0"
37
+ "@sanity/client": "^7.24.0",
38
+ "@sanity/media-library-types": "^1.6.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@sanity/pkg-utils": "^10.9.0",
@@ -44,11 +44,11 @@
44
44
  "@vitejs/plugin-react": "^6.0.3",
45
45
  "react": "^19.2.7",
46
46
  "rimraf": "^6.1.3",
47
- "vite": "^8.1.4",
48
- "vitest": "^4.1.9",
49
- "@repo/package.config": "6.5.1-next.6+ad4ffd7e5f",
50
- "@repo/test-config": "6.5.1-next.6+ad4ffd7e5f",
51
- "@repo/tsconfig": "6.5.1-next.6+ad4ffd7e5f"
47
+ "vite": "^8.1.5",
48
+ "vitest": "^4.1.10",
49
+ "@repo/package.config": "6.6.0-next.100+ad8bc36645",
50
+ "@repo/test-config": "6.6.0-next.100+ad8bc36645",
51
+ "@repo/tsconfig": "6.6.0-next.100+ad8bc36645"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@types/react": "*"