function __cfHardenFn(fn: Function) { Object.freeze(fn); const prototype = fn.prototype; if (prototype && typeof prototype === "object") { Object.freeze(prototype); } return fn; } import { __cfHelpers } from "commonfabric"; import { type FabricBytes, pattern, UI } from "commonfabric"; const define = undefined; const runtimeDeps = undefined; const __cfAmdHooks = undefined; // FIXTURE: fabric-special-object-brand // Verifies: a field authored against a `FabricPrimitive` class emits its // `FabricPrimitive` schema type (`{ type: "FabricBytes" }`, matched by // prototype at validation time), and the `FabricSpecialObject` nominal brand // -- a type-system-only key -- never reaches a generated schema. export default pattern((state: { blob: FabricBytes; }) => { return { [UI]:
{state.key("blob")}
, }; }, { type: "object", properties: { blob: { type: "FabricBytes" } }, required: ["blob"] } as const satisfies __cfHelpers.JSONSchema, { type: "object", properties: { $UI: { $ref: "#/$defs/JSXElement" } }, required: ["$UI"], $defs: { JSXElement: { anyOf: [{ $ref: "https://commonfabric.org/schemas/vnode.json" }, { $ref: "#/$defs/UIRenderable" }, { type: "object", properties: {} }] }, UIRenderable: { type: "object", properties: { $UI: { $ref: "https://commonfabric.org/schemas/vnode.json" } }, required: ["$UI"] } } } as const satisfies __cfHelpers.JSONSchema); // @ts-ignore: Internals function h(...args: any[]) { return __cfHelpers.h.apply(null, args); } __cfHardenFn(h);