Initial commit: Receipt Studio desktop application

This commit is contained in:
fuenmao
2026-10-19 11:09:09 +08:00
commit 2caac3c31f
77 changed files with 9846 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { randomUUID } from 'node:crypto'
// Keep print content in memory. The renderer receives a short local URL even when stamps are large.
export class PrintDocumentStore {
private documents=new Map<string,string>()
publish(html:string):{url:string;dispose:()=>void}{
const url='receipt://print/'+randomUUID()+'/index.html'
this.documents.set(url,html)
return {url,dispose:()=>{this.documents.delete(url)}}
}
read(url:string):string|undefined{return this.documents.get(url)}
}
export const printDocuments=new PrintDocumentStore()