mirror of
https://github.com/ritz078/transform.git
synced 2026-11-22 00:54:01 +03:00
* HTML to Pug converter (#127) * feat(pug): add HTML to pug converter * fix(pug): added package details * feat(analyze): added webpack bundle analyzer * fix(rust): handle special characters and duplicate keys (#131) * remove duplicate google tag manager (#122) * Update _app.tsx (#124) * docs: add timneutkens as a contributor (#125) * docs: update README.md * docs: update .all-contributorsrc * Upgrade Next.js to 9 (#126) * Upgrade Next.js to 9 * Add back engines key * Add globalObject Brings in suggestion from https://github.com/zeit/next.js/issues/7873#issuecomment-512795482 * Add temporary fix for window issue * fix(font): add fallback font for non mac browsers (#130) closes #129 * fix(rust): handle special characters and duplicate keys closes #97 * fix(rust): handle special chars closes #97, closes #95, closes #89, closes #62 * chore(rust): remove settings * feat(kotlin): added JSON to kotlin and json schema * fixes * fixes * fixes * fixes * fixes * added favicon * social media tags
27 lines
594 B
TypeScript
27 lines
594 B
TypeScript
import ConversionPanel from "@components/ConversionPanel";
|
|
import * as React from "react";
|
|
import { useCallback } from "react";
|
|
|
|
export default function() {
|
|
const transformer = useCallback(async ({ value }) => {
|
|
const { run } = await import("json_typegen_wasm");
|
|
return run(
|
|
"Root",
|
|
value,
|
|
JSON.stringify({
|
|
output_mode: "typescript"
|
|
})
|
|
);
|
|
}, []);
|
|
|
|
return (
|
|
<ConversionPanel
|
|
transformer={transformer}
|
|
editorTitle="JSON"
|
|
editorLanguage="json"
|
|
resultTitle="TypeScript"
|
|
resultLanguage={"typescript"}
|
|
/>
|
|
);
|
|
}
|