@sanity/types 6.8.1-next.5 → 6.9.0-next.12
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.ts +47 -18
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -82,6 +82,14 @@ interface DocumentSystem {
|
|
|
82
82
|
* Set when the document is marked for unpublishing inside a release.
|
|
83
83
|
*/
|
|
84
84
|
delete?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Only on variant-of-published documents: a weak reference to the (stable, server-generated)
|
|
87
|
+
* id the drafts-bundle sibling of this variant occupies — `versions.<scopeId>.<groupId>` —
|
|
88
|
+
* whether or not that document currently exists. Lets clients check out and create the draft
|
|
89
|
+
* variant without computing scope ids client-side. Not populated for normal published docs or
|
|
90
|
+
* variants of releases.
|
|
91
|
+
*/
|
|
92
|
+
draft?: DocumentSystemRef;
|
|
85
93
|
}
|
|
86
94
|
/**
|
|
87
95
|
* @internal
|
|
@@ -1685,6 +1693,20 @@ type MaybeAllowUnknownProps<TStrict extends StrictDefinition> = TStrict extends
|
|
|
1685
1693
|
};
|
|
1686
1694
|
[index: string]: any;
|
|
1687
1695
|
} : unknown;
|
|
1696
|
+
/**
|
|
1697
|
+
* An inference-only intersection slot for the define helpers.
|
|
1698
|
+
*
|
|
1699
|
+
* TypeScript infers the exact type of the supplied schema definition into `TSchemaDefinition`
|
|
1700
|
+
* (inference descends into the deferred conditional's branches), but once inference completes the
|
|
1701
|
+
* conditional always resolves to `unknown`, which vanishes from the intersection. The argument is
|
|
1702
|
+
* therefore checked against the declared definition type alone — contextual typing (eg for
|
|
1703
|
+
* `validation` callbacks on unwrapped fields), excess property checks and deprecated-property
|
|
1704
|
+
* detection all keep resolving against the declared types — while the helpers can still return
|
|
1705
|
+
* the precise type that was supplied.
|
|
1706
|
+
*
|
|
1707
|
+
* @beta
|
|
1708
|
+
*/
|
|
1709
|
+
type InferSchemaDefinition<TSchemaDefinition> = [TSchemaDefinition] extends [never] ? TSchemaDefinition : unknown;
|
|
1688
1710
|
/** @beta */
|
|
1689
1711
|
type MaybePreview<Select extends Record<string, string> | undefined, PrepareValue extends Record<keyof Select, any> | undefined> = Select extends Record<string, string> ? PrepareValue extends Record<keyof Select, any> ? PreviewConfig<Select, PrepareValue> : never : never;
|
|
1690
1712
|
/** @beta */
|
|
@@ -1694,13 +1716,35 @@ type NarrowPreview<TType extends string, TAlias extends IntrinsicTypeName | unde
|
|
|
1694
1716
|
preview?: MaybePreview<TSelect, TPrepareValue>;
|
|
1695
1717
|
} : unknown;
|
|
1696
1718
|
/** @beta */
|
|
1719
|
+
type DefineTypeDefinition<TType extends string, TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition> = {
|
|
1720
|
+
type: TType;
|
|
1721
|
+
name: TName;
|
|
1722
|
+
} & DefineSchemaBase<TType, TAlias> & NarrowPreview<TType, TAlias, TSelect, TPrepareValue> & MaybeAllowUnknownProps<TStrict>;
|
|
1723
|
+
/** @beta */
|
|
1724
|
+
type DefineFieldDefinition<TType extends string, TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition> = DefineTypeDefinition<TType, TName, TSelect, TPrepareValue, TAlias, TStrict> & FieldDefinitionBase;
|
|
1725
|
+
/** @beta */
|
|
1726
|
+
type DefineArrayMemberDefinition<TType extends string, TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition> = {
|
|
1727
|
+
type: TType;
|
|
1728
|
+
/**
|
|
1729
|
+
* When provided, `name` is used as `_type` for the array item when stored.
|
|
1730
|
+
*
|
|
1731
|
+
* Necessary when an array contains multiple entries with the same `type`, each with
|
|
1732
|
+
* different configuration (title and initialValue for instance).
|
|
1733
|
+
*/
|
|
1734
|
+
name?: TName;
|
|
1735
|
+
} & DefineArrayMemberBase<TType, TAlias> & NarrowPreview<TType, TAlias, TSelect, TPrepareValue> & MaybeAllowUnknownProps<TStrict>;
|
|
1736
|
+
/** @beta */
|
|
1697
1737
|
interface WidenValidation {
|
|
1698
1738
|
validation?: SchemaValidationValue;
|
|
1699
1739
|
}
|
|
1700
1740
|
/** @beta */
|
|
1741
|
+
type MaybeWidenValidation<TSchemaDefinition> = 'validation' extends keyof TSchemaDefinition ? WidenValidation : unknown;
|
|
1742
|
+
/** @beta */
|
|
1701
1743
|
interface WidenInitialValue {
|
|
1702
1744
|
initialValue?: InitialValueProperty<any, any>;
|
|
1703
1745
|
}
|
|
1746
|
+
/** @beta */
|
|
1747
|
+
type MaybeWidenInitialValue<TSchemaDefinition> = 'initialValue' extends keyof TSchemaDefinition ? WidenInitialValue : unknown;
|
|
1704
1748
|
/**
|
|
1705
1749
|
* Helper function for defining a Sanity type definition. This function does not do anything on its own;
|
|
1706
1750
|
* it exists to check that your schema definition is correct, and help autocompletion in your IDE.
|
|
@@ -1860,10 +1904,7 @@ interface WidenInitialValue {
|
|
|
1860
1904
|
*
|
|
1861
1905
|
* @beta
|
|
1862
1906
|
*/
|
|
1863
|
-
declare function defineType<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition
|
|
1864
|
-
type: TType;
|
|
1865
|
-
name: TName;
|
|
1866
|
-
} & DefineSchemaBase<TType, TAlias> & NarrowPreview<TType, TAlias, TSelect, TPrepareValue> & MaybeAllowUnknownProps<TStrict>, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): typeof schemaDefinition;
|
|
1907
|
+
declare function defineType<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined = undefined, TStrict extends StrictDefinition = undefined, const TSchemaDefinition extends DefineTypeDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> = DefineTypeDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>>>(schemaDefinition: DefineTypeDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> & InferSchemaDefinition<TSchemaDefinition>, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): TSchemaDefinition;
|
|
1867
1908
|
/**
|
|
1868
1909
|
* Define a field within a document, object, image or file definition `fields` array.
|
|
1869
1910
|
*
|
|
@@ -1884,10 +1925,7 @@ declare function defineType<const TType extends IntrinsicTypeName | Autocomplete
|
|
|
1884
1925
|
*
|
|
1885
1926
|
* @beta
|
|
1886
1927
|
*/
|
|
1887
|
-
declare function defineField<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition
|
|
1888
|
-
type: TType;
|
|
1889
|
-
name: TName;
|
|
1890
|
-
} & DefineSchemaBase<TType, TAlias> & NarrowPreview<TType, TAlias, TSelect, TPrepareValue> & MaybeAllowUnknownProps<TStrict> & FieldDefinitionBase, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): typeof schemaField & WidenValidation & WidenInitialValue;
|
|
1928
|
+
declare function defineField<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined = undefined, TStrict extends StrictDefinition = undefined, const TSchemaDefinition extends DefineFieldDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> = DefineFieldDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>>>(schemaField: DefineFieldDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> & InferSchemaDefinition<TSchemaDefinition>, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): TSchemaDefinition & MaybeWidenValidation<TSchemaDefinition> & MaybeWidenInitialValue<TSchemaDefinition>;
|
|
1891
1929
|
/**
|
|
1892
1930
|
* Define an array item member type within an array definition `of`-array.
|
|
1893
1931
|
*
|
|
@@ -1908,16 +1946,7 @@ declare function defineField<const TType extends IntrinsicTypeName | Autocomplet
|
|
|
1908
1946
|
*
|
|
1909
1947
|
* @beta
|
|
1910
1948
|
*/
|
|
1911
|
-
declare function defineArrayMember<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined, TStrict extends StrictDefinition
|
|
1912
|
-
type: TType;
|
|
1913
|
-
/**
|
|
1914
|
-
* When provided, `name` is used as `_type` for the array item when stored.
|
|
1915
|
-
*
|
|
1916
|
-
* Necessary when an array contains multiple entries with the same `type`, each with
|
|
1917
|
-
* different configuration (title and initialValue for instance).
|
|
1918
|
-
*/
|
|
1919
|
-
name?: TName;
|
|
1920
|
-
} & DefineArrayMemberBase<TType, TAlias> & NarrowPreview<TType, TAlias, TSelect, TPrepareValue> & MaybeAllowUnknownProps<TStrict>, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): typeof arrayOfSchema & WidenValidation & WidenInitialValue;
|
|
1949
|
+
declare function defineArrayMember<const TType extends IntrinsicTypeName | AutocompleteString, const TName extends string, TSelect extends Record<string, string> | undefined, TPrepareValue extends Record<keyof TSelect, any> | undefined, TAlias extends IntrinsicTypeName | undefined = undefined, TStrict extends StrictDefinition = undefined, const TSchemaDefinition extends DefineArrayMemberDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> = DefineArrayMemberDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>>>(arrayOfSchema: DefineArrayMemberDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>> & InferSchemaDefinition<TSchemaDefinition>, defineOptions?: DefineSchemaOptions<TStrict, TAlias>): TSchemaDefinition & MaybeWidenValidation<TSchemaDefinition> & MaybeWidenInitialValue<TSchemaDefinition>;
|
|
1921
1950
|
/**
|
|
1922
1951
|
* `typed` can be used to ensure that an object conforms to an exact interface.
|
|
1923
1952
|
*
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isRecord"],"sources":["../src/helpers.ts","../src/reference/asserters.ts","../src/assets/asserters.ts","../src/crossDatasetReference/asserters.ts","../src/documents/asserters.ts","../src/globalDocumentReference/asserters.ts","../src/markers/asserters.ts","../src/mediaLibrary/types.ts","../src/mediaLibrary/asserters.ts","../src/mediaLibrary/defineAssetAspect.ts","../src/mutations/asserters.ts","../src/paths/asserters.ts","../src/portableText/asserters.ts","../src/schema/asserters.ts","../src/schema/define.ts","../src/search/types.ts","../src/search/asserters.ts","../src/slug/asserters.ts","../src/transactionLog/asserters.ts","../src/validation/asserters.ts"],"sourcesContent":["export function isObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj)\n}\n","import {isObject} from '../helpers'\nimport {type Reference} from './types'\n\n/** @internal */\nexport function isReference(reference: unknown): reference is Reference {\n return isObject(reference) && typeof reference._ref === 'string'\n}\n","import {isObject} from '../helpers'\nimport {isReference} from '../reference/asserters'\nimport {type Image} from './types'\n\n/** @public */\nexport function isImage(value: unknown): value is Image {\n return isObject(value) && isReference(value.asset) && value.asset._ref.startsWith('image-')\n}\n","import {isObject} from '../helpers'\nimport {type CrossDatasetReferenceValue} from './types'\n\n/** @beta */\nexport function isCrossDatasetReference(\n reference: unknown,\n): reference is CrossDatasetReferenceValue {\n return (\n isObject(reference) &&\n typeof reference._ref === 'string' &&\n typeof reference._dataset === 'string' &&\n typeof reference._projectId === 'string'\n )\n}\n","import {isObject} from '../helpers'\nimport {type KeyedObject, type SanityDocument, type TypedObject} from './types'\n\n/** @public */\nexport function isSanityDocument(document: unknown): document is SanityDocument {\n return (\n isObject(document) && typeof document._id === 'string' && typeof document._type === 'string'\n )\n}\n\n/** @public */\nexport function isTypedObject(obj: unknown): obj is TypedObject {\n return isObject(obj) && typeof obj._type === 'string'\n}\n\n/** @public */\nexport function isKeyedObject(obj: unknown): obj is KeyedObject {\n return isObject(obj) && typeof obj._key === 'string'\n}\n","import {isObject} from '../helpers'\nimport {type GlobalDocumentReferenceValue} from './types'\n\n/** @beta */\nexport function isGlobalDocumentReference(\n reference: unknown,\n): reference is GlobalDocumentReferenceValue {\n if (!isObject(reference) || typeof reference._ref !== 'string') {\n return false\n }\n\n return reference._ref.split(':').length === 3\n}\n","import {type ValidationMarker} from './types'\n\n/** @internal */\nexport function isValidationErrorMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'error'} {\n return marker.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarningMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'warning'} {\n return marker.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfoMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'info'} {\n return marker.level === 'info'\n}\n","import {type FileAsset, type ImageAsset} from '../assets/types'\nimport {type SanityDocumentLike} from '../documents/types'\nimport {type FieldDefinition, type IntrinsicTypeName} from '../schema/definition/schemaDefinition'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition<\n Exclude<IntrinsicTypeName, 'document' | 'image' | 'file' | 'reference' | 'crossDatasetReference'>\n>\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectDefinition = MediaLibraryAssetAspectSupportedFieldDefinitions & {\n assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]\n\n // Whether the aspect is publicly available from GROQ queries\n public?: boolean\n}\n\n/**\n * @public\n */\nexport const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = 'sanity.asset.aspect'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n\n/**\n * @public\n */\nexport type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']\n\n/**\n * A document representing a Media Library asset aspect.\n *\n * Each aspect provides a schema describing custom data that can be assigned to assets.\n *\n * @public\n */\nexport interface MediaLibraryAssetAspectDocument extends SanityDocumentLike {\n _type: MediaLibraryAssetAspectTypeName\n /**\n * Asset types the aspect can be assigned to.\n *\n * If no `assetType` is defined, the aspect may be assigned to any asset type.\n */\n assetType?: MediaLibraryAssetType[]\n definition: FieldDefinition\n public?: boolean\n}\n","import {MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, type MediaLibraryAssetAspectDocument} from './types'\n\n/**\n * Check whether the provided value resembles a Media Library asset aspect document.\n *\n * Note: This function does not perform a comprehensive check.\n *\n * @see validateMediaLibraryAssetAspect\n *\n * @internal\n */\nexport function isAssetAspect(\n maybeAssetAspect: unknown,\n): maybeAssetAspect is MediaLibraryAssetAspectDocument {\n return (\n typeof maybeAssetAspect === 'object' &&\n maybeAssetAspect !== null &&\n '_type' in maybeAssetAspect &&\n maybeAssetAspect._type === MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n )\n}\n","import {\n MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n type MediaLibraryAssetAspectDefinition,\n type MediaLibraryAssetAspectDocument,\n} from './types'\n\n/**\n * Define a Media Library asset aspect.\n *\n * Aspects can be deployed using the `sanity media deploy-aspect` CLI command.\n *\n * @public\n * @beta\n */\nexport function defineAssetAspect(\n definition: MediaLibraryAssetAspectDefinition,\n): MediaLibraryAssetAspectDocument {\n const {assetType, name} = definition\n\n return {\n _type: MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n _id: `${name}`,\n definition,\n ...(assetType && {\n assetType: Array.isArray(assetType) ? assetType : [assetType],\n }),\n public: definition.public,\n }\n}\n","import {type TransactionLogMutation} from '../transactionLog/types'\nimport {\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type Mutation,\n type PatchMutation,\n} from './types'\n\n/** @internal */\nexport function isCreateMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateMutation {\n return 'create' in mutation\n}\n\n/** @internal */\nexport function isCreateIfNotExistsMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateIfNotExistsMutation {\n return 'createIfNotExists' in mutation\n}\n\n/** @internal */\nexport function isCreateOrReplaceMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateOrReplaceMutation {\n return 'createOrReplace' in mutation\n}\n\n/** @internal */\nexport function isDeleteMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is DeleteMutation {\n return 'delete' in mutation\n}\n\n/** @internal */\nexport function isPatchMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is PatchMutation {\n return 'patch' in mutation\n}\n","import {type IndexTuple, type KeyedSegment, type PathSegment} from './types'\n\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\nconst reIndexTuple = /^\\d*:\\d*$/\n\n/** @internal */\nexport function isIndexSegment(segment: PathSegment): segment is number {\n return typeof segment === 'number' || (typeof segment === 'string' && /^\\[\\d+\\]$/.test(segment))\n}\n\n/** @internal */\nexport function isKeySegment(segment: PathSegment): segment is KeyedSegment {\n if (typeof segment === 'string') {\n return reKeySegment.test(segment.trim())\n }\n\n return typeof segment === 'object' && '_key' in segment\n}\n\n/** @internal */\nexport function isIndexTuple(segment: PathSegment): segment is IndexTuple {\n if (typeof segment === 'string' && reIndexTuple.test(segment)) {\n return true\n }\n\n if (!Array.isArray(segment) || segment.length !== 2) {\n return false\n }\n\n const [from, to] = segment\n return (typeof from === 'number' || from === '') && (typeof to === 'number' || to === '')\n}\n","import {type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Assert that a given object is a portable-text text-block type object\n *\n * @remarks\n * * The `markDefs` and `style` property of a block is optional.\n * * Block types can be named, so expect anything of the _type property.\n *\n * @alpha\n */\nexport function isPortableTextTextBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isRecord(value) &&\n typeof value._type === 'string' && // block types can be named, so expect anything here.\n Array.isArray(value.children) &&\n value.children.every((child) => isRecord(child)) &&\n ('markDefs' in value // optional property\n ? Array.isArray(value.markDefs) && value.markDefs.every((def) => isRecord(def))\n : true) &&\n ('style' in value ? typeof value.style === 'string' : true) // optional property\n )\n}\n\n/**\n * Assert that a given object is a portable-text span-type object\n *\n * @remarks\n * The `marks` property of a block is optional.\n *\n * @alpha\n */\nexport function isPortableTextSpan(value: unknown): value is PortableTextSpan {\n return (\n isRecord(value) &&\n value._type === 'span' &&\n typeof value.text === 'string' &&\n ('marks' in value // optional property\n ? Array.isArray(value.marks) && value.marks.every((mark) => typeof mark === 'string')\n : true)\n )\n}\n\n/**\n * Assert that a given object is a portable-text list-text-block-type object\n *\n * @remarks\n * Uses `isPortableTextTextBlock` and checks for `listItem` and `level`\n *\n * @see isPortableTextTextBlock\n *\n * @alpha\n */\nexport function isPortableTextListBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isPortableTextTextBlock(value) &&\n 'listItem' in value &&\n typeof value.listItem === 'string' &&\n 'level' in value &&\n Number.isInteger(value.level)\n )\n}\n","import {type CrossDatasetReferenceSchemaType} from '../crossDatasetReference/types'\nimport {type TitledListValue} from './definition/type/common'\nimport {\n type ArraySchemaType,\n type BaseSchemaType,\n type BlockChildrenObjectField,\n type BlockListObjectField,\n type BlockSchemaType,\n type BlockStyleObjectField,\n type BooleanSchemaType,\n type DeprecatedSchemaType,\n type DeprecationConfiguration,\n type FileSchemaType,\n type ImageSchemaType,\n type NumberSchemaType,\n type ObjectSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n type SpanSchemaType,\n type StringSchemaType,\n} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Returns wether or not the given type is a document type\n * (eg that it was defined as `type: 'document'`)\n *\n * @param type - Schema type to test\n * @returns True if type is a document type, false otherwise\n *\n * @public\n */\nexport function isDocumentSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isObjectSchemaType(type)) {\n return false\n }\n\n let current: SchemaType | undefined = type as SchemaType\n while (current) {\n if (current.name === 'document') {\n return true\n }\n\n current = current.type\n }\n return false\n}\n\n/** @internal */\nexport function isObjectSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'object'\n}\n\n/** @internal */\nexport function isArraySchemaType(type: unknown): type is ArraySchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'array'\n}\n\n/** @internal */\nexport function isArrayOfBlocksSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.some((memberType) => isBlockSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfObjectsSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.every((memberType) => isObjectSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType {\n return isArraySchemaType(type) && type.of.every((memberType) => isPrimitiveSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfStringsSchemaType(type: unknown): type is ArraySchemaType<string> {\n return isArraySchemaType(type) && type.of.every((memberType) => isStringSchemaType(memberType))\n}\n\n/** @internal */\nexport function isBooleanSchemaType(type: unknown): type is BooleanSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'boolean'\n}\n\n/** @internal */\nexport function isStringSchemaType(type: unknown): type is StringSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isDateTimeSchemaType(type: unknown): type is StringSchemaType {\n if (!isStringSchemaType(type)) return false\n return type.name === 'datetime'\n}\n\n/** @internal */\nexport function isNumberSchemaType(type: unknown): type is NumberSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'number'\n}\n\n/** @internal */\nexport function isPrimitiveSchemaType(\n type: unknown,\n): type is BooleanSchemaType | StringSchemaType | NumberSchemaType {\n return isBooleanSchemaType(type) || isStringSchemaType(type) || isNumberSchemaType(type)\n}\n\n/** @internal */\nexport function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType {\n return isRecord(type) && (type.name === 'reference' || isReferenceSchemaType(type.type))\n}\n\n/** @internal */\nexport function isImageSchemaType(type: unknown): type is ImageSchemaType {\n return isRecord(type) && (type.name === 'image' || isImageSchemaType(type.type))\n}\n\n/** @internal */\nexport function isFileSchemaType(type: unknown): type is FileSchemaType {\n return isRecord(type) && (type.name === 'file' || isFileSchemaType(type.type))\n}\n\n/** @internal */\nexport function isDeprecatedSchemaType<TSchemaType extends BaseSchemaType>(\n type: TSchemaType,\n): type is DeprecatedSchemaType<TSchemaType> {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isCrossDatasetReferenceSchemaType(\n type: unknown,\n): type is CrossDatasetReferenceSchemaType {\n return (\n isRecord(type) &&\n (type.name === 'crossDatasetReference' || isCrossDatasetReferenceSchemaType(type.type))\n )\n}\n\n/** @internal */\nexport function isTitledListValue(item: unknown): item is TitledListValue {\n return typeof item === 'object' && item !== null && 'title' in item && 'value' in item\n}\n\n/** @internal */\nexport function isSpanSchemaType(type: unknown): type is SpanSchemaType {\n if (!isRecord(type)) return false\n // we check for `annotations` and `decorators` instead of `type.name` because\n // schema names can technically change if someone extends the type\n return Array.isArray(type.annotations) && Array.isArray(type.decorators)\n}\n\n/** @internal */\nexport function isBlockSchemaType(type: unknown): type is BlockSchemaType {\n if (!isRecord(type)) return false\n if (!Array.isArray(type.fields)) return false\n const maybeSpanChildren = type.fields.find(isBlockChildrenObjectField)\n const maybeStyle = type.fields.find(isBlockStyleObjectField)\n const maybeList = type.fields.find(isBlockListObjectField)\n return (\n isBlockChildrenObjectField(maybeSpanChildren) &&\n isBlockStyleObjectField(maybeStyle) &&\n isBlockListObjectField(maybeList)\n )\n}\n\n/** @internal */\nexport function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'style') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockListObjectField(field: unknown): field is BlockListObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'listItem') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockChildrenObjectField(field: unknown): field is BlockChildrenObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'children') return false\n if (!isArraySchemaType(field.type)) return false\n // there will always be a span item in `SpanChildrenObjectField`\n return field.type.of.some(isSpanSchemaType)\n}\n","import {\n type DefineArrayMemberBase,\n type DefineSchemaBase,\n type DefineSchemaOptions,\n type MaybeAllowUnknownProps,\n type NarrowPreview,\n type StrictDefinition,\n type WidenInitialValue,\n type WidenValidation,\n} from './defineTypes'\nimport {type FieldDefinitionBase, type IntrinsicTypeName} from './definition/schemaDefinition'\nimport {type AutocompleteString} from './types'\n\n/**\n * Helper function for defining a Sanity type definition. This function does not do anything on its own;\n * it exists to check that your schema definition is correct, and help autocompletion in your IDE.\n *\n * This function will narrow the schema type down to fields and options based on the provided type-string.\n *\n * Schema types defined using `defineType` should typically be added to the Studio config under `schema.types`.\n * Defined types can be referenced by their `name`. This is referred to as a type-alias.\n *\n * When using type-aliases as `type`, `defineType` cannot know the base-type, so type-safety will be reduced.\n * If you know the base type of the type-alias, provide `defineOptions.aliasFor: <base type name>`.\n * This will enforce that the schema definition conforms with the provided type.\n *\n * By default, `defineType` only allows known properties and options.\n * Use `defineOptions.strict: false` to allow unknown properties and options.\n *\n * ### Basic usage\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [ {type: 'string', name: 'title', title: 'Title'}],\n * })\n * ```\n *\n * ### Usage with aliasFor narrowing\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * options: {\n * columns: 2\n * }\n * }, {aliasFor: 'object' })\n * ```\n *\n * ### Allow unknown properties\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * allowsUnknownProperties: true\n * options: {\n * columns: 2,\n * allowsUnknownOptions: true\n * }\n * }, {strict: false})\n * ```\n * ### Maximum safety and best autocompletion\n *\n * Use {@link defineType}, {@link defineField} and {@link defineArrayMember}:\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [\n * defineField({\n * type: 'array',\n * name: 'arrayField',\n * title: 'Things',\n * of: [\n * defineArrayMember({\n * type: 'object',\n * name: 'type-name-in-array',\n * fields: [defineField({type: 'string', name: 'title', title: 'Title'})],\n * }),\n * ],\n * }),\n * ],\n * })\n * ```\n *\n * ## Note on type-safety in the current implementation\n *\n * Type-safety inside array-like properties (schema properties like `fields` and `of`) can only be guaranteed when\n * {@link defineField} and {@link defineArrayMember} are used to wrap each value in the array.\n *\n * For array-values without a function-wrapper, TypeScript will resolve to a union type of all possible properties across\n * all schema types. This result in less precise typing.\n *\n * ### Extending the Sanity Schema types\n *\n * If you want to extend the Sanity Schema types with your own properties or options to make them typesafe,\n * you can use [TypeScript declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).\n *\n * With declaration merging, properties and options will be available in a type-safe manner, and\n * `strict: false` will not be necessary.\n *\n * #### Example: Add option to StringOptions\n *\n * ```ts\n * // string.ts\n *\n * //redeclare the sanity module\n * declare module 'sanity' {\n * // redeclare StringOptions; it will be merged with StringOptions in the sanity module\n * export interface StringOptions {\n * myCustomOption?: boolean\n * }\n * }\n *\n * // the option is now part of the StringOptions type, just as if it was declared in the sanity codebase:\n * defineType({\n * type: 'string',\n * name: 'my-string',\n * options: {\n * myCustomOption: true // this does not give an error anymore\n * }\n * })\n *\n * ```\n *\n * #### Example: Add a schema definition to \"intrinsic-types\"\n *\n * ```ts\n * //my-custom-type-definition.ts\n *\n * // create a new schema definition based on object (we remove the ability to assign field, change the type add some options)\n * export type MagicallyAddedDefinition = Omit<Schema.ObjectDefinition, 'type' | 'fields'> & {\n * type: 'magically-added-type'\n * options?: {\n * sparkles?: boolean\n * }\n * }\n *\n * // redeclares sanity module so we can add interfaces props to it\n * declare module 'sanity' {\n * // redeclares IntrinsicDefinitions and adds a named definition to it\n * // it is important that the key is the same as the type in the definition ('magically-added-type')\n * export interface IntrinsicDefinitions {\n * 'magically-added-type': MagicallyAddedDefinition\n * }\n * }\n *\n * // defineType will now narrow `type: 'magically-added-type'` to `MagicallyAddedDefinition`\n * defineType({\n * type: 'magically-added-type'\n * name: 'magic',\n * options: {\n * sparkles: true // this is allowed,\n * //@ts-expect-error this is not allowed in MagicallyAddedDefinition.options\n * sparks: true\n * }\n * })\n * ```\n *\n * @param schemaDefinition - should be a valid schema type definition.\n * @param defineOptions - optional param to provide type hints for `schemaDefinition`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineType<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaDefinition: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaDefinition {\n return schemaDefinition\n}\n\n/**\n * Define a field within a document, object, image or file definition `fields` array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * type-string.\n *\n * Using `defineField` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field-properties like `validation` and `initialValue`will also be more specific.\n *\n * See {@link defineType} for more examples.\n *\n * @param schemaField - should be a valid field type definition.\n * @param defineOptions - optional param to provide type hints for `schemaField`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineField<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n schemaField: {\n type: TType\n name: TName\n } & DefineSchemaBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict> &\n FieldDefinitionBase,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof schemaField & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return schemaField as typeof schemaField & WidenValidation & WidenInitialValue\n}\n\n/**\n * Define an array item member type within an array definition `of`-array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * `type` string.\n *\n * Using `defineArrayMember` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field properties like `validation` and `initialValue` will also be more specific.\n *\n * See {@link defineType} for example usage.\n *\n * @param arrayOfSchema - should be a valid `array.of` member definition.\n * @param defineOptions - optional param to provide type hints for `arrayOfSchema`.\n *\n * @see defineType\n * @see defineField\n * @see typed\n *\n * @beta\n */\nexport function defineArrayMember<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined,\n TStrict extends StrictDefinition,\n>(\n arrayOfSchema: {\n type: TType\n /**\n * When provided, `name` is used as `_type` for the array item when stored.\n *\n * Necessary when an array contains multiple entries with the same `type`, each with\n * different configuration (title and initialValue for instance).\n */\n name?: TName\n } & DefineArrayMemberBase<TType, TAlias> &\n NarrowPreview<TType, TAlias, TSelect, TPrepareValue> &\n MaybeAllowUnknownProps<TStrict>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): typeof arrayOfSchema & WidenValidation & WidenInitialValue {\n // TODO: re-evaluate the need for this cast\n return arrayOfSchema as typeof arrayOfSchema & WidenValidation & WidenInitialValue\n}\n\n/**\n * `typed` can be used to ensure that an object conforms to an exact interface.\n *\n * It can be useful when working with `defineType` and `defineField` on occasions where a wider type with\n * custom options or properties is required.\n *\n * ## Example usage\n * ```ts\n * defineField({\n * type: 'string',\n * name: 'nestedField',\n * options: typed<StringOptions & {myCustomOption: boolean}>({\n * layout: 'radio',\n * // allowed\n * myCustomOption: true,\n * //@ts-expect-error unknownProp is not part of StringOptions & {myCustomOption: boolean}\n * unknownProp: 'not allowed in typed context',\n * }),\n * }),\n * ```\n *\n * @param input - returned directly\n *\n * @internal\n */\nexport function typed<T>(input: T): T {\n return input\n}\n","/**\n * @public\n */\nexport const searchStrategies = ['groq2024', 'groqLegacy'] as const\n\n/**\n * @public\n */\nexport type SearchStrategy = (typeof searchStrategies)[number]\n","import {searchStrategies, type SearchStrategy} from './types'\n\n/**\n * @internal\n */\nexport function isSearchStrategy(\n maybeSearchStrategy: unknown,\n): maybeSearchStrategy is SearchStrategy {\n return searchStrategies.includes(maybeSearchStrategy as SearchStrategy)\n}\n","import {isObject} from '../helpers'\nimport {type Slug} from './types'\n\n/**\n * Checks whether the given `thing` is a slug, eg an object with a `current` string property.\n *\n * @param thing - The thing to check\n * @returns True if slug, false otherwise\n * @public\n */\nexport function isSlug(thing: unknown): thing is Slug {\n return isObject(thing) && typeof thing.current === 'string'\n}\n","import {type Mutation} from '../mutations/types'\nimport {type CreateSquashedMutation, type TransactionLogMutation} from './types'\n\n/** @internal */\nexport function isCreateSquashedMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateSquashedMutation {\n return 'createSquashed' in mutation\n}\n","import {type FormNodeValidation} from './types'\n\n/** @internal */\nexport function isValidationError(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'error'} {\n return node.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarning(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'warning'} {\n return node.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfo(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'info'} {\n return node.level === 'info'\n}\n"],"mappings":"AAAA,SAAgB,SAAS,KAA8C;CACrE,OAAO,OAAO,OAAQ,cAAY,OAAgB,CAAC,MAAM,QAAQ,GAAG;AACtE;;ACEA,SAAgB,YAAY,WAA4C;CACtE,OAAO,SAAS,SAAS,KAAK,OAAO,UAAU,QAAS;AAC1D;;ACDA,SAAgB,QAAQ,OAAgC;CACtD,OAAO,SAAS,KAAK,KAAK,YAAY,MAAM,KAAK,KAAK,MAAM,MAAM,KAAK,WAAW,QAAQ;AAC5F;;ACHA,SAAgB,wBACd,WACyC;CACzC,OACE,SAAS,SAAS,KAClB,OAAO,UAAU,QAAS,YAC1B,OAAO,UAAU,YAAa,YAC9B,OAAO,UAAU,cAAe;AAEpC;;ACTA,SAAgB,iBAAiB,UAA+C;CAC9E,OACE,SAAS,QAAQ,KAAK,OAAO,SAAS,OAAQ,YAAY,OAAO,SAAS,SAAU;AAExF;;AAGA,SAAgB,cAAc,KAAkC;CAC9D,OAAO,SAAS,GAAG,KAAK,OAAO,IAAI,SAAU;AAC/C;;AAGA,SAAgB,cAAc,KAAkC;CAC9D,OAAO,SAAS,GAAG,KAAK,O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AAS,aAAmB,KAC/B,SAAS,MAAM,IAAI,KAAK,MAAM,KAAK,aAAa;AACzD;;AAGA,SAAgB,2BAA2B,OAAmD;CAK5F,OAJI,CAAC,SAAS,KAAK,KACf,MAAM,SAAS,cACf,CAAC,kBAAkB,MAAM,IAAI,IAAU,KAEpC,MAAM,KAAK,GAAG,KAAK,gBAAgB;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjCA,SAAgB,WAQd,kBAOA,eACyB;CACzB,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,YAQd,aAQA,eAC0D;CAE1D,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,kBAQd,eAaA,eAC4D;CAE5D,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,MAAS,OAAa;CACpC,OAAO;AACT;;;;ACjTA,MAAa,mBAAmB,CAAC,YAAY,YAAY;;;;ACEzD,SAAgB,iBACd,qBACuC;CACvC,OAAO,iBAAiB,SAAS,mBAAqC;AACxE;;;;;;;;ACCA,SAAgB,OAAO,OAA+B;CACpD,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,WAAY;AACrD;;ACRA,SAAgB,yBACd,UACoC;CACpC,OAAO,oBAAoB;AAC7B;;ACLA,SAAgB,kBACd,MAC+C;CAC/C,OAAO,KAAK,UAAU;AACxB;;AAGA,SAAgB,oBACd,MACiD;CACjD,OAAO,KAAK,UAAU;AACxB;;AAGA,SAAgB,iBACd,MAC8C;CAC9C,OAAO,KAAK,UAAU;AACxB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["isRecord"],"sources":["../src/helpers.ts","../src/reference/asserters.ts","../src/assets/asserters.ts","../src/crossDatasetReference/asserters.ts","../src/documents/asserters.ts","../src/globalDocumentReference/asserters.ts","../src/markers/asserters.ts","../src/mediaLibrary/types.ts","../src/mediaLibrary/asserters.ts","../src/mediaLibrary/defineAssetAspect.ts","../src/mutations/asserters.ts","../src/paths/asserters.ts","../src/portableText/asserters.ts","../src/schema/asserters.ts","../src/schema/define.ts","../src/search/types.ts","../src/search/asserters.ts","../src/slug/asserters.ts","../src/transactionLog/asserters.ts","../src/validation/asserters.ts"],"sourcesContent":["export function isObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj)\n}\n","import {isObject} from '../helpers'\nimport {type Reference} from './types'\n\n/** @internal */\nexport function isReference(reference: unknown): reference is Reference {\n return isObject(reference) && typeof reference._ref === 'string'\n}\n","import {isObject} from '../helpers'\nimport {isReference} from '../reference/asserters'\nimport {type Image} from './types'\n\n/** @public */\nexport function isImage(value: unknown): value is Image {\n return isObject(value) && isReference(value.asset) && value.asset._ref.startsWith('image-')\n}\n","import {isObject} from '../helpers'\nimport {type CrossDatasetReferenceValue} from './types'\n\n/** @beta */\nexport function isCrossDatasetReference(\n reference: unknown,\n): reference is CrossDatasetReferenceValue {\n return (\n isObject(reference) &&\n typeof reference._ref === 'string' &&\n typeof reference._dataset === 'string' &&\n typeof reference._projectId === 'string'\n )\n}\n","import {isObject} from '../helpers'\nimport {type KeyedObject, type SanityDocument, type TypedObject} from './types'\n\n/** @public */\nexport function isSanityDocument(document: unknown): document is SanityDocument {\n return (\n isObject(document) && typeof document._id === 'string' && typeof document._type === 'string'\n )\n}\n\n/** @public */\nexport function isTypedObject(obj: unknown): obj is TypedObject {\n return isObject(obj) && typeof obj._type === 'string'\n}\n\n/** @public */\nexport function isKeyedObject(obj: unknown): obj is KeyedObject {\n return isObject(obj) && typeof obj._key === 'string'\n}\n","import {isObject} from '../helpers'\nimport {type GlobalDocumentReferenceValue} from './types'\n\n/** @beta */\nexport function isGlobalDocumentReference(\n reference: unknown,\n): reference is GlobalDocumentReferenceValue {\n if (!isObject(reference) || typeof reference._ref !== 'string') {\n return false\n }\n\n return reference._ref.split(':').length === 3\n}\n","import {type ValidationMarker} from './types'\n\n/** @internal */\nexport function isValidationErrorMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'error'} {\n return marker.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarningMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'warning'} {\n return marker.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfoMarker(\n marker: ValidationMarker,\n): marker is ValidationMarker & {level: 'info'} {\n return marker.level === 'info'\n}\n","import {type FileAsset, type ImageAsset} from '../assets/types'\nimport {type SanityDocumentLike} from '../documents/types'\nimport {type FieldDefinition, type IntrinsicTypeName} from '../schema/definition/schemaDefinition'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectSupportedFieldDefinitions = FieldDefinition<\n Exclude<IntrinsicTypeName, 'document' | 'image' | 'file' | 'reference' | 'crossDatasetReference'>\n>\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectDefinition = MediaLibraryAssetAspectSupportedFieldDefinitions & {\n assetType?: MediaLibraryAssetType | MediaLibraryAssetType[]\n\n // Whether the aspect is publicly available from GROQ queries\n public?: boolean\n}\n\n/**\n * @public\n */\nexport const MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME = 'sanity.asset.aspect'\n\n/**\n * @public\n */\nexport type MediaLibraryAssetAspectTypeName = typeof MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n\n/**\n * @public\n */\nexport type MediaLibraryAssetType = ImageAsset['_type'] | FileAsset['_type']\n\n/**\n * A document representing a Media Library asset aspect.\n *\n * Each aspect provides a schema describing custom data that can be assigned to assets.\n *\n * @public\n */\nexport interface MediaLibraryAssetAspectDocument extends SanityDocumentLike {\n _type: MediaLibraryAssetAspectTypeName\n /**\n * Asset types the aspect can be assigned to.\n *\n * If no `assetType` is defined, the aspect may be assigned to any asset type.\n */\n assetType?: MediaLibraryAssetType[]\n definition: FieldDefinition\n public?: boolean\n}\n","import {MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, type MediaLibraryAssetAspectDocument} from './types'\n\n/**\n * Check whether the provided value resembles a Media Library asset aspect document.\n *\n * Note: This function does not perform a comprehensive check.\n *\n * @see validateMediaLibraryAssetAspect\n *\n * @internal\n */\nexport function isAssetAspect(\n maybeAssetAspect: unknown,\n): maybeAssetAspect is MediaLibraryAssetAspectDocument {\n return (\n typeof maybeAssetAspect === 'object' &&\n maybeAssetAspect !== null &&\n '_type' in maybeAssetAspect &&\n maybeAssetAspect._type === MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME\n )\n}\n","import {\n MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n type MediaLibraryAssetAspectDefinition,\n type MediaLibraryAssetAspectDocument,\n} from './types'\n\n/**\n * Define a Media Library asset aspect.\n *\n * Aspects can be deployed using the `sanity media deploy-aspect` CLI command.\n *\n * @public\n * @beta\n */\nexport function defineAssetAspect(\n definition: MediaLibraryAssetAspectDefinition,\n): MediaLibraryAssetAspectDocument {\n const {assetType, name} = definition\n\n return {\n _type: MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME,\n _id: `${name}`,\n definition,\n ...(assetType && {\n assetType: Array.isArray(assetType) ? assetType : [assetType],\n }),\n public: definition.public,\n }\n}\n","import {type TransactionLogMutation} from '../transactionLog/types'\nimport {\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type Mutation,\n type PatchMutation,\n} from './types'\n\n/** @internal */\nexport function isCreateMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateMutation {\n return 'create' in mutation\n}\n\n/** @internal */\nexport function isCreateIfNotExistsMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateIfNotExistsMutation {\n return 'createIfNotExists' in mutation\n}\n\n/** @internal */\nexport function isCreateOrReplaceMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateOrReplaceMutation {\n return 'createOrReplace' in mutation\n}\n\n/** @internal */\nexport function isDeleteMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is DeleteMutation {\n return 'delete' in mutation\n}\n\n/** @internal */\nexport function isPatchMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is PatchMutation {\n return 'patch' in mutation\n}\n","import {type IndexTuple, type KeyedSegment, type PathSegment} from './types'\n\nconst reKeySegment = /_key\\s*==\\s*['\"](.*)['\"]/\nconst reIndexTuple = /^\\d*:\\d*$/\n\n/** @internal */\nexport function isIndexSegment(segment: PathSegment): segment is number {\n return typeof segment === 'number' || (typeof segment === 'string' && /^\\[\\d+\\]$/.test(segment))\n}\n\n/** @internal */\nexport function isKeySegment(segment: PathSegment): segment is KeyedSegment {\n if (typeof segment === 'string') {\n return reKeySegment.test(segment.trim())\n }\n\n return typeof segment === 'object' && '_key' in segment\n}\n\n/** @internal */\nexport function isIndexTuple(segment: PathSegment): segment is IndexTuple {\n if (typeof segment === 'string' && reIndexTuple.test(segment)) {\n return true\n }\n\n if (!Array.isArray(segment) || segment.length !== 2) {\n return false\n }\n\n const [from, to] = segment\n return (typeof from === 'number' || from === '') && (typeof to === 'number' || to === '')\n}\n","import {type PortableTextObject, type PortableTextSpan, type PortableTextTextBlock} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Assert that a given object is a portable-text text-block type object\n *\n * @remarks\n * * The `markDefs` and `style` property of a block is optional.\n * * Block types can be named, so expect anything of the _type property.\n *\n * @alpha\n */\nexport function isPortableTextTextBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isRecord(value) &&\n typeof value._type === 'string' && // block types can be named, so expect anything here.\n Array.isArray(value.children) &&\n value.children.every((child) => isRecord(child)) &&\n ('markDefs' in value // optional property\n ? Array.isArray(value.markDefs) && value.markDefs.every((def) => isRecord(def))\n : true) &&\n ('style' in value ? typeof value.style === 'string' : true) // optional property\n )\n}\n\n/**\n * Assert that a given object is a portable-text span-type object\n *\n * @remarks\n * The `marks` property of a block is optional.\n *\n * @alpha\n */\nexport function isPortableTextSpan(value: unknown): value is PortableTextSpan {\n return (\n isRecord(value) &&\n value._type === 'span' &&\n typeof value.text === 'string' &&\n ('marks' in value // optional property\n ? Array.isArray(value.marks) && value.marks.every((mark) => typeof mark === 'string')\n : true)\n )\n}\n\n/**\n * Assert that a given object is a portable-text list-text-block-type object\n *\n * @remarks\n * Uses `isPortableTextTextBlock` and checks for `listItem` and `level`\n *\n * @see isPortableTextTextBlock\n *\n * @alpha\n */\nexport function isPortableTextListBlock<T = PortableTextSpan | PortableTextObject>(\n value: unknown,\n): value is PortableTextTextBlock<T> {\n return (\n isPortableTextTextBlock(value) &&\n 'listItem' in value &&\n typeof value.listItem === 'string' &&\n 'level' in value &&\n Number.isInteger(value.level)\n )\n}\n","import {type CrossDatasetReferenceSchemaType} from '../crossDatasetReference/types'\nimport {type TitledListValue} from './definition/type/common'\nimport {\n type ArraySchemaType,\n type BaseSchemaType,\n type BlockChildrenObjectField,\n type BlockListObjectField,\n type BlockSchemaType,\n type BlockStyleObjectField,\n type BooleanSchemaType,\n type DeprecatedSchemaType,\n type DeprecationConfiguration,\n type FileSchemaType,\n type ImageSchemaType,\n type NumberSchemaType,\n type ObjectSchemaType,\n type ReferenceSchemaType,\n type SchemaType,\n type SpanSchemaType,\n type StringSchemaType,\n} from './types'\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && (typeof value == 'object' || typeof value == 'function')\n}\n\n/**\n * Returns wether or not the given type is a document type\n * (eg that it was defined as `type: 'document'`)\n *\n * @param type - Schema type to test\n * @returns True if type is a document type, false otherwise\n *\n * @public\n */\nexport function isDocumentSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isObjectSchemaType(type)) {\n return false\n }\n\n let current: SchemaType | undefined = type as SchemaType\n while (current) {\n if (current.name === 'document') {\n return true\n }\n\n current = current.type\n }\n return false\n}\n\n/** @internal */\nexport function isObjectSchemaType(type: unknown): type is ObjectSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'object'\n}\n\n/** @internal */\nexport function isArraySchemaType(type: unknown): type is ArraySchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'array'\n}\n\n/** @internal */\nexport function isArrayOfBlocksSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.some((memberType) => isBlockSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfObjectsSchemaType(\n type: unknown,\n): type is ArraySchemaType<ObjectSchemaType> {\n return isArraySchemaType(type) && type.of.every((memberType) => isObjectSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfPrimitivesSchemaType(type: unknown): type is ArraySchemaType {\n return isArraySchemaType(type) && type.of.every((memberType) => isPrimitiveSchemaType(memberType))\n}\n\n/** @internal */\nexport function isArrayOfStringsSchemaType(type: unknown): type is ArraySchemaType<string> {\n return isArraySchemaType(type) && type.of.every((memberType) => isStringSchemaType(memberType))\n}\n\n/** @internal */\nexport function isBooleanSchemaType(type: unknown): type is BooleanSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'boolean'\n}\n\n/** @internal */\nexport function isStringSchemaType(type: unknown): type is StringSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isDateTimeSchemaType(type: unknown): type is StringSchemaType {\n if (!isStringSchemaType(type)) return false\n return type.name === 'datetime'\n}\n\n/** @internal */\nexport function isNumberSchemaType(type: unknown): type is NumberSchemaType {\n if (!isRecord(type)) return false\n return type.jsonType === 'number'\n}\n\n/** @internal */\nexport function isPrimitiveSchemaType(\n type: unknown,\n): type is BooleanSchemaType | StringSchemaType | NumberSchemaType {\n return isBooleanSchemaType(type) || isStringSchemaType(type) || isNumberSchemaType(type)\n}\n\n/** @internal */\nexport function isReferenceSchemaType(type: unknown): type is ReferenceSchemaType {\n return isRecord(type) && (type.name === 'reference' || isReferenceSchemaType(type.type))\n}\n\n/** @internal */\nexport function isImageSchemaType(type: unknown): type is ImageSchemaType {\n return isRecord(type) && (type.name === 'image' || isImageSchemaType(type.type))\n}\n\n/** @internal */\nexport function isFileSchemaType(type: unknown): type is FileSchemaType {\n return isRecord(type) && (type.name === 'file' || isFileSchemaType(type.type))\n}\n\n/** @internal */\nexport function isDeprecatedSchemaType<TSchemaType extends BaseSchemaType>(\n type: TSchemaType,\n): type is DeprecatedSchemaType<TSchemaType> {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isDeprecationConfiguration(type: unknown): type is DeprecationConfiguration {\n if (!isRecord(type)) return false\n return typeof type.deprecated !== 'undefined'\n}\n\n/** @internal */\nexport function isCrossDatasetReferenceSchemaType(\n type: unknown,\n): type is CrossDatasetReferenceSchemaType {\n return (\n isRecord(type) &&\n (type.name === 'crossDatasetReference' || isCrossDatasetReferenceSchemaType(type.type))\n )\n}\n\n/** @internal */\nexport function isTitledListValue(item: unknown): item is TitledListValue {\n return typeof item === 'object' && item !== null && 'title' in item && 'value' in item\n}\n\n/** @internal */\nexport function isSpanSchemaType(type: unknown): type is SpanSchemaType {\n if (!isRecord(type)) return false\n // we check for `annotations` and `decorators` instead of `type.name` because\n // schema names can technically change if someone extends the type\n return Array.isArray(type.annotations) && Array.isArray(type.decorators)\n}\n\n/** @internal */\nexport function isBlockSchemaType(type: unknown): type is BlockSchemaType {\n if (!isRecord(type)) return false\n if (!Array.isArray(type.fields)) return false\n const maybeSpanChildren = type.fields.find(isBlockChildrenObjectField)\n const maybeStyle = type.fields.find(isBlockStyleObjectField)\n const maybeList = type.fields.find(isBlockListObjectField)\n return (\n isBlockChildrenObjectField(maybeSpanChildren) &&\n isBlockStyleObjectField(maybeStyle) &&\n isBlockListObjectField(maybeList)\n )\n}\n\n/** @internal */\nexport function isBlockStyleObjectField(field: unknown): field is BlockStyleObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'style') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockListObjectField(field: unknown): field is BlockListObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'listItem') return false\n return isRecord(field.type) && field.type.jsonType === 'string'\n}\n\n/** @internal */\nexport function isBlockChildrenObjectField(field: unknown): field is BlockChildrenObjectField {\n if (!isRecord(field)) return false\n if (field.name !== 'children') return false\n if (!isArraySchemaType(field.type)) return false\n // there will always be a span item in `SpanChildrenObjectField`\n return field.type.of.some(isSpanSchemaType)\n}\n","import {\n type DefineArrayMemberDefinition,\n type DefineFieldDefinition,\n type DefineSchemaOptions,\n type DefineTypeDefinition,\n type InferSchemaDefinition,\n type MaybeWidenInitialValue,\n type MaybeWidenValidation,\n type StrictDefinition,\n} from './defineTypes'\nimport {type IntrinsicTypeName} from './definition/schemaDefinition'\nimport {type AutocompleteString} from './types'\n\n/**\n * Helper function for defining a Sanity type definition. This function does not do anything on its own;\n * it exists to check that your schema definition is correct, and help autocompletion in your IDE.\n *\n * This function will narrow the schema type down to fields and options based on the provided type-string.\n *\n * Schema types defined using `defineType` should typically be added to the Studio config under `schema.types`.\n * Defined types can be referenced by their `name`. This is referred to as a type-alias.\n *\n * When using type-aliases as `type`, `defineType` cannot know the base-type, so type-safety will be reduced.\n * If you know the base type of the type-alias, provide `defineOptions.aliasFor: <base type name>`.\n * This will enforce that the schema definition conforms with the provided type.\n *\n * By default, `defineType` only allows known properties and options.\n * Use `defineOptions.strict: false` to allow unknown properties and options.\n *\n * ### Basic usage\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [ {type: 'string', name: 'title', title: 'Title'}],\n * })\n * ```\n *\n * ### Usage with aliasFor narrowing\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * options: {\n * columns: 2\n * }\n * }, {aliasFor: 'object' })\n * ```\n *\n * ### Allow unknown properties\n *\n * ```ts\n * defineType({\n * type: 'custom-object',\n * name: 'redefined-custom-object',\n * allowsUnknownProperties: true\n * options: {\n * columns: 2,\n * allowsUnknownOptions: true\n * }\n * }, {strict: false})\n * ```\n * ### Maximum safety and best autocompletion\n *\n * Use {@link defineType}, {@link defineField} and {@link defineArrayMember}:\n *\n * ```ts\n * defineType({\n * type: 'object',\n * name: 'custom-object',\n * fields: [\n * defineField({\n * type: 'array',\n * name: 'arrayField',\n * title: 'Things',\n * of: [\n * defineArrayMember({\n * type: 'object',\n * name: 'type-name-in-array',\n * fields: [defineField({type: 'string', name: 'title', title: 'Title'})],\n * }),\n * ],\n * }),\n * ],\n * })\n * ```\n *\n * ## Note on type-safety in the current implementation\n *\n * Type-safety inside array-like properties (schema properties like `fields` and `of`) can only be guaranteed when\n * {@link defineField} and {@link defineArrayMember} are used to wrap each value in the array.\n *\n * For array-values without a function-wrapper, TypeScript will resolve to a union type of all possible properties across\n * all schema types. This result in less precise typing.\n *\n * ### Extending the Sanity Schema types\n *\n * If you want to extend the Sanity Schema types with your own properties or options to make them typesafe,\n * you can use [TypeScript declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).\n *\n * With declaration merging, properties and options will be available in a type-safe manner, and\n * `strict: false` will not be necessary.\n *\n * #### Example: Add option to StringOptions\n *\n * ```ts\n * // string.ts\n *\n * //redeclare the sanity module\n * declare module 'sanity' {\n * // redeclare StringOptions; it will be merged with StringOptions in the sanity module\n * export interface StringOptions {\n * myCustomOption?: boolean\n * }\n * }\n *\n * // the option is now part of the StringOptions type, just as if it was declared in the sanity codebase:\n * defineType({\n * type: 'string',\n * name: 'my-string',\n * options: {\n * myCustomOption: true // this does not give an error anymore\n * }\n * })\n *\n * ```\n *\n * #### Example: Add a schema definition to \"intrinsic-types\"\n *\n * ```ts\n * //my-custom-type-definition.ts\n *\n * // create a new schema definition based on object (we remove the ability to assign field, change the type add some options)\n * export type MagicallyAddedDefinition = Omit<Schema.ObjectDefinition, 'type' | 'fields'> & {\n * type: 'magically-added-type'\n * options?: {\n * sparkles?: boolean\n * }\n * }\n *\n * // redeclares sanity module so we can add interfaces props to it\n * declare module 'sanity' {\n * // redeclares IntrinsicDefinitions and adds a named definition to it\n * // it is important that the key is the same as the type in the definition ('magically-added-type')\n * export interface IntrinsicDefinitions {\n * 'magically-added-type': MagicallyAddedDefinition\n * }\n * }\n *\n * // defineType will now narrow `type: 'magically-added-type'` to `MagicallyAddedDefinition`\n * defineType({\n * type: 'magically-added-type'\n * name: 'magic',\n * options: {\n * sparkles: true // this is allowed,\n * //@ts-expect-error this is not allowed in MagicallyAddedDefinition.options\n * sparks: true\n * }\n * })\n * ```\n *\n * @param schemaDefinition - should be a valid schema type definition.\n * @param defineOptions - optional param to provide type hints for `schemaDefinition`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineType<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined = undefined,\n TStrict extends StrictDefinition = undefined,\n const TSchemaDefinition extends DefineTypeDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > = DefineTypeDefinition<TType, TName, TSelect, TPrepareValue, NoInfer<TAlias>, NoInfer<TStrict>>,\n>(\n schemaDefinition: DefineTypeDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > &\n InferSchemaDefinition<TSchemaDefinition>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): TSchemaDefinition {\n return schemaDefinition as TSchemaDefinition\n}\n\n/**\n * Define a field within a document, object, image or file definition `fields` array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * type-string.\n *\n * Using `defineField` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field-properties like `validation` and `initialValue`will also be more specific.\n *\n * See {@link defineType} for more examples.\n *\n * @param schemaField - should be a valid field type definition.\n * @param defineOptions - optional param to provide type hints for `schemaField`.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineField<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined = undefined,\n TStrict extends StrictDefinition = undefined,\n const TSchemaDefinition extends DefineFieldDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > = DefineFieldDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n >,\n>(\n schemaField: DefineFieldDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > &\n InferSchemaDefinition<TSchemaDefinition>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): TSchemaDefinition &\n MaybeWidenValidation<TSchemaDefinition> &\n MaybeWidenInitialValue<TSchemaDefinition> {\n // TODO: re-evaluate the need for this cast\n return schemaField as TSchemaDefinition &\n MaybeWidenValidation<TSchemaDefinition> &\n MaybeWidenInitialValue<TSchemaDefinition>\n}\n\n/**\n * Define an array item member type within an array definition `of`-array.\n *\n * This function will narrow the schema type down to fields and options based on the provided\n * `type` string.\n *\n * Using `defineArrayMember` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Field properties like `validation` and `initialValue` will also be more specific.\n *\n * See {@link defineType} for example usage.\n *\n * @param arrayOfSchema - should be a valid `array.of` member definition.\n * @param defineOptions - optional param to provide type hints for `arrayOfSchema`.\n *\n * @see defineType\n * @see defineField\n * @see typed\n *\n * @beta\n */\nexport function defineArrayMember<\n const TType extends IntrinsicTypeName | AutocompleteString,\n const TName extends string,\n TSelect extends Record<string, string> | undefined,\n TPrepareValue extends Record<keyof TSelect, any> | undefined,\n TAlias extends IntrinsicTypeName | undefined = undefined,\n TStrict extends StrictDefinition = undefined,\n const TSchemaDefinition extends DefineArrayMemberDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > = DefineArrayMemberDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n >,\n>(\n arrayOfSchema: DefineArrayMemberDefinition<\n TType,\n TName,\n TSelect,\n TPrepareValue,\n NoInfer<TAlias>,\n NoInfer<TStrict>\n > &\n InferSchemaDefinition<TSchemaDefinition>,\n\n defineOptions?: DefineSchemaOptions<TStrict, TAlias>,\n): TSchemaDefinition &\n MaybeWidenValidation<TSchemaDefinition> &\n MaybeWidenInitialValue<TSchemaDefinition> {\n // TODO: re-evaluate the need for this cast\n return arrayOfSchema as TSchemaDefinition &\n MaybeWidenValidation<TSchemaDefinition> &\n MaybeWidenInitialValue<TSchemaDefinition>\n}\n\n/**\n * `typed` can be used to ensure that an object conforms to an exact interface.\n *\n * It can be useful when working with `defineType` and `defineField` on occasions where a wider type with\n * custom options or properties is required.\n *\n * ## Example usage\n * ```ts\n * defineField({\n * type: 'string',\n * name: 'nestedField',\n * options: typed<StringOptions & {myCustomOption: boolean}>({\n * layout: 'radio',\n * // allowed\n * myCustomOption: true,\n * //@ts-expect-error unknownProp is not part of StringOptions & {myCustomOption: boolean}\n * unknownProp: 'not allowed in typed context',\n * }),\n * }),\n * ```\n *\n * @param input - returned directly\n *\n * @internal\n */\nexport function typed<T>(input: T): T {\n return input\n}\n","/**\n * @public\n */\nexport const searchStrategies = ['groq2024', 'groqLegacy'] as const\n\n/**\n * @public\n */\nexport type SearchStrategy = (typeof searchStrategies)[number]\n","import {searchStrategies, type SearchStrategy} from './types'\n\n/**\n * @internal\n */\nexport function isSearchStrategy(\n maybeSearchStrategy: unknown,\n): maybeSearchStrategy is SearchStrategy {\n return searchStrategies.includes(maybeSearchStrategy as SearchStrategy)\n}\n","import {isObject} from '../helpers'\nimport {type Slug} from './types'\n\n/**\n * Checks whether the given `thing` is a slug, eg an object with a `current` string property.\n *\n * @param thing - The thing to check\n * @returns True if slug, false otherwise\n * @public\n */\nexport function isSlug(thing: unknown): thing is Slug {\n return isObject(thing) && typeof thing.current === 'string'\n}\n","import {type Mutation} from '../mutations/types'\nimport {type CreateSquashedMutation, type TransactionLogMutation} from './types'\n\n/** @internal */\nexport function isCreateSquashedMutation(\n mutation: Mutation | TransactionLogMutation,\n): mutation is CreateSquashedMutation {\n return 'createSquashed' in mutation\n}\n","import {type FormNodeValidation} from './types'\n\n/** @internal */\nexport function isValidationError(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'error'} {\n return node.level === 'error'\n}\n\n/** @internal */\nexport function isValidationWarning(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'warning'} {\n return node.level === 'warning'\n}\n\n/** @internal */\nexport function isValidationInfo(\n node: FormNodeValidation,\n): node is FormNodeValidation & {level: 'info'} {\n return node.level === 'info'\n}\n"],"mappings":"AAAA,SAAgB,SAAS,KAA8C;CACrE,OAAO,OAAO,OAAQ,cAAY,OAAgB,CAAC,MAAM,QAAQ,GAAG;AACtE;;ACEA,SAAgB,YAAY,WAA4C;CACtE,OAAO,SAAS,SAAS,KAAK,OAAO,UAAU,QAAS;AAC1D;;ACDA,SAAgB,QAAQ,OAAgC;CACtD,OAAO,SAAS,KAAK,KAAK,YAAY,MAAM,KAAK,KAAK,MAAM,MAAM,KAAK,WAAW,QAAQ;AAC5F;;ACHA,SAAgB,wBACd,WACyC;CACzC,OACE,SAAS,SAAS,KAClB,OAAO,UAAU,QAAS,YAC1B,OAAO,UAAU,YAAa,YAC9B,OAAO,UAAU,cAAe;AAEpC;;ACTA,SAAgB,iBAAiB,UAA+C;CAC9E,OACE,SAAS,QAAQ,KAAK,OAAO,SAAS,OAAQ,YAAY,OAAO,SAAS,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B;;AAGA,SAAgB,iBACd,MAC8C;CAC9C,OAAO,KAAK,UAAU;AACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/types",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0-next.12",
|
|
4
4
|
"description": "Type definitions for common Sanity data structures",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vite": "^8.1.5",
|
|
46
46
|
"vitest": "^4.1.10",
|
|
47
|
-
"@repo/
|
|
48
|
-
"@repo/
|
|
49
|
-
"@repo/tsconfig": "6.
|
|
47
|
+
"@repo/tsdown.config": "6.9.0-next.12+38002e4432",
|
|
48
|
+
"@repo/test-config": "6.9.0-next.12+38002e4432",
|
|
49
|
+
"@repo/tsconfig": "6.9.0-next.12+38002e4432"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@types/react": "*"
|