import * as __ctHelpers from "commontools"; import { cell, derive } from "commontools"; export default function TestDerive() { const value = cell(10, { type: "number" } as const satisfies __ctHelpers.JSONSchema); const prefix = cell("Value: ", { type: "string" } as const satisfies __ctHelpers.JSONSchema); const result = __ctHelpers.derive({ type: "object", properties: { value: { type: "number", asCell: true }, prefix: { type: "string", asCell: true } }, required: ["value", "prefix"] } as const satisfies __ctHelpers.JSONSchema, { type: "string" } as const satisfies __ctHelpers.JSONSchema, { value, prefix: prefix }, ({ value: v, prefix }) => `${prefix.get()}${v}`); return result; } // @ts-ignore: Internals function h(...args: any[]) { return __ctHelpers.h.apply(null, args); } // @ts-ignore: Internals h.fragment = __ctHelpers.h.fragment;