source_json.ts

Declarations
#

Metadata types for library source code analysis.

These types represent the structure of src/lib/ exports, extracted at build time via TypeScript compiler analysis. Used for generating API documentation and enabling code search.

Hierarchy: SourceJson → ModuleJson → DeclarationJson

9 declarations

view source

ComponentPropInfo
#

source_json.ts view source

ZodObject<{ name: ZodString; type: ZodString; optional: ZodOptional<ZodBoolean>; description: ZodOptional<ZodString>; default_value: ZodOptional<...>; bindable: ZodOptional<...>; }, $loose>

Component prop information for Svelte components.

Kept distinct from ParameterInfo despite structural similarity. Component props are named attributes with different semantics: no positional order when passing (<Foo {a} {b} /> = <Foo {b} {a} />), support two-way binding via $bindable rune.

declaration_generate_import
#

source_json.ts view source

(declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "variable" | "class" | "constructor" | "component" | "json" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }, module_path: string, library_name: string): string

Generate TypeScript import statement for a declaration.

declaration

type { [x: string]: unknown; name: string; kind: "function" | "type" | "variable" | "class" | "constructor" | "component" | "json" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }

module_path

type string

library_name

type string

returns

string

examples

Example 1

declaration_get_display_name
#

source_json.ts view source

(declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "variable" | "class" | "constructor" | "component" | "json" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }): string

Format declaration name with generic parameters for display.

declaration

type { [x: string]: unknown; name: string; kind: "function" | "type" | "variable" | "class" | "constructor" | "component" | "json" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }

returns

string

examples

Example 1

DeclarationJson
#

source_json.ts view source

ZodObject<{ name: ZodString; kind: ZodEnum<{ function: "function"; type: "type"; variable: "variable"; class: "class"; constructor: "constructor"; component: "component"; json: "json"; css: "css"; }>; ... 19 more ...; alias_of: ZodOptional<...>; }, $loose>

Metadata for an exported declaration (function, type, class, component, etc.).

Extracted from TypeScript source and JSDoc/TSDoc comments at build time.

DeclarationKind
#

source_json.ts view source

ZodEnum<{ function: "function"; type: "type"; variable: "variable"; class: "class"; constructor: "constructor"; component: "component"; json: "json"; css: "css"; }>

The kind of exported declaration.

GenericParamInfo
#

source_json.ts view source

ZodObject<{ name: ZodString; constraint: ZodOptional<ZodString>; default_type: ZodOptional<ZodString>; }, $loose>

Generic type parameter information.

ModuleJson
#

source_json.ts view source

ZodObject<{ path: ZodString; declarations: ZodOptional<ZodArray<ZodObject<{ name: ZodString; kind: ZodEnum<{ function: "function"; type: "type"; variable: "variable"; class: "class"; constructor: "constructor"; component: "component"; json: "json"; css: "css"; }>; ... 19 more ...; alias_of: ZodOptional<...>; }, $loo...

A source file in src/lib/ with its exported declarations.

ParameterInfo
#

source_json.ts view source

ZodObject<{ name: ZodString; type: ZodString; optional: ZodOptional<ZodBoolean>; description: ZodOptional<ZodString>; default_value: ZodOptional<...>; }, $loose>

Parameter information for functions and methods.

Kept distinct from ComponentPropInfo despite structural similarity. Function parameters form a tuple with positional semantics: calling order matters (fn(a, b) vs fn(b, a)), may include rest parameters and destructuring patterns.

SourceJson
#

source_json.ts view source

ZodObject<{ name: ZodString; version: ZodString; modules: ZodOptional<ZodArray<ZodObject<{ path: ZodString; declarations: ZodOptional<ZodArray<ZodObject<{ name: ZodString; kind: ZodEnum<{ function: "function"; ... 6 more ...; css: "css"; }>; ... 19 more ...; alias_of: ZodOptional<...>; }, $loose>>>; module_comment: ...

Metadata for a library's src/lib/ exports.