import { createObjectField } from './fields/field-types/object'; import type { BaseField, MonkkoField, ObjectField } from './types'; /** * Defines an embedded sub-document schema for reuse in other schemas. * Returns a function that, given optional field settings, produces an ObjectField. */ export function defineSubDocument>( schema: T ): (opts?: BaseField) => ObjectField { return (opts) => createObjectField(schema, opts); }