types.ts

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: ModuleJson → DeclarationJson (discriminated union on kind) → MemberJson (discriminated union on kind)

Input/output split

The schemas are fuz_schema schemas. Array fields default to [] and boolean flags to false (s.with_default_fn, s.with_default), so they're optional in serialized JSON (compact) but guaranteed after parsing. Input types (ModuleJsonInput, DeclarationJsonInput, ComponentPropJsonInput) accept the omitted fields; output types (ModuleJson, DeclarationJson, ComponentPropJson) guarantee them. Use compactReplacer (in declaration-helpers.ts) with JSON.stringify for compact output, and parseModuleJson (or parseAnalyzeResult in analyze-core.ts) to validate and restore the defaults — the parse helpers are the stable entry points, independent of the schema library.

Array defaults are factories (s.with_default_fn(…, () => [])): s.with_default returns its value as-is, so a literal [] would be one array shared by every parse.

Discriminated union

DeclarationJson is an s.variant on kind over these variants: FunctionDeclarationJson, ClassDeclarationJson, InterfaceDeclarationJson, TypeDeclarationJson, VariableDeclarationJson, EnumDeclarationJson, ComponentDeclarationJson, SnippetDeclarationJson, NamespaceDeclarationJson. Each variant has only the fields relevant to that kind, enforced by s.object. Use isKind (in declaration-helpers.ts) to narrow.

MemberJson is similarly an s.variant on kind, over FunctionMemberJson, VariableMemberJson, ConstructorMemberJson. Each variant has only the fields relevant to that member kind.

Internal analysis code that constructs declarations incrementally uses DeclarationJsonBuild — a permissive interface with all fields optional. Validation at the parseModuleJson boundary enforces variant correctness.

see also

  • ``declaration-helpers.ts`` for display formatting and type narrowing utilities

  • ``analyze.ts`` for the main analysis entry points

  • ``tsdoc.ts`` for JSDoc/TSDoc extraction into these types

  • ``postprocess.ts`` for post-processing (mergeReExports, findDuplicates)

view source

Declarations
#

51 declarations

ClassDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

ClassDeclarationJson import {ClassDeclarationJson} from 'svelte-docinfo/types.js';

A class declaration. Has members, extends, implements.

inheritance

extends: s.SchemaStrictObjectOutput< typeof ClassDeclarationJsonEntries >

kind

type "class"

extends

Extended base class — 0 or 1 entries (TypeScript allows only one base). An array so every heritage field (extends, implements, externalTypes, InterfaceDeclarationJson.extends) shares one shape; consumers iterate heritage uniformly instead of branching on kind.

Verbatim text of this declaration's own heritage clause (as is implements), so it is spelled as this module wrote it and resolves in its scope — a local rename stays the local name, where externalTypes resolves renames because its walk crosses modules.

type string[]

see also

  • ``implements`` (this variant), InterfaceDeclarationJson.extends for the other verbatim heritage fields, externalTypes (this variant) for the resolved external reach.

externalTypes

External types the extends chain reaches whose contributions members never enumerates — the class counterpart of InterfaceDeclarationJson.externalTypes, descending through local base classes. implements contributes nothing: an implemented interface adds no members, the class declares its own.

Entry normalization (rename resolution, type-parameter substitution, text-dedupe, source order) matches TypeDeclarationJson.externalTypes. A direct external base makes this textually equal to extends; consumers dedupe at render time.

type string[]

implements

Implemented interfaces.

type string[]

members

Class members: methods, properties, constructors, getters/setters — own members only, inherited members excluded whatever their origin. Source order, except accessors (getter/setter pairs merged by name), which follow every other member.

type (FunctionMemberJson | VariableMemberJson | ConstructorMemberJson)[]

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

ClassDeclarationJsonInput
#

types.ts view source

ClassDeclarationJsonInput import type {ClassDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input ClassDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ClassDeclarationJsonEntries >

kind

type "class"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

extends?

Extended base class — 0 or 1 entries (TypeScript allows only one base). An array so every heritage field (extends, implements, externalTypes, InterfaceDeclarationJson.extends) shares one shape; consumers iterate heritage uniformly instead of branching on kind.

Verbatim text of this declaration's own heritage clause (as is implements), so it is spelled as this module wrote it and resolves in its scope — a local rename stays the local name, where externalTypes resolves renames because its walk crosses modules.

type string[]

see also

  • ``implements`` (this variant), InterfaceDeclarationJson.extends for the other verbatim heritage fields, externalTypes (this variant) for the resolved external reach.

externalTypes?

External types the extends chain reaches whose contributions members never enumerates — the class counterpart of InterfaceDeclarationJson.externalTypes, descending through local base classes. implements contributes nothing: an implemented interface adds no members, the class declares its own.

Entry normalization (rename resolution, type-parameter substitution, text-dedupe, source order) matches TypeDeclarationJson.externalTypes. A direct external base makes this textually equal to extends; consumers dedupe at render time.

type string[]

implements?

Implemented interfaces.

type string[]

members?

Class members: methods, properties, constructors, getters/setters — own members only, inherited members excluded whatever their origin. Source order, except accessors (getter/setter pairs merged by name), which follow every other member.

type (FunctionMemberJsonInput | VariableMemberJsonInput | ConstructorMemberJsonInput)[]

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

ComponentCssPropertyJson
#

types.ts view source

value + type

also exported from index.ts

ComponentCssPropertyJson import {ComponentCssPropertyJson} from 'svelte-docinfo/types.js';

A CSS custom property in a Svelte component's styling API: one a consumer sets on the component (<A --a_color="red" />) or on an ancestor, read by the component's styles.

Maps onto a Custom Elements Manifest cssProperties entry field for field (name, description, syntax, default); fallback, sourceLine, and documented have no CEM counterpart.

inheritance

extends: s.SchemaStrictObjectOutput< typeof ComponentCssPropertyJsonEntries >

see also

  • ``ComponentDeclarationJson.cssCustomProperties`` for which reads count

name

The custom property's name as written, -- included (--a_color); case-sensitive, as in CSS.

type string

sourceLine

1-based line in the original .svelte source of the property's first var() read, or for a documented property the component never reads, of its @cssprop tag.

type number

documented

Whether a @cssprop tag in the component's doc comment documents the property, as opposed to the fallback-read heuristic (or an @property rule) finding it alone. A consumer can list only the documented entries when a component has any, dropping the global tokens the heuristic also catches.

type boolean

description?

The @cssprop tag's description, raw like docComment. Only on a documented entry.

type string

syntax?

The property's value syntax, verbatim, unvalidated: the @cssprop tag's braced syntax (@cssprop {<color>} --a gives <color>), else the syntax descriptor of an @property rule for the name in the component's style, its quotes stripped (syntax: '<color>' gives <color>).

type string

fallback?

What the style gives the property when a consumer doesn't set it: the initial-value of an @property rule for the name in the component's style (a registered property is never unset, so its initial value applies whatever a read falls back to), else the fallback of the first var() read with one, the verbatim source text after the comma, trimmed, comments included (var(--a, var(--b, 1px)) gives var(--b, 1px)). Empty for var(--a,), a fallback of nothing. Absent for a documented property no read gives a fallback. Code fact only; the tag's claim is default, and cssprop_default_mismatch warns when the two disagree.

type string

default?

The @cssprop tag's bracketed default (@cssprop [--a=1px] gives 1px), verbatim and trimmed. Only on a documented entry. The author's claim beside fallback, the style's fact; a renderer wanting one value takes default ?? fallback.

type string

ComponentCssPropertyJsonInput
#

types.ts view source

ComponentCssPropertyJsonInput import type {ComponentCssPropertyJsonInput} from 'svelte-docinfo/types.js';

The input ComponentCssPropertyJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ComponentCssPropertyJsonEntries >

name

The custom property's name as written, -- included (--a_color); case-sensitive, as in CSS.

type string

sourceLine

1-based line in the original .svelte source of the property's first var() read, or for a documented property the component never reads, of its @cssprop tag.

type number

description?

The @cssprop tag's description, raw like docComment. Only on a documented entry.

type string

syntax?

The property's value syntax, verbatim, unvalidated: the @cssprop tag's braced syntax (@cssprop {<color>} --a gives <color>), else the syntax descriptor of an @property rule for the name in the component's style, its quotes stripped (syntax: '<color>' gives <color>).

type string

fallback?

What the style gives the property when a consumer doesn't set it: the initial-value of an @property rule for the name in the component's style (a registered property is never unset, so its initial value applies whatever a read falls back to), else the fallback of the first var() read with one, the verbatim source text after the comma, trimmed, comments included (var(--a, var(--b, 1px)) gives var(--b, 1px)). Empty for var(--a,), a fallback of nothing. Absent for a documented property no read gives a fallback. Code fact only; the tag's claim is default, and cssprop_default_mismatch warns when the two disagree.

type string

default?

The @cssprop tag's bracketed default (@cssprop [--a=1px] gives 1px), verbatim and trimmed. Only on a documented entry. The author's claim beside fallback, the style's fact; a renderer wanting one value takes default ?? fallback.

type string

documented?

Whether a @cssprop tag in the component's doc comment documents the property, as opposed to the fallback-read heuristic (or an @property rule) finding it alone. A consumer can list only the documented entries when a component has any, dropping the global tokens the heuristic also catches.

type boolean

ComponentDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

ComponentDeclarationJson import {ComponentDeclarationJson} from 'svelte-docinfo/types.js';

A Svelte component declaration. Has props, externalTypes, acceptsChildren, cssCustomProperties.

inheritance

extends: s.SchemaStrictObjectOutput< typeof ComponentDeclarationJsonEntries >

kind

type "component"

externalTypes

External types whose properties are filtered out of props — the attribute bags a component forwards, such as HTMLButtonAttributes or SvelteHTMLElements['button']. A bag stays listed when some of its properties are documented anyway because the $props() destructuring names them (see props).

Covers every way props compose them: an intersection or union branch, a bare or indexed-access annotation, and interface Props extends Bag (directly or through a local base). Entries carry the written form with the same normalizations as TypeDeclarationJson.externalTypes: import renames at the definition site resolve to the exported name, and a type parameter bound inside the descent substitutes its written argument — interface A<T> extends HTMLAttributes<T> reached via `Props extends A<HTMLDivElement> records HTMLAttributes<HTMLDivElement>`. The component's *own* generics stay in scope and emit as written (HTMLAttributes<T> beside the genericParams documenting T). Each distinct bag appears once, in source order; a local name is used only when it hides a definition the walk cannot traverse (a mapped or conditional type). Names carry no module, so two distinct bags sharing an exported name collapse to one entry.

type string[]

see also

  • ``TypeDeclarationJson.externalTypes`` for the full entry contract, InterfaceDeclarationJson.externalTypes for the field on the props interface itself. Field shapes mirror TS syntax.

props

Svelte component props, in source order.

Properties an external type contributes are left out (externalTypes names their bags), except the ones the $props() destructuring names: type in let {type = 'button', ...rest}: HTMLButtonAttributes = $props() is documented with the external declaration's type and JSDoc. Renamed (class: className) and nested (a: {b}) elements name their prop; the rest element names nothing, and a name the props type has only through an index signature isn't admitted. Admitted props follow the others, in destructuring order, since their declaration position is in a package.

type ComponentPropJson[]

acceptsChildren

Whether the component accepts children: an explicit or inherited Snippet-typed children prop, implicit template usage, or a default slot (<slot /> or a declared $$Slots) in a legacy component, one svelte2tsx reads as runes-less. A runes component's <slot /> doesn't set it, and neither does a named slot alone.

type boolean

cssCustomProperties

The component's styling API: the CSS custom properties its styles read with a fallback (var(--a, 1px)), the pattern Svelte's own docs give for a component's styling hooks, or read bare and register with @property, and leave for a consumer to set, plus the ones its doc comment documents with @cssprop. One entry per name: the documented ones first, in tag order, then the rest in the order of each name's first read.

A read counts when it's an outermost var(), not one in another var()'s fallback: var(--a, var(--b)) reads --a, with --b the fallback chain's global token. Reads anywhere in the top-level <style> count, in :global(…) rules, nested rules, @media/@container/@supports blocks, and keyframes alike, and so do reads in the static text of the markup's style attributes and style: directives on elements and style and --a attributes on child components (<Child --a="var(--b, 1px)" /> reads --b). A name drops out when the component sets it itself: a --a: … declaration in its <style>, a style:--a directive, or a --a: in a style attribute on one of its elements. A --a or style attribute on a child component sets nothing, since it styles the child. A name read only without a fallback isn't listed, unless the style registers it with @property --a {…}, whose syntax and initial-value the entry carries (the last rule for a name wins; inherits isn't modeled); a registered name nothing reads isn't listed either: bare reads are mostly global design tokens. A global token read with a fallback is listed too; the author's fix is to drop the fallback or to document the property with @cssprop. There's deliberately no option to filter names at analysis: the output keeps every read, and a consumer that wants less filters it (to documented entries, say). Names are case-sensitive, as in CSS.

@cssprop --a - Description 1 (or @cssproperty) in the component's doc comment, the source that wins docComment (the in-script JSDoc over the HTML @component comment, the losing one's tags ignored), lists --a whatever the heuristic makes of it, documented: true, with the tag's description, syntax, and default. It merges with the read: a bare read, one nested in another's fallback, one the component sets itself, or one in its markup's static style text counts, giving sourceLine and fallback. A name the component never reads stays, at the tag's line, and warns unknown_cssprop; a tag default the style's fallback disagrees with warns cssprop_default_mismatch; a tag that names no property warns malformed_tag, and one repeating a name duplicate_tag, each dropped.

Without tags, empty when the component has no <style> and no markup read, when its style's lang (or type) names a preprocessor language (css_lang_unsupported), or when Svelte's parser rejects the component (css_parse_failed); tagged properties are listed even then.

type ComponentCssPropertyJson[]

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

lang?

Script language. undefined means TypeScript (default), 'js' for JS-only components.

type "js"

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

ComponentDeclarationJsonInput
#

types.ts view source

ComponentDeclarationJsonInput import type {ComponentDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input ComponentDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ComponentDeclarationJsonEntries >

kind

type "component"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

externalTypes?

External types whose properties are filtered out of props — the attribute bags a component forwards, such as HTMLButtonAttributes or SvelteHTMLElements['button']. A bag stays listed when some of its properties are documented anyway because the $props() destructuring names them (see props).

Covers every way props compose them: an intersection or union branch, a bare or indexed-access annotation, and interface Props extends Bag (directly or through a local base). Entries carry the written form with the same normalizations as TypeDeclarationJson.externalTypes: import renames at the definition site resolve to the exported name, and a type parameter bound inside the descent substitutes its written argument — interface A<T> extends HTMLAttributes<T> reached via `Props extends A<HTMLDivElement> records HTMLAttributes<HTMLDivElement>`. The component's *own* generics stay in scope and emit as written (HTMLAttributes<T> beside the genericParams documenting T). Each distinct bag appears once, in source order; a local name is used only when it hides a definition the walk cannot traverse (a mapped or conditional type). Names carry no module, so two distinct bags sharing an exported name collapse to one entry.

type string[]

see also

  • ``TypeDeclarationJson.externalTypes`` for the full entry contract, InterfaceDeclarationJson.externalTypes for the field on the props interface itself. Field shapes mirror TS syntax.

props?

Svelte component props, in source order.

Properties an external type contributes are left out (externalTypes names their bags), except the ones the $props() destructuring names: type in let {type = 'button', ...rest}: HTMLButtonAttributes = $props() is documented with the external declaration's type and JSDoc. Renamed (class: className) and nested (a: {b}) elements name their prop; the rest element names nothing, and a name the props type has only through an index signature isn't admitted. Admitted props follow the others, in destructuring order, since their declaration position is in a package.

type ComponentPropJsonInput[]

acceptsChildren?

Whether the component accepts children: an explicit or inherited Snippet-typed children prop, implicit template usage, or a default slot (<slot /> or a declared $$Slots) in a legacy component, one svelte2tsx reads as runes-less. A runes component's <slot /> doesn't set it, and neither does a named slot alone.

type boolean

cssCustomProperties?

The component's styling API: the CSS custom properties its styles read with a fallback (var(--a, 1px)), the pattern Svelte's own docs give for a component's styling hooks, or read bare and register with @property, and leave for a consumer to set, plus the ones its doc comment documents with @cssprop. One entry per name: the documented ones first, in tag order, then the rest in the order of each name's first read.

A read counts when it's an outermost var(), not one in another var()'s fallback: var(--a, var(--b)) reads --a, with --b the fallback chain's global token. Reads anywhere in the top-level <style> count, in :global(…) rules, nested rules, @media/@container/@supports blocks, and keyframes alike, and so do reads in the static text of the markup's style attributes and style: directives on elements and style and --a attributes on child components (<Child --a="var(--b, 1px)" /> reads --b). A name drops out when the component sets it itself: a --a: … declaration in its <style>, a style:--a directive, or a --a: in a style attribute on one of its elements. A --a or style attribute on a child component sets nothing, since it styles the child. A name read only without a fallback isn't listed, unless the style registers it with @property --a {…}, whose syntax and initial-value the entry carries (the last rule for a name wins; inherits isn't modeled); a registered name nothing reads isn't listed either: bare reads are mostly global design tokens. A global token read with a fallback is listed too; the author's fix is to drop the fallback or to document the property with @cssprop. There's deliberately no option to filter names at analysis: the output keeps every read, and a consumer that wants less filters it (to documented entries, say). Names are case-sensitive, as in CSS.

@cssprop --a - Description 1 (or @cssproperty) in the component's doc comment, the source that wins docComment (the in-script JSDoc over the HTML @component comment, the losing one's tags ignored), lists --a whatever the heuristic makes of it, documented: true, with the tag's description, syntax, and default. It merges with the read: a bare read, one nested in another's fallback, one the component sets itself, or one in its markup's static style text counts, giving sourceLine and fallback. A name the component never reads stays, at the tag's line, and warns unknown_cssprop; a tag default the style's fallback disagrees with warns cssprop_default_mismatch; a tag that names no property warns malformed_tag, and one repeating a name duplicate_tag, each dropped.

Without tags, empty when the component has no <style> and no markup read, when its style's lang (or type) names a preprocessor language (css_lang_unsupported), or when Svelte's parser rejects the component (css_parse_failed); tagged properties are listed even then.

type ComponentCssPropertyJsonInput[]

lang?

Script language. undefined means TypeScript (default), 'js' for JS-only components.

type "js"

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

ComponentPropJson
#

types.ts view source

value + type

also exported from index.ts

ComponentPropJson import {ComponentPropJson} from 'svelte-docinfo/types.js';

Component prop information for Svelte components.

Standalone schema (not extending ParameterJson) because component props have different semantics: named attributes with no positional order (<Foo {a} {b} /> = <Foo {b} {a} />), no rest parameters, and support for two-way binding (the $bindable rune, or a legacy export let prop).

inheritance

extends: s.SchemaStrictObjectOutput< typeof ComponentPropJsonEntries >

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

Prop name as declared in the component's $props() type — the prop's own name, not the local binding a renamed destructuring element introduces.

type string

type

Resolved TypeScript type string.

type string

optional

Whether the prop is optional in the component's props type.

type boolean

bindable

Whether the prop supports two-way binding (bind:name): declared with the $bindable() rune, or any prop of a legacy export let component, where every prop can be bound.

type boolean

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

typeInfo?

Structured type; absent when type is the whole story (see TypeJson).

type TypeJson

description?

Description from JSDoc on the prop's type declaration.

type string

defaultValue?

The destructuring default's source text, else the @default tag text — verbatim author text either way ("'primary'", () => 10), quotes included, no normalization; consumers render it as highlighted TS.

type string

parameters?

Structured parameters for callable props: a snippet's (Snippet<[text: string]>) or a callback's ((value: string) => void). returnType tells the two apart — a callback has one, a snippet doesn't.

Present when the prop has extractable parameters, absent otherwise. Only populated when there are actual parameters — bare Snippet / Snippet<[]> and a zero-parameter callback do not set this field. Intentionally optional without a default, unlike the other array fields (see the input/output split in the module comment): absence is a meaningful signal, not an empty list.

type ParameterJson[]

returnType?

A callback prop's return type, and the marker that the prop is one: present exactly when the prop's type has a call signature this project declared (onpick?: (value: string) => void, or a project alias for one). parameters holds that signature's parameters.

The prop's type is read with null and the optional undefined stripped, so (() => void) | null is a callback. A union of several function types is not — typeInfo lists its members instead.

Only project-declared signatures count, as for callable members. A prop typed wholly by a package (MouseEventHandler<HTMLButtonElement>, a Component) carries neither field, since an external callable isn't always a callback. In an intersection of an own signature with an external one (MouseEventHandler<HTMLElement> & (() => void), the shape a redeclared onclick over an attributes bag takes), the own signature is the one described. Of several own signatures, the first.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

ComponentPropJsonInput
#

types.ts view source

ComponentPropJsonInput import type {ComponentPropJsonInput} from 'svelte-docinfo/types.js';

The input ComponentPropJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ComponentPropJsonEntries >

name

Prop name as declared in the component's $props() type — the prop's own name, not the local binding a renamed destructuring element introduces.

type string

type

Resolved TypeScript type string.

type string

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

typeInfo?

Structured type; absent when type is the whole story (see TypeJson).

type TypeJson

optional?

Whether the prop is optional in the component's props type.

type boolean

description?

Description from JSDoc on the prop's type declaration.

type string

defaultValue?

The destructuring default's source text, else the @default tag text — verbatim author text either way ("'primary'", () => 10), quotes included, no normalization; consumers render it as highlighted TS.

type string

bindable?

Whether the prop supports two-way binding (bind:name): declared with the $bindable() rune, or any prop of a legacy export let component, where every prop can be bound.

type boolean

parameters?

Structured parameters for callable props: a snippet's (Snippet<[text: string]>) or a callback's ((value: string) => void). returnType tells the two apart — a callback has one, a snippet doesn't.

Present when the prop has extractable parameters, absent otherwise. Only populated when there are actual parameters — bare Snippet / Snippet<[]> and a zero-parameter callback do not set this field. Intentionally optional without a default, unlike the other array fields (see the input/output split in the module comment): absence is a meaningful signal, not an empty list.

type ParameterJsonInput[]

returnType?

A callback prop's return type, and the marker that the prop is one: present exactly when the prop's type has a call signature this project declared (onpick?: (value: string) => void, or a project alias for one). parameters holds that signature's parameters.

The prop's type is read with null and the optional undefined stripped, so (() => void) | null is a callback. A union of several function types is not — typeInfo lists its members instead.

Only project-declared signatures count, as for callable members. A prop typed wholly by a package (MouseEventHandler<HTMLButtonElement>, a Component) carries neither field, since an external callable isn't always a callback. In an intersection of an own signature with an external one (MouseEventHandler<HTMLElement> & (() => void), the shape a redeclared onclick over an attributes bag takes), the own signature is the one described. Of several own signatures, the first.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

ConstructorMemberJson
#

types.ts view source

value + type

also exported from index.ts

ConstructorMemberJson import {ConstructorMemberJson} from 'svelte-docinfo/types.js';

A constructor member (class constructor, construct signature). Has parameters, overloads — but not returnType/returnDescription (constructors always return their class).

name is narrowed to two literal sentinels: 'constructor' for class constructors and '(construct)' for interface/type-alias construct signatures (which share kind: 'constructor' but originate from getConstructSignatures() on a non-class type — no user-chosen identifier exists). The literal is preserved (rather than omitted) so getDisplayName and consumer renderers reading member.name keep working without a constructor-specific branch.

inheritance

extends: s.SchemaStrictObjectOutput< typeof ConstructorMemberJsonEntries >

kind

type "constructor"

name

type "constructor" | "(construct)"

parameters

Function/method/constructor parameters, in signature order.

type ParameterJson[]

overloads

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJson[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

ConstructorMemberJsonInput
#

types.ts view source

ConstructorMemberJsonInput import type {ConstructorMemberJsonInput} from 'svelte-docinfo/types.js';

The input ConstructorMemberJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ConstructorMemberJsonEntries >

kind

type "constructor"

name

type "constructor" | "(construct)"

parameters?

Function/method/constructor parameters, in signature order.

type ParameterJsonInput[]

overloads?

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJsonInput[]

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

DeclarationJson
#

types.ts view source

value + type

also exported from index.ts

DeclarationJson

type FunctionDeclarationJson | ClassDeclarationJson | InterfaceDeclarationJson | TypeDeclarationJson | VariableDeclarationJson | EnumDeclarationJson | ComponentDeclarationJson | SnippetDeclarationJson | NamespaceDeclarationJson

import {DeclarationJson} from 'svelte-docinfo/types.js';

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

Discriminated union on kind — each variant has only the fields relevant to that kind. Use isKind (in declaration-helpers.ts) to narrow, or check declaration.kind directly.

DeclarationJsonInput
#

DeclarationKind
#

types.ts view source

value + type

also exported from index.ts

"function" | "type" | "variable" | "class" | "interface" | "enum" | "component" | "snippet" | "namespace"

type "function" | "type" | "variable" | "class" | "interface" | "enum" | "component" | "snippet" | "namespace"

import {DeclarationKind} from 'svelte-docinfo/types.js';

The kind of top-level exported declaration.

Does not include 'constructor' — constructors only appear as MemberKind (nested in classes, interfaces, or types with construct signatures), never as top-level module exports.

DeclarationModifier
#

types.ts view source

value + type

also exported from index.ts

"public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter"

type "public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter"

import {DeclarationModifier} from 'svelte-docinfo/types.js';

TypeScript modifier keywords extracted from declarations.

Only modifiers that appear on public API members are included. Private members (including #field syntax) are filtered out during analysis. Protected members are included as part of the extension API.

EnumDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

EnumDeclarationJson import {EnumDeclarationJson} from 'svelte-docinfo/types.js';

An enum declaration. Has members for enum values.

inheritance

extends: s.SchemaStrictObjectOutput< typeof EnumDeclarationJsonEntries >

kind

type "enum"

members

Enum members: name/value pairs with optional JSDoc.

type (FunctionMemberJson | VariableMemberJson | ConstructorMemberJson)[]

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

EnumDeclarationJsonInput
#

types.ts view source

EnumDeclarationJsonInput import type {EnumDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input EnumDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof EnumDeclarationJsonEntries >

kind

type "enum"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

members?

Enum members: name/value pairs with optional JSDoc.

type (FunctionMemberJsonInput | VariableMemberJsonInput | ConstructorMemberJsonInput)[]

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

ExternalReExportJson
#

types.ts view source

value + type

also exported from index.ts

ExternalReExportJson import {ExternalReExportJson} from 'svelte-docinfo/types.js';

A re-export whose immediate target is an external package — export {x} from 'pkg', export {x as y} from 'pkg', or export * as ns from 'pkg'. External is per createIsExternalPath; a project-local target excluded from output (the internal/ convention) is not external, and its re-exports synthesize alias declarations instead.

specifier is the module specifier as written (usually a package name); there is no canonical declaration to resolve, so these entries are flat facts about the statement rather than edges into the module graph.

Only statements that *directly* reference the external specifier are captured. Forms that stay silent: import {x} from 'pkg'; export {x}; (import-then-export), re-export chains that reach a package through another source module (that module owns the entry) or through a project-local gated module, and specifiers the checker can't resolve. Statement-level @nodocs suppresses the entry.

inheritance

extends: s.SchemaStrictObjectOutput< typeof ExternalReExportJsonEntries >

name

Public exported name from this module.

type string

specifier

Module specifier as written in the statement (e.g. 'pkg').

type string

typeOnly

Whether the statement or specifier is type-only — see ReExportJson.typeOnly.

type boolean

originalName?

The name inside the external module when renamed (export {x as y} from 'pkg' → 'x'). Omitted for same-name re-exports and namespace form (export * as ns).

type string

sourceLine?

1-based line of the export specifier in this module's source, a positive integer.

type number

ExternalReExportJsonInput
#

types.ts view source

ExternalReExportJsonInput import type {ExternalReExportJsonInput} from 'svelte-docinfo/types.js';

The input ExternalReExportJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ExternalReExportJsonEntries >

name

Public exported name from this module.

type string

specifier

Module specifier as written in the statement (e.g. 'pkg').

type string

originalName?

The name inside the external module when renamed (export {x as y} from 'pkg' → 'x'). Omitted for same-name re-exports and namespace form (export * as ns).

type string

typeOnly?

Whether the statement or specifier is type-only — see ReExportJson.typeOnly.

type boolean

sourceLine?

1-based line of the export specifier in this module's source, a positive integer.

type number

FunctionDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

FunctionDeclarationJson import {FunctionDeclarationJson} from 'svelte-docinfo/types.js';

A function declaration. Has parameters, returnType, returnDescription, overloads.

inheritance

extends: s.SchemaStrictObjectOutput< typeof FunctionDeclarationJsonEntries >

kind

type "function"

parameters

Function/method/constructor parameters, in signature order.

type ParameterJson[]

overloads

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJson[]

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

returnType?

Function/method return type.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

returnDescription?

Return value description from @returns tag.

type string

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

FunctionDeclarationJsonInput
#

types.ts view source

FunctionDeclarationJsonInput import type {FunctionDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input FunctionDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof FunctionDeclarationJsonEntries >

kind

type "function"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

returnType?

Function/method return type.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

returnDescription?

Return value description from @returns tag.

type string

parameters?

Function/method/constructor parameters, in signature order.

type ParameterJsonInput[]

overloads?

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJsonInput[]

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

FunctionMemberJson
#

types.ts view source

value + type

also exported from index.ts

FunctionMemberJson import {FunctionMemberJson} from 'svelte-docinfo/types.js';

A function member (method, call signature, method signature). Has parameters, returnType, returnDescription, overloads.

optional reflects a ? token on the declaration (e.g., foo?(): void on an interface or type literal, or m?(): void {} on a class). Always false for index/call/construct signatures.

name is the user-chosen method/property identifier, except for call signatures on interfaces and type aliases where it is the literal sentinel '(call)'.

inheritance

extends: s.SchemaStrictObjectOutput< typeof FunctionMemberJsonEntries >

kind

type "function"

name

User-chosen identifier, or the literal '(call)' sentinel for unnamed call signatures.

type string

optional

Whether the member has a ? token in its declaration.

type boolean

parameters

Function/method/constructor parameters, in signature order.

type ParameterJson[]

overloads

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJson[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

defaultValue?

Default value documented via @default — for a callable member, typically the behavior used when the callback is omitted. Always tag-authored (structural containers have no initializers), verbatim with no normalization. Members only: top-level function declarations and overloads never carry one.

type string

returnType?

Function/method return type.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

returnDescription?

Return value description from @returns tag.

type string

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

FunctionMemberJsonInput
#

types.ts view source

FunctionMemberJsonInput import type {FunctionMemberJsonInput} from 'svelte-docinfo/types.js';

The input FunctionMemberJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof FunctionMemberJsonEntries >

kind

type "function"

name

User-chosen identifier, or the literal '(call)' sentinel for unnamed call signatures.

type string

optional?

Whether the member has a ? token in its declaration.

type boolean

defaultValue?

Default value documented via @default — for a callable member, typically the behavior used when the callback is omitted. Always tag-authored (structural containers have no initializers), verbatim with no normalization. Members only: top-level function declarations and overloads never carry one.

type string

returnType?

Function/method return type.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

returnDescription?

Return value description from @returns tag.

type string

parameters?

Function/method/constructor parameters, in signature order.

type ParameterJsonInput[]

overloads?

Overload signatures (when there are multiple public overloads). Includes all public overloads. The implementation signature is excluded. Empty when there are no overloads (single signature).

type OverloadJsonInput[]

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

GenericParamJson
#

types.ts view source

value + type

also exported from index.ts

GenericParamJson import {GenericParamJson} from 'svelte-docinfo/types.js';

Generic type parameter metadata extracted from declarations like <T extends string = unknown>.

Present on functions, classes, interfaces, type aliases, and Svelte components that declare generic type parameters.

inheritance

extends: s.SchemaStrictObjectOutput< typeof GenericParamJsonEntries >

name

Parameter name like T.

type string

constraint?

Constraint like string from T extends string.

type string

defaultType?

Default type like unknown from T = unknown.

type string

GenericParamJsonInput
#

types.ts view source

GenericParamJsonInput import type {GenericParamJsonInput} from 'svelte-docinfo/types.js';

The input GenericParamJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof GenericParamJsonEntries >

name

Parameter name like T.

type string

constraint?

Constraint like string from T extends string.

type string

defaultType?

Default type like unknown from T = unknown.

type string

InterfaceDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

InterfaceDeclarationJson import {InterfaceDeclarationJson} from 'svelte-docinfo/types.js';

An interface declaration. Has members, extends.

inheritance

extends: s.SchemaStrictObjectOutput< typeof InterfaceDeclarationJsonEntries >

kind

type "interface"

extends

Extended interfaces.

Verbatim text of this declaration's own heritage clause, so entries are spelled as this module wrote them and resolve in its scope — a local rename (import type {Bag as B}) stays B. Unlike externalTypes, whose walk crosses modules and therefore resolves renames back to the exported name, this clause never leaves the declaring file.

type string[]

see also

  • ``ClassDeclarationJson.extends, ClassDeclarationJson.implements for the other verbatim heritage fields, externalTypes (this variant) for the resolved external reach.

externalTypes

External types the heritage composition reaches whose contributions members never enumerates.

A named base's members aren't listed, and a computed heritage entry's external properties are filtered out (see members). This field names the external types behind that absence: `interface Props extends HTMLButtonAttributes records the bag directly, and interface Props extends LocalBase (where LocalBase` reaches a bag) records it transitively — the same answer the component annotated with this interface gets, where extends alone dead-ends at a possibly-unexported local name. Inherited *local* content is the extends field's business: the base is documented at its own declaration.

Entry normalization (rename resolution, type-parameter substitution, text-dedupe, source order) matches TypeDeclarationJson.externalTypes. Direct-heritage cases make this textually equal to extends; consumers dedupe at render time.

type string[]

members

Interface members: property signatures, method signatures, index signatures, call/construct signatures — the interface's own, plus what each extends entry that isn't a named interface or class contributes.

A named base (extends Base, extends Base<string>, an alias of either), local or external, keeps its members, call/construct signatures included: extends names it, and it is documented at its own declaration. A computed entry has no declaration of its own — a mapped, conditional, or utility-type instantiation (z.infer<typeof S>, Omit<Base, 'a'>, Partial<Base>), an intersection, an object type behind an alias — so it contributes what the same type documents as a type alias's members, external-origin contributions dropped and labeled in externalTypes. A name the interface declares itself wins; otherwise the first heritage entry with the name supplies it, as in TypeScript's inheritance. A call or construct signature likewise goes to the first entry that reaches it: extends Base, Base & {…} leaves Base's to Base, extends Base & {…}, Base lists them. Own members come in source order, then the contributed properties entry by entry, then their index signatures, with call/construct signatures last (own before contributed, as overloads of one member, each signature once).

A merged interface documents the block selectDeclarationNode picks, the first in declaration order: its members and its extends (own call and construct signatures excepted, which come from every block). Another block's members and heritage document nothing, and a name another block declares still drops from the documented block's heritage contribution, since TypeScript takes it from that block.

type (FunctionMemberJson | VariableMemberJson | ConstructorMemberJson)[]

mergedValue

The exported name also carries a value meaning — a merged value+type symbol (const Foo = ... + interface Foo {...}), where the interface wins the declaration slot and the value's own type goes undocumented. Tells consumers the name is importable as a runtime value: `import {Foo}, never import type {Foo} (see generateImport`).

type boolean

see also

  • ``TypeDeclarationJson.mergedValue``

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

InterfaceDeclarationJsonInput
#

types.ts view source

InterfaceDeclarationJsonInput import type {InterfaceDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input InterfaceDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof InterfaceDeclarationJsonEntries >

kind

type "interface"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

extends?

Extended interfaces.

Verbatim text of this declaration's own heritage clause, so entries are spelled as this module wrote them and resolve in its scope — a local rename (import type {Bag as B}) stays B. Unlike externalTypes, whose walk crosses modules and therefore resolves renames back to the exported name, this clause never leaves the declaring file.

type string[]

see also

  • ``ClassDeclarationJson.extends, ClassDeclarationJson.implements for the other verbatim heritage fields, externalTypes (this variant) for the resolved external reach.

externalTypes?

External types the heritage composition reaches whose contributions members never enumerates.

A named base's members aren't listed, and a computed heritage entry's external properties are filtered out (see members). This field names the external types behind that absence: `interface Props extends HTMLButtonAttributes records the bag directly, and interface Props extends LocalBase (where LocalBase` reaches a bag) records it transitively — the same answer the component annotated with this interface gets, where extends alone dead-ends at a possibly-unexported local name. Inherited *local* content is the extends field's business: the base is documented at its own declaration.

Entry normalization (rename resolution, type-parameter substitution, text-dedupe, source order) matches TypeDeclarationJson.externalTypes. Direct-heritage cases make this textually equal to extends; consumers dedupe at render time.

type string[]

members?

Interface members: property signatures, method signatures, index signatures, call/construct signatures — the interface's own, plus what each extends entry that isn't a named interface or class contributes.

A named base (extends Base, extends Base<string>, an alias of either), local or external, keeps its members, call/construct signatures included: extends names it, and it is documented at its own declaration. A computed entry has no declaration of its own — a mapped, conditional, or utility-type instantiation (z.infer<typeof S>, Omit<Base, 'a'>, Partial<Base>), an intersection, an object type behind an alias — so it contributes what the same type documents as a type alias's members, external-origin contributions dropped and labeled in externalTypes. A name the interface declares itself wins; otherwise the first heritage entry with the name supplies it, as in TypeScript's inheritance. A call or construct signature likewise goes to the first entry that reaches it: extends Base, Base & {…} leaves Base's to Base, extends Base & {…}, Base lists them. Own members come in source order, then the contributed properties entry by entry, then their index signatures, with call/construct signatures last (own before contributed, as overloads of one member, each signature once).

A merged interface documents the block selectDeclarationNode picks, the first in declaration order: its members and its extends (own call and construct signatures excepted, which come from every block). Another block's members and heritage document nothing, and a name another block declares still drops from the documented block's heritage contribution, since TypeScript takes it from that block.

type (FunctionMemberJsonInput | VariableMemberJsonInput | ConstructorMemberJsonInput)[]

mergedValue?

The exported name also carries a value meaning — a merged value+type symbol (const Foo = ... + interface Foo {...}), where the interface wins the declaration slot and the value's own type goes undocumented. Tells consumers the name is importable as a runtime value: `import {Foo}, never import type {Foo} (see generateImport`).

type boolean

see also

  • ``TypeDeclarationJson.mergedValue``

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

MemberJson
#

types.ts view source

value + type

also exported from index.ts

MemberJson

type FunctionMemberJson | VariableMemberJson | ConstructorMemberJson

import {MemberJson} from 'svelte-docinfo/types.js';

Metadata for a nested declaration within a class, interface, type, or enum.

Discriminated union on kind with 3 variants: FunctionMemberJson, VariableMemberJson, ConstructorMemberJson. Use isKind (in declaration-helpers.ts) to narrow, or check member.kind directly.

Does not include fields that exist on declarations but not on members (extends, externalTypes, implements, props, alsoExportedFrom, aliasOf).

Nesting is exactly one level deep — members never contain their own members.

MemberJsonInput
#

MemberKind
#

types.ts view source

value + type

also exported from index.ts

"function" | "variable" | "constructor"

type "function" | "variable" | "constructor"

import {MemberKind} from 'svelte-docinfo/types.js';

The subset of declaration kinds that appear as nested members in classes, interfaces, and types.

Class members include constructors ('constructor'), methods ('function'), and properties/accessors ('variable'). Interface/type properties use the same kinds for property signatures, method signatures, index signatures, and call/construct signatures.

Every other DeclarationKind is top-level only; nesting is exactly one level deep.

ModuleJson
#

types.ts view source

value + type

also exported from index.ts

ModuleJson import {ModuleJson} from 'svelte-docinfo/types.js';

Metadata for a source module — the top-level container in the data model.

analyze, analyzeFromFiles, and AnalysisSession.query return AnalyzeResultJson, whose modules is sorted by path (compareStrings). Each module contains its exported declarations, dependency graph, and optional moduleComment.

inheritance

extends: s.SchemaStrictObjectOutput<typeof ModuleJsonEntries>

dependencies

Modules this imports (paths relative to sourceRoot).

type string[]

dependents

Modules that import this (paths relative to sourceRoot).

type string[]

starExports

Modules fully re-exported via export * from './module'. Paths are relative to sourceRoot. Statement-level @nodocs suppresses the entry, like the other re-export encodings. `export type * from` is recorded like a value star — per-statement type-only-ness isn't captured — and each target appears once, however many statements name it.

Only modules that are themselves in the result appear. A star over a project module that emits nothing (gated, or outside the analyzed inputs) has no entry: the bindings it projects are documented in this module as the named re-exports the star stands for — declarations with aliasOf, or reExports entries for bindings whose canonical does emit — following ES star semantics (default doesn't project, a local export shadows, a name two stars disagree on is excluded). A binding such a module re-exports from a package is not recorded anywhere.

A star over a component that failed to transform names its partial placeholder module, whose bindings are unknown (resolveExportSurface reports it unresolved); one that emits nothing (gated, never supplied) is dropped.

type string[]

reExports

Same-name re-exports in this module's source, sorted by name then module (names can collide — see ReExportJson). The forward view of alsoExportedFrom — see ReExportJson for the full contract (canonical resolution, Svelte default-slot naming, @nodocs suppression, presence caveats).

type ReExportJson[]

externalReExports

Re-exports whose immediate target is an external package, sorted by name then specifier. See ExternalReExportJson for which forms are captured.

type ExternalReExportJson[]

externalStarExports

External modules fully re-exported via export * from 'pkg', as written (statement order, each specifier once). The projected names are unknown — the package isn't analyzed. Statement-level @nodocs suppresses the entry; unresolvable specifiers are skipped. A relative .svelte specifier is never an entry, whether or not its component has a virtual (see starExports).

type string[]

partial

Whether the module is a placeholder for a file that couldn't be analyzed.

Currently only set for Svelte files where svelte2tsx threw at ingest (the transform_failed diagnostic carries the error). Placeholder modules have declarations: [] and serve as a structural slot so the modules array reflects the full emitted (source-gated) set; consumers render them as "broken" entries.

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

path

Path relative to sourceRoot (e.g., helpers.ts for the default SvelteKit src/lib layout). sourceRoot is configurable via createSourceOptions / the CLI --source-root flag — consumers with a custom layout (e.g., sourcePaths: ['src/lib', 'src/routes'], sourceRoot: 'src') see prefixes like lib/foo.ts here.

type string

declarations

Exported declarations from this module.

type (FunctionDeclarationJson | ClassDeclarationJson | InterfaceDeclarationJson | TypeDeclarationJson | VariableDeclarationJson | EnumDeclarationJson | ComponentDeclarationJson | SnippetDeclarationJson | NamespaceDeclarationJson)[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

moduleComment?

The prose of the file-level comment, the one carrying a @module tag: its main text, with every tag line removed. Absent when the comment has no prose (a tag-only comment, or none at all).

The comment's tags parse as a declaration's do, into the fields below (examples, deprecatedMessage, seeAlso, since, internalMessage). Tags that only describe a declaration (@param, @returns, @mutates, @throws, @default, @nodocs) are dropped with a misplaced_tag warning, and unknown tags drop silently. For a Svelte file it comes from the instance <script>, the <script module>, or an HTML comment with a @module line, the first in that order whose comment populates any of these fields.

type string

ModuleJsonInput
#

types.ts view source

ModuleJsonInput import type {ModuleJsonInput} from 'svelte-docinfo/types.js';

The input ModuleJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput<typeof ModuleJsonEntries>

path

Path relative to sourceRoot (e.g., helpers.ts for the default SvelteKit src/lib layout). sourceRoot is configurable via createSourceOptions / the CLI --source-root flag — consumers with a custom layout (e.g., sourcePaths: ['src/lib', 'src/routes'], sourceRoot: 'src') see prefixes like lib/foo.ts here.

type string

dependencies?

Modules this imports (paths relative to sourceRoot).

type string[]

dependents?

Modules that import this (paths relative to sourceRoot).

type string[]

starExports?

Modules fully re-exported via export * from './module'. Paths are relative to sourceRoot. Statement-level @nodocs suppresses the entry, like the other re-export encodings. `export type * from` is recorded like a value star — per-statement type-only-ness isn't captured — and each target appears once, however many statements name it.

Only modules that are themselves in the result appear. A star over a project module that emits nothing (gated, or outside the analyzed inputs) has no entry: the bindings it projects are documented in this module as the named re-exports the star stands for — declarations with aliasOf, or reExports entries for bindings whose canonical does emit — following ES star semantics (default doesn't project, a local export shadows, a name two stars disagree on is excluded). A binding such a module re-exports from a package is not recorded anywhere.

A star over a component that failed to transform names its partial placeholder module, whose bindings are unknown (resolveExportSurface reports it unresolved); one that emits nothing (gated, never supplied) is dropped.

type string[]

reExports?

Same-name re-exports in this module's source, sorted by name then module (names can collide — see ReExportJson). The forward view of alsoExportedFrom — see ReExportJson for the full contract (canonical resolution, Svelte default-slot naming, @nodocs suppression, presence caveats).

type ReExportJsonInput[]

externalReExports?

Re-exports whose immediate target is an external package, sorted by name then specifier. See ExternalReExportJson for which forms are captured.

type ExternalReExportJsonInput[]

externalStarExports?

External modules fully re-exported via export * from 'pkg', as written (statement order, each specifier once). The projected names are unknown — the package isn't analyzed. Statement-level @nodocs suppresses the entry; unresolvable specifiers are skipped. A relative .svelte specifier is never an entry, whether or not its component has a virtual (see starExports).

type string[]

partial?

Whether the module is a placeholder for a file that couldn't be analyzed.

Currently only set for Svelte files where svelte2tsx threw at ingest (the transform_failed diagnostic carries the error). Placeholder modules have declarations: [] and serve as a structural slot so the modules array reflects the full emitted (source-gated) set; consumers render them as "broken" entries.

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

declarations?

Exported declarations from this module.

type (FunctionDeclarationJsonInput | ClassDeclarationJsonInput | InterfaceDeclarationJsonInput | TypeDeclarationJsonInput | VariableDeclarationJsonInput | EnumDeclarationJsonInput | ComponentDeclarationJsonInput | SnippetDeclarationJsonInput | NamespaceDeclarationJsonInput)[]

moduleComment?

The prose of the file-level comment, the one carrying a @module tag: its main text, with every tag line removed. Absent when the comment has no prose (a tag-only comment, or none at all).

The comment's tags parse as a declaration's do, into the fields below (examples, deprecatedMessage, seeAlso, since, internalMessage). Tags that only describe a declaration (@param, @returns, @mutates, @throws, @default, @nodocs) are dropped with a misplaced_tag warning, and unknown tags drop silently. For a Svelte file it comes from the instance <script>, the <script module>, or an HTML comment with a @module line, the first in that order whose comment populates any of these fields.

type string

NamespaceDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

NamespaceDeclarationJson import {NamespaceDeclarationJson} from 'svelte-docinfo/types.js';

A namespace re-export binding: export * as ns from './x'.

Carries no inline members — module points to the source module whose declarations are projected under this name. Consumers that want to render ns.a can deref by reading the source module's declarations array.

Over a .svelte file with no svelte2tsx virtual (its transform failed, or it was never supplied) the binding is partial: its members are unknown, and module names the component's partial placeholder, or a module the result lacks when the component emits nothing.

inheritance

extends: s.SchemaStrictObjectOutput< typeof NamespaceDeclarationJsonEntries >

kind

type "namespace"

module

Source module path (relative to sourceRoot) projected under this binding.

type string

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

NamespaceDeclarationJsonInput
#

types.ts view source

NamespaceDeclarationJsonInput import type {NamespaceDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input NamespaceDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof NamespaceDeclarationJsonEntries >

kind

type "namespace"

module

Source module path (relative to sourceRoot) projected under this binding.

type string

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

OverloadJson
#

types.ts view source

value + type

also exported from index.ts

OverloadJson import {OverloadJson} from 'svelte-docinfo/types.js';

A single function overload signature.

When a function has multiple overload signatures, each public overload is captured here. The implementation signature is excluded.

inheritance

extends: s.SchemaStrictObjectOutput<typeof OverloadJsonEntries>

typeSignature

Full TypeScript type signature for this overload.

type string

parameters

Parameters for this overload.

type ParameterJson[]

genericParams

Generic type parameters for this overload.

type GenericParamJson[]

returnType?

Return type for this overload.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

docComment?

JSDoc/TSDoc comment specific to this overload.

type string

returnDescription?

Return value description from @returns tag on this overload.

type string

OverloadJsonInput
#

types.ts view source

OverloadJsonInput import type {OverloadJsonInput} from 'svelte-docinfo/types.js';

The input OverloadJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput<typeof OverloadJsonEntries>

typeSignature

Full TypeScript type signature for this overload.

type string

parameters?

Parameters for this overload.

type ParameterJsonInput[]

returnType?

Return type for this overload.

type string

returnTypeInfo?

Structured return type; absent when returnType is the whole story (see TypeJson).

type TypeJson

genericParams?

Generic type parameters for this overload.

type GenericParamJsonInput[]

docComment?

JSDoc/TSDoc comment specific to this overload.

type string

returnDescription?

Return value description from @returns tag on this overload.

type string

ParameterJson
#

types.ts view source

value + type

also exported from index.ts

ParameterJson import {ParameterJson} from 'svelte-docinfo/types.js';

Parameter information for functions and methods.

Kept distinct from ComponentPropJson 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.

Carries no doc fields beyond description, unlike ComponentPropJson: a parameter's docs come from one @param line, while a prop has a JSDoc block of its own.

inheritance

extends: s.SchemaStrictObjectOutput<typeof ParameterJsonEntries>

name

Parameter name (e.g., options, args); rest-ness is carried by rest, never the name.

type string

type

Resolved TypeScript type string (e.g., string, Record<string, unknown>).

type string

optional

Whether a caller may omit the argument, by the checker's isOptionalParameter: a ? token, an initializer with no required parameter after it (b = 0), and in JS a bracketed @param {T} [b] or @param {T=} b. When set, type and typeInfo drop a top-level undefined (the optional widening, or one an initialized parameter's type already holds), so optional carries it alone. A rest parameter is never optional.

type boolean

rest

Whether the parameter uses rest syntax (...args).

type boolean

typeInfo?

Structured type; absent when type is the whole story (see TypeJson).

type TypeJson

description?

Description from @param tag.

type string

defaultValue?

The initializer's source text, verbatim (e.g., "'hello'", 42, () => 10) — quotes included, no normalization; consumers render it as highlighted TS. Without an initializer, the default a bracketed @param {T} [b=0] writes, verbatim the same way.

type string

propertyDescriptions?

Descriptions for properties of a named object parameter, from dotted @param tags (@param obj.prop - ...), the ones TypeScript nests under a braced @param {object} obj included.

Keyed by the sub-path relative to this parameter — @param obj.prop becomes {prop: '...'}, @param obj.a.b becomes {'a.b': '...'}, and an array element's @param arr[].prop becomes {'[].prop': '...'}. Keys are unvalidated against the parameter's actual type (matching the @mutates philosophy); absent when no dotted @param tags reference this parameter. Only populated for function/method/constructor signature parameters.

Matching is by the parameter's name, so destructured parameters (fn({a, b}: T)) are not covered — TypeScript names them __0, with no author-facing identifier for a @param key to reference.

type Record<string, string>

ParameterJsonInput
#

types.ts view source

ParameterJsonInput import type {ParameterJsonInput} from 'svelte-docinfo/types.js';

The input ParameterJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof ParameterJsonEntries >

name

Parameter name (e.g., options, args); rest-ness is carried by rest, never the name.

type string

type

Resolved TypeScript type string (e.g., string, Record<string, unknown>).

type string

typeInfo?

Structured type; absent when type is the whole story (see TypeJson).

type TypeJson

optional?

Whether a caller may omit the argument, by the checker's isOptionalParameter: a ? token, an initializer with no required parameter after it (b = 0), and in JS a bracketed @param {T} [b] or @param {T=} b. When set, type and typeInfo drop a top-level undefined (the optional widening, or one an initialized parameter's type already holds), so optional carries it alone. A rest parameter is never optional.

type boolean

rest?

Whether the parameter uses rest syntax (...args).

type boolean

description?

Description from @param tag.

type string

defaultValue?

The initializer's source text, verbatim (e.g., "'hello'", 42, () => 10) — quotes included, no normalization; consumers render it as highlighted TS. Without an initializer, the default a bracketed @param {T} [b=0] writes, verbatim the same way.

type string

propertyDescriptions?

Descriptions for properties of a named object parameter, from dotted @param tags (@param obj.prop - ...), the ones TypeScript nests under a braced @param {object} obj included.

Keyed by the sub-path relative to this parameter — @param obj.prop becomes {prop: '...'}, @param obj.a.b becomes {'a.b': '...'}, and an array element's @param arr[].prop becomes {'[].prop': '...'}. Keys are unvalidated against the parameter's actual type (matching the @mutates philosophy); absent when no dotted @param tags reference this parameter. Only populated for function/method/constructor signature parameters.

Matching is by the parameter's name, so destructured parameters (fn({a, b}: T)) are not covered — TypeScript names them __0, with no author-facing identifier for a @param key to reference.

type Record<string, string>

parseModuleJson
#

types.ts view source

also exported from index.ts

(value: unknown): ModuleJson import {parseModuleJson} from 'svelte-docinfo/types.js';

Validate a ModuleJson, restoring the defaults the wire form omits.

The stable way to validate a module or restore what compactReplacer stripped (empty arrays, false booleans), independent of the schema library behind ModuleJson.

The result is not a fresh copy: an object that needed no default is the one in value, so the result can be value itself or share objects with it, and mutating one then mutates the other.

value

a module, typically from JSON.parse of compact output

type unknown

returns

ModuleJson

the validated module with every default present

throws

  • Error - when `value` doesn't match the schema; the message lists the reported issues, one per line, as `path: message` (`declarations.1.kind: expected …, received "funtion"`), the value that failed in place of its type when it's a string, number, or boolean (an unknown key's never), the dot path omitted for an issue at the root, and ends with a line saying there may be more when it holds a hundred. The class is the schema library's (fuz_schema's `SchemaError`, the structured list on `issues`), so catch it as a plain `Error` unless you depend on fuz_schema
  • RangeError - when `value` nests deeper than the call stack allows, as a `TypeJson` tree thousands of levels deep does

Reactivity
#

types.ts view source

value + type

also exported from index.ts

"$state" | "$state.raw" | "$derived" | "$derived.by"

type "$state" | "$state.raw" | "$derived" | "$derived.by"

import {Reactivity} from 'svelte-docinfo/types.js';

Reactivity flavor for a variable declaration or class field, captured from the rune call at the initializer (e.g., let count = $state(0)).

Only the value-producing reactivity runes are represented here — $props and $bindable are modeled separately as ComponentPropJson.bindable (and prop-presence on the props array), which a legacy export let prop sets too. A renderer wanting "all rune annotations across declarations and props" needs to read both this field and ComponentPropJson.bindable.

  • $state — deeply reactive proxy
  • $state.raw — reference-only reactive (no proxy)
  • $derived — recomputed from dependencies (re-assignable)
  • $derived.by — same as $derived, with a function argument

Detection is syntactic (AST-based) and runs on every analyzed file regardless of extension. Most reactive declarations live in .svelte, .svelte.ts, or .svelte.js, but the field will also surface on any .ts/.js file that uses the same rune call patterns — by design, so documentation pipelines can capture any rune-shaped declaration their conventions choose to expose.

ReExportJson
#

types.ts view source

value + type

also exported from index.ts

ReExportJson import {ReExportJson} from 'svelte-docinfo/types.js';

A same-name re-export edge, from the re-exporting module's side.

Each entry on ModuleJson.reExports records that the module's source contains export {name} from ..., or the import-then-export form it stands for (import {name} from ...; export {name}, export default X over a default import), where the canonical declaration lives in module. This is the forward view of the same fact that alsoExportedFrom records on the canonical declaration — consumers resolve the canonical by (module, name), the same lookup contract as aliasOf.

Same-name re-exports of analyzed source only. Renamed re-exports appear as declarations with aliasOf in the re-exporting module; star exports live in ModuleJson.starExports; external re-exports in ModuleJson.externalReExports / externalStarExports. Use resolveExportSurface (in postprocess.ts) to combine all of these into a module's full export surface — it handles the name dedup (a documented same-name re-export appears both here and as a synthesized alias declaration) and the ES star semantics (explicit exports shadow star-projected ones, names ambiguous between stars are excluded, default doesn't project).

module points at the *canonical* module (multi-hop chains are resolved), not the immediate specifier in the export statement. For Svelte default-slot re-exports (export {default} from './X.svelte', or `import X from './X.svelte'; export default X), name` is the component name derived from the filename ('X'), matching the canonical declaration's name — the same exception documented on aliasOf. Because of that re-keying, two entries in one module can share a name (a re-keyed component colliding with a same-name re-export from another module); (module, name) pairs remain unique (exact duplicates are deduped at construction).

@nodocs on the export statement suppresses the entry (and the alsoExportedFrom back-link). When the canonical declaration itself is @nodocs, the entry still exists but has no matching back-link. module is always a module in the same result: a re-export whose canonical module emits nothing (gated, or outside the analyzed inputs) is a declaration with aliasOf in the re-exporting module instead, and aliasOf.module is the one field that can name a module the result doesn't contain.

A star over a module that emits nothing produces entries here too, one per projected binding whose canonical does emit, with the star statement's line and type-only-ness (see ModuleJson.starExports).

inheritance

extends: s.SchemaStrictObjectOutput<typeof ReExportJsonEntries>

name

Exported name — the canonical declaration's name in module.

type string

module

Module path (relative to sourceRoot) where the canonical declaration lives.

type string

typeOnly

Whether the statement (export type {A} from ...) or specifier (export {type A} from ...) is type-only — the name is erased at runtime and importable only via import type. A type-only *rename* carries no such marker (see aliasOf).

type boolean

sourceLine?

1-based line of the export specifier in this module's source, a positive integer. When identical (name, module) edges are deduped (Svelte default-slot re-keying), the smallest line is kept.

type number

ReExportJsonInput
#

types.ts view source

ReExportJsonInput import type {ReExportJsonInput} from 'svelte-docinfo/types.js';

The input ReExportJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput<typeof ReExportJsonEntries>

name

Exported name — the canonical declaration's name in module.

type string

module

Module path (relative to sourceRoot) where the canonical declaration lives.

type string

typeOnly?

Whether the statement (export type {A} from ...) or specifier (export {type A} from ...) is type-only — the name is erased at runtime and importable only via import type. A type-only *rename* carries no such marker (see aliasOf).

type boolean

sourceLine?

1-based line of the export specifier in this module's source, a positive integer. When identical (name, module) edges are deduped (Svelte default-slot re-keying), the smallest line is kept.

type number

SnippetDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

SnippetDeclarationJson import {SnippetDeclarationJson} from 'svelte-docinfo/types.js';

A Svelte snippet declaration exported from <script module>. Has parameters.

inheritance

extends: s.SchemaStrictObjectOutput< typeof SnippetDeclarationJsonEntries >

kind

type "snippet"

parameters

Snippet parameters.

type ParameterJson[]

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

SnippetDeclarationJsonInput
#

types.ts view source

SnippetDeclarationJsonInput import type {SnippetDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input SnippetDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof SnippetDeclarationJsonEntries >

kind

type "snippet"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

parameters?

Snippet parameters.

type ParameterJsonInput[]

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

TupleElementJson
#

types.ts view source

value + type

also exported from index.ts

TupleElementJson import {TupleElementJson} from 'svelte-docinfo/types.js';

One element of a {kind: 'tuple'} node.

optional and rest are emitted only when true, matching the tree's meaningful-absence optionality (unlike ParameterJson's defaulted booleans, so the recursive schema keeps input = output).

name?

The written label of a named tuple member ([a: string]).

type string

type

The element's type. An optional element's type has the widening undefined stripped so optional carries it alone (the enclosing flat string keeps it — see the normalization policy); a rest element's is the array it collects (...rest: boolean[] carries an array node over boolean, matching the written form), while a variadic spread of an unresolved type (...T) carries the spread type itself.

type TypeJson

optional?

The element's ? marker; emitted only when true.

type boolean

rest?

The element's ... marker; emitted only when true.

type boolean

TypeDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

TypeDeclarationJson import {TypeDeclarationJson} from 'svelte-docinfo/types.js';

A type alias declaration. Has members, externalTypes.

inheritance

extends: s.SchemaStrictObjectOutput< typeof TypeDeclarationJsonEntries >

kind

type "type"

externalTypes

External types whose contributions are filtered out of members.

Filtering is by declaration origin at every granularity — named properties, index signatures, call/construct signatures — so a purely structural external branch (an index-signature-only or callable-only interface) is recorded here exactly like a named-property bag. A declaration-less contribution (the index signature the checker synthesizes for a mapped-type instantiation like Record<string, X> or Partial<Indexed>) is kept in members and records nothing here.

Covers every composition the written type reaches: an intersection or union branch, a bare or indexed-access reference, and a type composed behind a project-local name (type Base = Bag & {…}, a local interface's extends, a local container's accessed property LocalMap['a']). Entries carry the written form with two normalizations: an identifier bound by an import rename at the definition site (import type {Bag as B}) resolves back to the name its module exports, and a type parameter bound inside the descent substitutes its written argument (interface A<T> extends ExtG<T> reached via extends A<string> records ExtG<string>). Each distinct contributor appears once, in source order; a generic reference keeps its arguments. A local name is used only when it hides a definition the walk cannot traverse — a mapped or conditional type.

Names carry no module, so the dedupe is by name alone: two *distinct* external types sharing an exported name (one from each of two packages) collapse to a single entry.

type string[]

see also

  • ``ComponentDeclarationJson.externalTypes, InterfaceDeclarationJson.externalTypes, ClassDeclarationJson.externalTypes for the same field on the other kinds, and ClassDeclarationJson.extends, ClassDeclarationJson.implements, InterfaceDeclarationJson.extends for the verbatim own-clause heritage fields. Field shapes mirror TS syntax.

members

Type members: properties (property and method signatures) first, then index signatures (string, number), then call and construct signatures.

type (FunctionMemberJson | VariableMemberJson | ConstructorMemberJson)[]

mergedValue

The exported name also carries a value meaning — a merged value+type symbol (const Foo = z.strictObject({...}) + `type Foo = z.infer<typeof Foo>`, the schema/type pattern), where the type alias wins the declaration slot and the value's own type goes undocumented. Tells consumers the name is importable as a runtime value: import {Foo}, never import type {Foo} (see generateImport).

type boolean

see also

  • ``InterfaceDeclarationJson.mergedValue``

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson). The headline case: a union alias's typeSignature prints as its own name (ColorScheme), and this field carries the enumerable members. Type aliases print as their own name for every non-interned type, so the tree is emitted there whatever its shape — the exception is object and function roots, whose content members already carries.

type TypeJson

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

TypeDeclarationJsonInput
#

types.ts view source

TypeDeclarationJsonInput import type {TypeDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input TypeDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof TypeDeclarationJsonEntries >

kind

type "type"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

externalTypes?

External types whose contributions are filtered out of members.

Filtering is by declaration origin at every granularity — named properties, index signatures, call/construct signatures — so a purely structural external branch (an index-signature-only or callable-only interface) is recorded here exactly like a named-property bag. A declaration-less contribution (the index signature the checker synthesizes for a mapped-type instantiation like Record<string, X> or Partial<Indexed>) is kept in members and records nothing here.

Covers every composition the written type reaches: an intersection or union branch, a bare or indexed-access reference, and a type composed behind a project-local name (type Base = Bag & {…}, a local interface's extends, a local container's accessed property LocalMap['a']). Entries carry the written form with two normalizations: an identifier bound by an import rename at the definition site (import type {Bag as B}) resolves back to the name its module exports, and a type parameter bound inside the descent substitutes its written argument (interface A<T> extends ExtG<T> reached via extends A<string> records ExtG<string>). Each distinct contributor appears once, in source order; a generic reference keeps its arguments. A local name is used only when it hides a definition the walk cannot traverse — a mapped or conditional type.

Names carry no module, so the dedupe is by name alone: two *distinct* external types sharing an exported name (one from each of two packages) collapse to a single entry.

type string[]

see also

  • ``ComponentDeclarationJson.externalTypes, InterfaceDeclarationJson.externalTypes, ClassDeclarationJson.externalTypes for the same field on the other kinds, and ClassDeclarationJson.extends, ClassDeclarationJson.implements, InterfaceDeclarationJson.extends for the verbatim own-clause heritage fields. Field shapes mirror TS syntax.

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson). The headline case: a union alias's typeSignature prints as its own name (ColorScheme), and this field carries the enumerable members. Type aliases print as their own name for every non-interned type, so the tree is emitted there whatever its shape — the exception is object and function roots, whose content members already carries.

type TypeJson

members?

Type members: properties (property and method signatures) first, then index signatures (string, number), then call and construct signatures.

type (FunctionMemberJsonInput | VariableMemberJsonInput | ConstructorMemberJsonInput)[]

mergedValue?

The exported name also carries a value meaning — a merged value+type symbol (const Foo = z.strictObject({...}) + `type Foo = z.infer<typeof Foo>`, the schema/type pattern), where the type alias wins the declaration slot and the value's own type goes undocumented. Tells consumers the name is importable as a runtime value: import {Foo}, never import type {Foo} (see generateImport).

type boolean

see also

  • ``InterfaceDeclarationJson.mergedValue``

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

TypeJson
#

types.ts view source

value + type

also exported from index.ts

TypeJson

type { kind: "intrinsic"; text: string; } | { kind: "literal"; value: string | number | boolean; text: string; } | { kind: "reference"; name: string; module?: string | undefined; typeArgs?: TypeJson[] | undefined; } | { kind: "array"; element: TypeJson; readonly?: boolean | undefined; } | { kind: "tuple"; elements?: TupleElementJson[] | undefined; readonly?: boolean | undefined; } | { kind: "union"; alias?: string | undefined; members: TypeJson[]; } | { kind: "intersection"; alias?: string | undefined; members: TypeJson[]; } | { kind: "function"; text: string; } | { kind: "object"; text: string; } | { kind: "other"; text: string; }

import {TypeJson} from 'svelte-docinfo/types.js';

Structured type information — the machine-readable counterpart to the flat type strings (ParameterJson.type, ComponentPropJson.type, the typeSignature fields that carry a typeInfo sibling, and returnType beside returnTypeInfo).

Absence contract: the field holding a TypeJson is absent when the flat string is the whole story — the type is terminal at the root (an intrinsic, a plain object literal, a function type, a bare named reference). Present only when the node carries structure the string can't: union/intersection members, reference type arguments, enumerable literals; an array or tuple qualifies when an element does (readonly alone doesn't — the flat string carries it, except at alias roots where the relaxation emits the tree regardless). A reference over the *empty* tuple is the one instantiation that doesn't qualify: Snippet<[]> prints itself in full, so the tree would wrap nothing (Snippet<[a: string]> still qualifies — its tuple has elements). Nested nodes inside a present tree are always populated (they have no flat-string sibling).

One exception, on TypeDeclarationJson for type aliases: the checker prints an aliased type as its bare alias name, so type StrArr = string[] has typeSignature: "StrArr" — no flat sibling to defer to. There the tree is emitted whatever its shape, except for object and function roots, whose content the declaration's own members already carries. Interned types (intrinsics, literals) don't carry an alias symbol and print structurally, so type Str = string is still absent.

Expansion policy: unions and intersections recurse into members; named references keep name plus recursive typeArgs; arrays carry their element; tuples carry elements (label, ?/... markers, recursive type); both mark readonly when written so (readonly Tome[], ReadonlyArray<Tome>, readonly [a, b]). Everything else is terminal: object literals, function types, and unclassified types (type parameters, conditional types, module objects) carry only text. Object property maps are deliberately not expanded. Recursion is depth-capped; nodes past the cap degrade to {kind: 'other', text}.

Alias policy: alias is emitted whenever the checker reports an alias symbol, root or nested — for a root node it may duplicate the flat string (type: "ColorScheme" beside alias: "ColorScheme"), which is accepted for uniformity: nested nodes have no flat sibling, and consumers get one lookup key (alias on composites, name on references) at any depth. This covers the composite kinds only. An aliased object type becomes a reference under its alias name.

svelte2tsx-generated aliases don't count. A component whose props have no name of their own (an inline $props() annotation, a JS component's JSDoc) types them through svelte2tsx's $$ComponentProps, which nothing exports; a legacy component with slots, through the shims' __sveltets_2_PropsWithChildren. The tree treats those aliases as absent: they're never a name or alias, a project alias over one (type P = ComponentProps<typeof Button>) recovers like any alias-lost type (below), and where nothing recovers the structure is expanded. A root whose flat string is the generated name, bare or as an array or tuple element ($$ComponentProps[]), keeps its tree, except object and function roots of a type alias, whose members carry them. The flat strings still print $$ComponentProps. Generated names inside a terminal node's text ({ a: $$ComponentProps; }, or an other node past the depth cap) are printed as the checker prints them.

Callable classification: callability is the load-bearing renderer signal, so anything with a call signature is a function node — with one narrow exception: a *named generic instantiation* (checker Reference-flagged, symbol-named, carrying type arguments) classifies as a reference even when callable, so Snippet<[a: string]> is a reference whose tuple typeArg carries real elements, and an alias over one, nested, references by the alias name (type MySnippet = Snippet<[string]> in a union is {kind: 'reference', name: 'MySnippet'}; at its own declaration root the self-alias skip applies and the Snippet reference shows through). Bare signatures (() => void), aliased function types, and anonymous or hybrid callables — non-generic callable interfaces included — stay function, so their name survives only inside text (type Handler = (e: Event) => void nested in a union is {kind: 'function', text: 'Handler'}, which a whole-string type-link lookup still resolves, but a structural walk can't distinguish from a printed signature).

Normalization: the optional-widening undefined member is dropped from a root union like the flat string drops it (optional: true carries it) — but the flat string strips at the top level only, while the tree strips at every optional-flagged position it expands, so Snippet<[a: string, b?: number]> prints b?: number | undefined while the tuple element reports number with optional: true. Treat typeSignature as the checker's canonical rendering and the structured fields as normalized. At property sites the strip applies only when the checker widened: under exactOptionalPropertyTypes an author-written undefined on an optional property is kept (parameters and tuple elements always strip). Separately, a true | false literal pair collapses to the boolean intrinsic (the checker expands boolean inside unions). A union reduced to one member by either rule becomes that member directly, never a 1-member union.

Terminal text fields are printed with NoTruncation up to a 1000-char budget, past which the checker's own elided rendering is used — so text is always a well-formed type string, and one node can't grow without bound the way the depth cap prevents for the tree. The flat strings keep the checker's default ~160-char truncation throughout (they are the checker's canonical rendering; see getTypeSignature). The budget bites only on types whose alias TypeScript dropped — an alias over an indexed access or conditional (z.infer<typeof S>, valibot's InferOutput) carries no alias symbol, so the checker expands its whole structure at every use.

Written-name recovery: at each annotated position, each bare type reference is resolved by checker type identity, and a type the checker has no name for — the alias-dropped shapes above — emits {kind: 'reference', name} instead of expanding, alias-lost unions and intersections included. The annotated positions: return types (per overload too), parameters, variables, type-alias declarations, properties of type aliases, interfaces, and classes, index signatures, accessors (the getter's return, else a setter-only accessor's parameter), component props, and snippet parameters. The name resolves through import aliases to the importable one (import {Original as Renamed} recovers Original); a name the checker has is never overridden; typeof queries, import types, inline type literals, and argument-carrying references (z.infer<typeof S> itself, Extract<D, {kind: K}> — whose bare symbol name would misrepresent the instantiation) never recover. A recovered bare reference is emitted even at the root, relaxing the absence contract the way alias roots do: a checker-named bare reference defers to a flat sibling printing the same name, while a recovered one stands against the anonymous expansion, so the name exists only in the tree. Both recovery channels still fire at the depth cap, so a capped alias-lost type emits its reference instead of elided text. A lost union written as one member of a larger union (LostUnion | null, 'z' | LostUnion) recovers as one reference member at its written position, though the checker flattens its members into the outer union: the written reference is the only trace left, so this needs a written union (at the site, or an alias right-hand side like type Opt = LostUnion | null, which then recovers at every use). It falls back to the expanded members when they don't all survive as distinct members — string absorbing a literal member (LostUnion | string), or a member written earlier overlapping one ('a' | LostUnion) — and for a lost union that includes undefined at an optional position, whose undefined the widening strip removed, since the member-set match can't tell that strip from a type operator removing undefined (Exclude<LostUnion, undefined>).

Registry recovery: behind the written channel, unannotated positions recover through the analyzed set's alias registry — any exported, non-@nodocs, non-generic lost alias of an emitted module, matched by checker type identity. A registry-recovered reference additionally carries module, the declaring module's ModuleJson.path — provenance for collision-exact linking, and always an emitted module (gated modules never register), so a consumer lookup by (module, name) can't dangle. module appears only on registry-recovered references: written-channel recoveries name whatever the author wrote (which may not be the registry's winner), and checker-named references and alias-carrying union/intersection nodes carry no provenance. Consumers must handle absence.

Member order and nested aliases: union members follow the written order wherever a written union node is recoverable: the alias declaration's right-hand side for a non-generic aliased union (covering every use, inferred ones included), else the annotation at the site. null/undefined still sink last, and a member written as a named sub-union survives as its own alias-carrying union node (ColorScheme stays nested, not flattened literals) when the checker kept it grouped, and a written lost union as its recovered reference (see written-name recovery). Elsewhere — inferred unions, keyof, mapped and conditional results, generic alias instantiations — members follow the checker's internal order, which depends on type-creation history and can shift with unrelated edits. Flat strings always print in the checker's order, so tree and flat string can list the same members in different orders (written ColorScheme | number prints number | ColorScheme); the tree is the one to read for author intent, such as control options. One edge: the site lookup matches by member set, so a union takes the order (and lost-union grouping) of the first union written over the same members anywhere in that annotation — two written unions in different orders (['a' | 'b', 'b' | 'a']) both read "a" | "b", and an unwritten one there (Exclude<…>) borrows a written one's order.

VariableDeclarationJson
#

types.ts view source

value + type

also exported from index.ts

VariableDeclarationJson import {VariableDeclarationJson} from 'svelte-docinfo/types.js';

A variable declaration. Has optional reactivity for top-level rune-module exports (e.g., export let count = $state(0) in .svelte.ts or <script module>).

inheritance

extends: s.SchemaStrictObjectOutput< typeof VariableDeclarationJsonEntries >

kind

type "variable"

alsoExportedFrom

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

reactivity?

Rune flavor when this variable is initialized with a value-producing reactivity rune.

type "$state" | "$state.raw" | "$derived" | "$derived.by"

defaultValue?

Default value documented via @default, verbatim tag text with no normalization. Useful when the AST initializer is opaque (a call expression, computed value) and the author wants to document the conceptual default.

type string

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson).

type TypeJson

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

VariableDeclarationJsonInput
#

types.ts view source

VariableDeclarationJsonInput import type {VariableDeclarationJsonInput} from 'svelte-docinfo/types.js';

The input VariableDeclarationJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof VariableDeclarationJsonEntries >

kind

type "variable"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

reactivity?

Rune flavor when this variable is initialized with a value-producing reactivity rune.

type "$state" | "$state.raw" | "$derived" | "$derived.by"

defaultValue?

Default value documented via @default, verbatim tag text with no normalization. Useful when the AST initializer is opaque (a call expression, computed value) and the author wants to document the conceptual default.

type string

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson).

type TypeJson

alsoExportedFrom?

Module paths (relative to sourceRoot) that re-export this declaration under the same name. The canonical declaration lives in this module's declarations array; these paths are additional import locations for the same thing.

The same edges appear from the re-exporting side as ModuleJson.reExports — use that when asking "what does this module re-export" instead of inverting these arrays. The two can disagree at the margins: a reExports entry whose canonical declaration is @nodocs (or whose module isn't in the analyzed set) has no back-link here.

Consumer note: To build a complete re-export map, scan two fields:

  1. alsoExportedFrom on each declaration — same-name re-exports
  2. aliasOf on declarations — renamed re-exports (separate declarations)

type string[]

aliasOf?

For renamed re-exports (export {foo as bar}), points to the original declaration. This declaration's name is the alias; aliasOf.name is the original name.

For renames out of the default slot (export {default as bar} from './x' where ./x is export default ...), aliasOf.name is 'default' — the canonical's actual symbol name. Consumers locate the canonical by (aliasOf.module, aliasOf.name).

Svelte component exception: when the source is a .svelte file (e.g., export {default as Foo} from './X.svelte'), the canonical's name is the component name (derived from the filename), so aliasOf.name is the component name ('X'), NOT 'default'. Consumers that branch on aliasOf.name === 'default' to detect default-rename should additionally check whether aliasOf.module ends with .svelte.

Different from alsoExportedFrom: aliases create new API surface names, while alsoExportedFrom tracks additional import paths for the same name.

A type-only rename of a value (export type {someConst as c} from './x') synthesizes a normal alias — declarations carry no type-only marker.

type { module: string; name: string; }

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

VariableMemberJson
#

types.ts view source

value + type

also exported from index.ts

VariableMemberJson import {VariableMemberJson} from 'svelte-docinfo/types.js';

A variable member (property, accessor, index signature, enum value). Shared fields plus optional reactivity for class fields initialized with a Svelte rune ($state, $state.raw, $derived, $derived.by).

optional reflects a ? token on the declaration (e.g., x?: string). Always false for index signatures and enum values.

inheritance

extends: s.SchemaStrictObjectOutput< typeof VariableMemberJsonEntries >

kind

type "variable"

optional

Whether the member has a ? token in its declaration.

type boolean

partial

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples

Code examples from @example tags.

type string[]

seeAlso

Related items from @see tags, in raw TSDoc format.

type string[]

throws

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

modifiers

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

genericParams

Generic type parameters like <T, U>.

type GenericParamJson[]

reactivity?

Rune flavor when this field is initialized with a value-producing reactivity rune.

type "$state" | "$state.raw" | "$derived" | "$derived.by"

defaultValue?

Default value documented via @default, verbatim tag text with no normalization. Initializers aren't captured — a class field's typeSignature is its checker type, not its initializer.

type string

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson). Member types are checker-backed everywhere — type-alias and interface properties and index signatures, class properties (annotated or inferred), and accessors (getter-backed or setter-only) all resolve through the checker, with written annotations feeding name recovery.

type TypeJson

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

VariableMemberJsonInput
#

types.ts view source

VariableMemberJsonInput import type {VariableMemberJsonInput} from 'svelte-docinfo/types.js';

The input VariableMemberJson parses, with any field it defaults optional.

inheritance

extends: s.SchemaStrictObjectInput< typeof VariableMemberJsonEntries >

kind

type "variable"

name

The exported name. Always populated. The default-export slot is named 'default', except a Svelte component, which takes its filename-derived name ('X' for X.svelte) — 'default' is the symbol's actual name in JS (import {default as X} and ns.default both expose it directly), and import X from 'mod' is sugar for import {default as X}. Consumers branch on name === 'default' to render the sugar form when desired.

type string

optional?

Whether the member has a ? token in its declaration.

type boolean

reactivity?

Rune flavor when this field is initialized with a value-producing reactivity rune.

type "$state" | "$state.raw" | "$derived" | "$derived.by"

defaultValue?

Default value documented via @default, verbatim tag text with no normalization. Initializers aren't captured — a class field's typeSignature is its checker type, not its initializer.

type string

typeInfo?

Structured type; absent when typeSignature is the whole story (see TypeJson). Member types are checker-backed everywhere — type-alias and interface properties and index signatures, class properties (annotated or inferred), and accessors (getter-backed or setter-only) all resolve through the checker, with written annotations feeding name recovery.

type TypeJson

partial?

Whether extraction failed partway through, leaving some fields missing (e.g., typeSignature, parameters).

type boolean

examples?

Code examples from @example tags.

type string[]

deprecatedMessage?

Deprecation message from @deprecated tag.

type string

seeAlso?

Related items from @see tags, in raw TSDoc format.

type string[]

throws?

Exceptions from @throws tags.

type { description: string; type?: string | undefined; }[]

since?

Version introduced, from @since tag.

type string

internalMessage?

Internal-API marker from the @internal tag. Presence means the tag was written; an empty string is a bare tag with no trailing prose.

A marker, not an exclusion: @internal means "not stable public API" (TSDoc semantics) while the declaration, member, or prop stays documented — unlike @nodocs, which removes a declaration from output entirely (and is ignored on props and members).

type string

mutates?

Mutation documentation from @mutates tags (non-standard), mapping keys to descriptions.

Keys are intentionally unvalidated — typically a parameter name, but authors may also use compound paths (this.foo, obj.field) or multi-word external state references. Backticks are stripped from keys so `` a `` and a normalize to one key; an empty-string value is a bare tag with no description. The schema accepts any string key so consumers can render whatever the author wrote.

On a component prop it declares the component's mutation contract for the value it's handed: the component writes into the prop's object or array in place (@mutates items - appends the selected entry, @mutates options.cache - fills on first render). Reassigning a prop is not a mutation in this sense (bindable covers it), though a $bindable prop can carry both.

type Record<string, string>

docComment?

JSDoc/TSDoc comment.

type string

typeSignature?

Full TypeScript type signature.

type string

modifiers?

TypeScript modifiers like readonly, static, or protected.

type ("public" | "protected" | "readonly" | "static" | "abstract" | "getter" | "setter")[]

sourceLine?

1-based line in the source file, a positive integer. Synthesized aliases (see aliasOf) carry the local export specifier's line, not the canonical's.

type number

genericParams?

Generic type parameters like <T, U>.

type GenericParamJsonInput[]

Depends on
#

Imported by
#