1.0.0 • Published 9 months ago

typst-ts-solid v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

@myriaddreamin/typst.solid

Usage

import { TypstDocument } from "@myriaddreamin/typst.solid";
import { createResource } from "solid-js";

export const App = (artifact: Uint8Array) => {
  const getArtifactData = async () => {
    const response = await fetch(
      "http://localhost:3000/readme.artifact.sir.in"
    ).then((response) => response.arrayBuffer());

    return new Uint8Array(response);
  };
  const [vec] = createResource(getArtifactData);

  return (
    <div>
      <h1>Demo: Embed Your Typst Document in Solid </h1>
      <TypstDocument fill="#343541" artifact={vec()} />
    </div>
  );
};

Documentation

1.0.0

9 months ago