import { controlsToFormSchema, controlsToSectionFormSchemas, controlsToSidebarPanels, getControlDefaults, useControlSchema, type ControlSchemaOptions, type UseControlSchemaReturn, } from '../composables/useControlSchema' import { cloneControlSchema, cloneSchemaMap, } from './controlSchemaClone' import { mergeTemplateControlSchemas, } from './controlSchemaMerge' import { describeControlTarget, resolveControlSchemaTarget, } from './controlSchemaTargets' import { presetControlSchemas, } from './presetControlSchemas' import { templateControlSchemas, } from './templateControlSchemas' import type { TemplateId, TemplatePresetId, } from './types' import type { BioTemplateControlSchema, BioTemplateControlTarget, } from './controlSchemaTypes' export type { BioTemplateControlSchema, BioTemplateControlTarget, } from './controlSchemaTypes' /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function listBioTemplateControlSchemas(): Record { return cloneSchemaMap(templateControlSchemas) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function listBioTemplatePresetControlSchemas(): Record { return cloneSchemaMap(presetControlSchemas) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function getBioTemplateControlSchema( target: BioTemplateControlTarget ): BioTemplateControlSchema | undefined { const resolved = resolveControlSchemaTarget(target) if (!resolved) return undefined if (resolved.kind === 'template') { return cloneControlSchema(templateControlSchemas[resolved.name]) } if (resolved.kind === 'preset') { return cloneControlSchema(presetControlSchemas[resolved.name]) } return mergeTemplateControlSchemas(resolved.templates, templateControlSchemas) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function requireBioTemplateControlSchema( target: BioTemplateControlTarget ): BioTemplateControlSchema { const schema = getBioTemplateControlSchema(target) if (!schema) { throw new Error(`No built-in control schema found for '${describeControlTarget(target)}'.`) } return schema } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function createBioTemplateControlToolkit( target: BioTemplateControlTarget, options: ControlSchemaOptions = {} ): UseControlSchemaReturn { return useControlSchema(requireBioTemplateControlSchema(target), options) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function bioTemplateControlsToFormSchema( target: BioTemplateControlTarget, options: ControlSchemaOptions = {} ) { return controlsToFormSchema(requireBioTemplateControlSchema(target), options) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function bioTemplateControlsToSidebarPanels( target: BioTemplateControlTarget, options: ControlSchemaOptions = {} ) { return controlsToSidebarPanels(requireBioTemplateControlSchema(target), options) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function bioTemplateControlsToSectionFormSchemas( target: BioTemplateControlTarget, options: ControlSchemaOptions = {} ) { return controlsToSectionFormSchemas(requireBioTemplateControlSchema(target), options) } /** @deprecated Scheduled for removal from the core SDK in MINT 1.4; the biology templates move to a dedicated package or the owning plugins. */ export function getBioTemplateControlDefaults(target: BioTemplateControlTarget) { return getControlDefaults(requireBioTemplateControlSchema(target)) }