ts

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decls

func Decls(dir, typename, prefix, outfile string, opts ...fab.FilesOpt) (fab.Target, error)

Decls uses tsdecls.Write to write TypeScript type declarations to `outfile` based on the Go `typename` found in the package in `dir`.

Decls is implemented in terms of fab.Files. Any opts are passed through to that function.

It is JSON-encodable (and therefore usable as the subtarget in fab.Files).

A Decls target may be specified in YAML using the tag !ts.Decls, which introduces a mapping whose fields are:

  • Dir: the directory containing a Go package
  • Type: the Go type to examine for producing TypeScript declarations
  • Prefix: the path prefix for the generated POST URL
  • Out: the output file
  • Autoclean: a boolean indicating whether the output file should be added to the "autoclean registry." See fab.Autoclean for more about this feature.

Both Dir and Out are either absolute or relative to the directory containing the YAML file.

func MustDecls added in v0.42.0

func MustDecls(dir, typename, prefix, outfile string) fab.Target

MustDecls is the same as Decls but panics on error.

Types

This section is empty.

Directories

Path Synopsis
_testdata

Jump to

Keyboard shortcuts

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