sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
1 lines • 1.44 kB
Source Map (JSON)
{"version":3,"file":"media-library.mjs","sources":["../src/media-library/plugin/schemas/defineVideoField.ts"],"sourcesContent":["import {defineField} from '@sanity/types'\n\nimport {type VideoDefinition} from './types'\n\n/**\n * Define a video field within a document, object, image or file definition `fields` array.\n *\n * This function will narrow the schema type down to video fields and options based on the provided\n * type-string.\n *\n * Using `defineVideoField` is optional, but should provide improved autocompletion in your IDE, when building your schema.\n * Video field-properties like `validation` and `initialValue` will also be more specific.\n *\n * Note: This video field type is designed to work specifically with the Media Library asset source.\n * Make sure you have the Media Library is enabled in your studio via sanity.config.ts.\n *\n * See {@link defineType} for similar examples.\n *\n * @param definition - should be a valid video field type definition.\n *\n * @see defineField\n * @see defineArrayMember\n * @see typed\n *\n * @beta\n */\nexport function defineVideoField(definition: Omit<VideoDefinition, 'type'>) {\n // @ts-expect-error FIXME\n return defineField({\n ...definition,\n type: 'sanity.video',\n })\n}\n"],"names":["defineVideoField","definition","defineField","type"],"mappings":";AA0BO,SAASA,iBAAiBC,YAA2C;AAE1E,SAAOC,YAAY;AAAA,IACjB,GAAGD;AAAAA,IACHE,MAAM;AAAA,EAAA,CACP;AACH;"}