mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-03 03:27:03 +00:00
feat(export): add book-to-Typst source generator
This commit is contained in:
1 parent
e21db2be5d
commit
f939674794
2 files changed
+127
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export interface ImageInput {
|
||||
path: string;
|
||||
data: string;
|
||||
}
|
||||
|
||||
export async function compilePdf(source: string, images: ImageInput[] = []): Promise<Uint8Array> {
|
||||
const buffer = await invoke<ArrayBuffer>("compile_pdf", { source, images });
|
||||
return new Uint8Array(buffer);
|
||||
}
|
||||
Reference in new issue
Block a user