Skip to content

Commit 64fd066

Browse files
committed
add createPngUrl and createBrowserPreviewUrl
1 parent de51f21 commit 64fd066

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export function createSvgUrl(
3333
return `https://svg.tscircuit.com/?svg_type=${svgType}&code=${encodeURIComponent(base64Data)}`
3434
}
3535

36+
export function createBrowserPreviewUrl(
37+
tscircuitCode: string,
38+
view?: "pcb" | "schematic" | "3d",
39+
) {
40+
const base64Data = getCompressedBase64SnippetString(tscircuitCode)
41+
return `https://browser-preview.tscircuit.com/?view=${view}&code=${encodeURIComponent(base64Data)}`
42+
}
43+
3644
export function createPngUrl(
3745
tscircuitCode: string,
3846
view: "pcb" | "schematic" | "3d",

0 commit comments

Comments
 (0)