declaration.svelte.ts view source
import {Declaration} from '@fuzdev/fuz_ui/declaration.svelte.js'; Rich runtime representation of an exported declaration.
Wraps svelte-docinfo's DeclarationJson discriminated union (on kind)
with Svelte 5 reactive derivations and computed URLs.
Kind-specific fields are accessed via the field() helper since
not all fields exist on all variants.
see also
{@linkhttps://github.com/ryanatkn/svelte-docinfo svelte-docinfo} for the analysis library``DeclarationDetail.svelte`` for the rendering component
module
type Module
declaration_json
type DeclarationJsonInput
library
type Library
module_path
Module path where this declaration is defined.
type string
name
type string
kind
type "function" | "enum" | "type" | "class" | "variable" | "interface" | "component" | "snippet" | "namespace"
url_github
GitHub source URL with line number.
type string | undefined
url_api
API documentation URL.
type string
import_statement
Generated TypeScript import statement.
type string
url_api_full
Public documentation link (if homepage_url is available).
type string | undefined
display_name
Display name with generic parameters.
type string
type_signature
type string | undefined
doc_comment
type string | undefined
deprecated_message
type string | undefined
parameters
type { name: string; type: string; optional?: boolean | undefined; rest?: boolean | undefined; description?: string | undefined; defaultValue?: string | undefined; propertyDescriptions?: Record<...> | undefined; }[] | undefined
props
type { name: string; type: string; examples?: string[] | undefined; deprecatedMessage?: string | undefined; seeAlso?: string[] | undefined; throws?: { description: string; type?: string | undefined; }[] | undefined; ... 5 more ...; parameters?: { ...; }[] | undefined; }[] | undefined
return_type
type string | undefined
return_description
type string | undefined
generic_params
type { name: string; constraint?: string | undefined; defaultType?: string | undefined; }[]
extends_type
type string | string[] | undefined
implements_types
type string[] | undefined
throws
type { description: string; type?: string | undefined; }[]
since
type string | undefined
examples
type string[]
see_also
type string[]
members
Nested members for classes, interfaces, types, and enums.
type ({ kind: "function"; name: string; optional?: boolean | undefined; returnType?: string | undefined; returnDescription?: string | undefined; parameters?: { name: string; type: string; ... 4 more ...; propertyDescriptions?: Record<...> | undefined; }[] | undefined; ... 12 more ...; genericParams?: { ...; }[] | undefin...
intersects
Intersection types whose properties are external (filtered out of props/members).
Present on component and type kinds.
type string[] | undefined
accepts_children
Whether a component accepts children via props or template usage.
Present on component kind only.
type boolean | undefined
overloads
Function overload signatures when multiple public overloads exist.
Present on function and snippet kinds, and on function/constructor members.
type { typeSignature: string; parameters?: { name: string; type: string; optional?: boolean | undefined; rest?: boolean | undefined; description?: string | undefined; defaultValue?: string | undefined; propertyDescriptions?: Record<...> | undefined; }[] | undefined; returnType?: string | undefined; genericParams?: { ...;...
alias_of
Re-export alias info when this declaration is a renamed re-export.
type { module: string; name: string; } | { module: string; name: string; } | { module: string; name: string; } | { module: string; name: string; } | { module: string; name: string; } | { module: string; name: string; } | { ...; } | { ...; } | { ...; } | undefined
also_exported_from
Other modules that also export this declaration (re-export paths
relative to src/lib). Absent when only exported from its defining module.
The back-link of those modules' Module.re_exports edges.
type string[] | undefined
mutates
Mutation documentation from @mutates tags, mapping parameter names to descriptions.
type Record<string, string> | undefined
reactivity
Svelte reactivity flavor ($state, $state.raw, $derived, $derived.by)
when this variable is initialized with a value-producing rune.
Present on variable kind only.
type "$state" | "$state.raw" | "$derived" | "$derived.by" | undefined
has_examples
type boolean
is_deprecated
type boolean
has_documentation
type boolean
has_parameters
type boolean
has_props
type boolean
has_generics
type boolean
constructor
type new (module: Module, declaration_json: { kind: "function"; name: string; returnType?: string | undefined; returnDescription?: string | undefined; parameters?: { name: string; type: string; optional?: boolean | undefined; rest?: boolean | undefined; description?: string | undefined; defaultValue?: string | undefined; propertyDescriptions?: Record<...> | undefined; }[] | undefined; ... 14 more ...; genericParams?: { ...; }[] | undefined; } | ... 7 more ... | { ...; }): Declaration
module
declaration_json
{ kind: "function"; name: string; returnType?: string | undefined; returnDescription?: string | undefined; parameters?: { name: string; type: string; optional?: boolean | undefined; rest?: boolean | undefined; description?: string | undefined; defaultValue?: string | undefined; propertyDescriptions?: Record<...> | u...