Debian Codegraph @

test/main.go

raw symbols SCIP
1 package main
2
3 import (
4 "log"
5 "os"
6
7 "github.com/pocketbase/tygoja"
8 )
9
10 func main() {
11 gen := tygoja.New(tygoja.Config{
12 Packages: map[string][]string{
13 "github.com/pocketbase/tygoja/test/a": {"*"},
14 "github.com/pocketbase/tygoja/test/b": {"*"},
15 "github.com/pocketbase/tygoja/test/c": {"Example2", "Handler"},
16 },
17 Heading: `declare var $app: c.Handler;`,
18 WithPackageFunctions: true,
19 // enable if you want to be able to import them
20 // StartModifier: "export",
21 })
22
23 result, err := gen.Generate()
24 if err != nil {
25 log.Fatal(err)
26 }
27
28 if err := os.WriteFile("./types.d.ts", []byte(result), 0644); err != nil {
29 log.Fatal(err)
30 }
31
32 // run `npx typedoc` to generate HTML docs from the above declarations
33 }