typegen

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	InputDir  string
	OutputDir string
	Options   *Options
}

func NewGenerator

func NewGenerator(inputDir, outputDir string, opts *Options) *Generator

Creates a new Generator

func (*Generator) Generate

func (g *Generator) Generate() error

Generates the TypeScript type definitions

type NamingConvention

type NamingConvention string
const (
	NamingConventionCamelCase NamingConvention = "camelCase"
	NamingConventionSnakeCase NamingConvention = "snake_case"
)

type Options

type Options struct {
	UseInterface     bool
	UseReadonly      bool
	OutputFileName   string
	NamingConvention NamingConvention
}

type Property

type Property struct {
	Name     string
	Type     string
	Required bool
	Tags     map[string]string
}

type TypeDefinition

type TypeDefinition struct {
	Name       string
	Package    string
	Properties []Property
	IsExported bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL