bytes
bytes<
TCollectionSlug,TFieldKey,TFieldMeta>(options?):BytesField<TCollectionSlug,TFieldMeta>
Defined in: packages/core/src/fields/bytes/config.ts:42
Creates a bytes field that stores a raw binary payload (v.bytes()).
Accepts BytesFieldInput (all optional) and returns BytesField with all defaults applied.
Defaults applied:
label—""(inferred from the field key bydefineCollection)required—falsemaxSize—524_288(512 KiB)accept—""defaultValue—undefinedadmin.hidden—falseadmin.readOnly—falseadmin.position—"main"admin.width—"100%"admin.cellAlignment—"left"
Type Parameters
Section titled “Type Parameters”TCollectionSlug
Section titled “TCollectionSlug”TCollectionSlug extends string = string
TFieldKey
Section titled “TFieldKey”TFieldKey extends string = never
TFieldMeta
Section titled “TFieldMeta”TFieldMeta extends BaseFieldMeta = BaseFieldMeta
Parameters
Section titled “Parameters”options?
Section titled “options?”BytesFieldInput<TCollectionSlug, TFieldKey, TFieldMeta>
Bytes field configuration. All properties are optional.
Returns
Section titled “Returns”BytesField<TCollectionSlug, TFieldMeta>
Resolved bytes field definition with all defaults applied.
Example
Section titled “Example”import { bytes, defineCollection } from '@vexcms/core'
storageShapes: defineCollection({ fields: { payload: bytes({ label: "Payload", maxSize: 65_536 }), }})- BytesFieldInput for the full input type
- BytesField for the resolved output type