Documentation
¶
Overview ¶
Package nativepackage owns cached type information derived from native target-language packages. The cache is generated by trb install and keeps native declaration parsing out of ordinary compiler and language-service requests.
Index ¶
- Constants
- func ApplyProviderFiles(catalog *Catalog, sources []ProviderSource) error
- func IndexPath(root string) string
- func Write(root string, catalog *Catalog) error
- type Catalog
- func Empty(dependencies map[string]string) *Catalog
- func Generate(root, packageManager string, dependencies map[string]string) (*Catalog, error)
- func GenerateModules(root, packageManager string, dependencies map[string]string, ...) (*Catalog, error)
- func Load(root string, dependencies map[string]string) (*Catalog, error)
- func LoadWithProviders(root string, dependencies map[string]string, providers []ProviderSource) (*Catalog, error)
- type Export
- type Field
- type Module
- type Provider
- type ProviderSource
- type Type
Constants ¶
View Source
const (
FormatVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
func ApplyProviderFiles ¶
func ApplyProviderFiles(catalog *Catalog, sources []ProviderSource) error
ApplyProviderFiles overlays declarative package-owned corrections on top of declarations inferred from .d.ts files. Two providers cannot redefine the same symbol, which keeps the result independent from package traversal order.
Types ¶
type Catalog ¶
type Catalog struct {
FormatVersion int `json:"formatVersion"`
TypeScriptVersion string `json:"typescriptVersion,omitempty"`
Dependencies map[string]string `json:"dependencies"`
ProviderChecksums map[string]string `json:"providerChecksums,omitempty"`
Modules map[string]Module `json:"modules"`
}
func GenerateModules ¶
func LoadWithProviders ¶
type Export ¶
type Export struct {
Kind string `json:"kind"`
Type Type `json:"type"`
AliasTarget *Type `json:"aliasTarget,omitempty"`
Parameters []Type `json:"parameters,omitempty"`
Required int `json:"required,omitempty"`
Variadic bool `json:"variadic,omitempty"`
TypeParameters []string `json:"typeParameters,omitempty"`
Fields []Field `json:"fields,omitempty"`
Members map[string]Export `json:"members,omitempty"`
UnsupportedFields map[string]string `json:"unsupportedFields,omitempty"`
}
type Provider ¶
type Provider struct {
FormatVersion int `json:"formatVersion"`
Modules map[string]Module `json:"modules"`
}
func ReadProvider ¶
type ProviderSource ¶
type Type ¶
type Type struct {
Kind string `json:"kind"`
Name string `json:"name,omitempty"`
Args []Type `json:"args,omitempty"`
Fails *Type `json:"fails,omitempty"`
EffectBridge string `json:"effectBridge,omitempty"`
Nullable bool `json:"nullable,omitempty"`
Readonly bool `json:"readonly,omitempty"`
}
Type is the stable on-disk form of a target-independent semantic type.
func FromSemantic ¶
Click to show internal directories.
Click to hide internal directories.