Documentation
¶
Overview ¶
Package tscode is the TypeScript/Vue backend for `sf code`. Extraction is line/block-based (there is no good pure-Go TS parser), so it is deliberately approximate but covers what a structural read needs: imports, top-level declarations, interface/type/enum members, and — for Vue SFCs — props, emits, models, the stores and API calls used, and the components rendered.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TSFile ¶
type TSFile struct {
File string `json:"file"`
Lang string `json:"lang"` // ts | vue
Component string `json:"component,omitempty"` // .vue only
Imports []string `json:"imports,omitempty"` // module specifiers
Props []string `json:"props,omitempty"` // .vue defineProps keys
Emits []string `json:"emits,omitempty"` // .vue defineEmits keys
Models []string `json:"models,omitempty"` // .vue defineModel names
Stores []string `json:"stores,omitempty"` // .vue composables/stores used (useXStore)
APICalls []string `json:"api_calls,omitempty"` // .vue client.* / axios.* calls
Components []string `json:"components,omitempty"` // .vue components used in <template>
Types []TSType `json:"types,omitempty"` // interface/type/enum with members
Symbols []TSSymbol `json:"symbols"` // const | function | class
}
TSFile is the structural summary of a TypeScript / Vue source file.
func (*TSFile) Brief ¶ added in v0.6.0
func (f *TSFile) Brief()
Brief collapses field/value-level detail for a signature-only view: interface and type-alias bodies drop their member list — the object-shape equivalent of a Go struct's fields — while enum stays (its Members is already just the bare case names, no more detail than a Go const block's names). Symbols carry no member/signature detail to begin with (tscode is line-based and never captured one), so there's nothing left to cut there.