declaration.svelte.ts

view source

Declarations
#

Declaration
#

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

module

type Module

readonly $state.raw

declaration_json

type DeclarationJsonInput

readonly $state.raw

library

type Library

$derived

module_path

Module path where this declaration is defined.

type string

$derived

name

type string

$derived

kind

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

$derived

url_github

GitHub source URL with line number.

type string | undefined

$derived

url_api

API documentation URL.

type string

$derived

import_statement

Generated TypeScript import statement.

type string

$derived

url_api_full

Public documentation link (if homepage_url is available).

type string | undefined

$derived

display_name

Display name with generic parameters.

type string

$derived

type_signature

type string | undefined

$derived

doc_comment

type string | undefined

$derived

deprecated_message

type string | undefined

$derived

parameters

type { name: string; type: string; optional?: boolean | undefined; rest?: boolean | undefined; description?: string | undefined; defaultValue?: string | undefined; propertyDescriptions?: Record<...> | undefined; }[] | undefined

$derived

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

$derived

return_type

type string | undefined

$derived

return_description

type string | undefined

$derived

generic_params

type { name: string; constraint?: string | undefined; defaultType?: string | undefined; }[]

$derived

extends_type

type string | string[] | undefined

$derived

implements_types

type string[] | undefined

$derived

throws

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

$derived

since

type string | undefined

$derived

examples

type string[]

$derived

see_also

type string[]

$derived

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...

$derived

intersects

Intersection types whose properties are external (filtered out of props/members). Present on component and type kinds.

type string[] | undefined

$derived

accepts_children

Whether a component accepts children via props or template usage. Present on component kind only.

type boolean | undefined

$derived

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?: { ...;...

$derived

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

$derived

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

$derived

mutates

Mutation documentation from @mutates tags, mapping parameter names to descriptions.

type Record<string, string> | undefined

$derived

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

$derived

has_examples

type boolean

$derived

is_deprecated

type boolean

$derived

has_documentation

type boolean

$derived

has_parameters

type boolean

$derived

has_props

type boolean

$derived

has_generics

type boolean

$derived

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

type Module

declaration_json

type { 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...

Depends on
#

Imported by
#