Skip to content

Use type mappings for inheritance#82

Merged
gzuidhof merged 1 commit into
gzuidhof:mainfrom
merlinfuchs:extend-foreign-type
Mar 10, 2025
Merged

Use type mappings for inheritance#82
gzuidhof merged 1 commit into
gzuidhof:mainfrom
merlinfuchs:extend-foreign-type

Conversation

@merlinfuchs

@merlinfuchs merlinfuchs commented Mar 8, 2025

Copy link
Copy Markdown
Contributor

This allows for extending a type from package A in package B using a config like this:

// b.go

import "github.com/gzuidhof/tygo/a"

type TypeTwo {
   a.TypeOne `tstype:",required"`
}
  - path: "github.com/gzuidhof/tygo/a"
    output_path: "../web/a.gen.ts"
  - path: "github.com/gzuidhof/tygo/b"
    output_path: "../web/b.gen.ts"
    type_mappings:
      a.TypeOne: "TypeOne"
    frontmatter: |
      import { TypeOne } from "./a.gen"

@gzuidhof

Copy link
Copy Markdown
Owner

Thank you!

@gzuidhof gzuidhof merged commit 0bfef80 into gzuidhof:main Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants