Skip to content

Commit 06eaed9

Browse files
committed
test
1 parent 38eaf58 commit 06eaed9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/abstract-visuals-example/src/app/dynamic-image.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import FileSaver from "file-saver";
44
import { compileDynamicImage, renderDynamicImage } from "../../../abstract-image/src/dynamic-image/dynamic-image.js";
55
import { createSVG, ReactSvg } from "../../../abstract-image/src/exporters/index.js";
66
import { generateDataSchema } from "../../../abstract-image/src/dynamic-image/utils.js";
7-
import { PropertySchema } from "jsxpression";
7+
import { generateTypeScriptDefinitions, PropertySchema } from "jsxpression";
88
import { FunctionSchema } from "../../../jsxpression/src/schema.js";
99

1010
export function DynamicImage({}: {}): React.JSX.Element {
@@ -49,7 +49,11 @@ export function DynamicImage({}: {}): React.JSX.Element {
4949
test: (str: string): string => `0x${str.length.toString(16)}`,
5050
}
5151

52+
const test = generateTypeScriptDefinitions(schema);
53+
console.log("test", test);
54+
5255
const jsString = compileDynamicImage(template, schema, funcSchema, false);
56+
console.log("jsString", jsString);
5357
const rendered = jsString.type === "Ok" ? renderDynamicImage(jsString.value, dataParsed, functions) : undefined;
5458
return (
5559
<div

packages/jsxpression/src/codegen/schema/data-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Schema } from "../../schema.js";
22
import { mapSchemaTypeToTypeScript } from "./utils.js";
33

44
export function declareDataTypes(schema: Schema): string {
5-
let output = `declare global {\n`;
5+
let output = `declare global { //data \n`;
66

77
if (schema.data) {
88
Object.entries(schema.data).forEach(([dataKey, dataSchema]) => {

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)