TypeScript code to image

Turn a TypeScript snippet into a polished image with the types intact and readable. Generics, unions, and inferred return values all get proper syntax highlighting, so the shape of your code reads clearly at a glance. It is built to run in your browser, so even code from a private repo stays on your machine.

What you can do with a TypeScript snippet

  • Show a typed API surface in documentation
  • Explain a generic or a discriminated union in a thread
  • Paste a type-safe pattern into a code review write-up

A TypeScript example

Here it is in the Nord theme — one of dozens. Open it in the editor to try others, tweak the background, and export, or paste your own TypeScript in its place.

result.ts
1type Result<T> =
2 | {ok: true; value: T}
3 | {ok: false; error: string};
4
5const ok = <T>(value: T): Result<T> => ({ok: true, value});

Your code stays on your device

gilika is built to render your TypeScript into an image right in your browser, so the snippet never has to be uploaded to a server. See exactly how.