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 ApplyDeclarationAdapterFiles(catalog *Catalog, sources []declarationadapterhost.Source) 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 LoadWithDeclarationAdapters(root string, dependencies map[string]string, ...) (*Catalog, error)
- type Export
- type Field
- type Module
- type ResultBridge
- type Type
Constants ¶
const ( // FormatVersion belongs only to the generated TypeScript native type cache. // Package-owned declaration adapters use their independent protocol version. FormatVersion = 3 )
Variables ¶
This section is empty.
Functions ¶
func ApplyDeclarationAdapterFiles ¶ added in v0.3.16
func ApplyDeclarationAdapterFiles(catalog *Catalog, sources []declarationadapterhost.Source) error
ApplyDeclarationAdapterFiles overlays package-owned semantic declarations on top of declarations inferred by the TypeScript adapter from .d.ts files. The extension host validates the shared data protocol; this adapter validates the remaining TypeScript-specific bridge kinds and dependency ownership.
Types ¶
type Catalog ¶
type Catalog struct {
FormatVersion int `json:"formatVersion"`
TypeScriptVersion string `json:"typescriptVersion,omitempty"`
Dependencies map[string]string `json:"dependencies"`
DeclarationAdapterChecksums map[string]string `json:"declarationAdapterChecksums,omitempty"`
Modules map[string]Module `json:"modules"`
}
func GenerateModules ¶
func LoadWithDeclarationAdapters ¶ added in v0.3.16
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 ResultBridge ¶ added in v0.3.0
ResultBridge describes a native callback boundary that resolves its success value through a Promise and rejects with the standard Result error payload.
type Type ¶
type Type struct {
Kind string `json:"kind"`
Name string `json:"name,omitempty"`
Args []Type `json:"args,omitempty"`
ResultBridge *ResultBridge `json:"resultBridge,omitempty"`
Nullable bool `json:"nullable,omitempty"`
Readonly bool `json:"readonly,omitempty"`
}
Type is the stable on-disk form of a target-independent semantic type.