api #

Declarations
#

Svelte UI library

264 declarations

Alert
#

alert_status_options
#

AlertStatus
#

AlertStatusOptions
#

ApiDeclarationList
#

ApiIndex
#

ApiIndex.svelte view source

library?

The library instance to render API docs for. Defaults to getting from library_context.

type Library
optional

tome?

The tome for the API docs page. Defaults to looking up the 'api' tome.

type Tome
optional

minimal?

Whether to show minimal content (just a link to full API docs). Used when the API index is shown on a parent docs page.

type boolean
optional

ApiModule
#

ApiModule.svelte view source

module_path

The module path parameter from the route (e.g., "lib/Button.svelte").

type string | Array<string>

library?

The library instance to render API docs for. Defaults to getting from library_context.

type Library
optional

tome?

The tome for the API docs page. Defaults to looking up the 'api' tome.

type Tome
optional

belt_logo
#

Breadcrumb
#

Card
#

Card.svelte view source

tag?

type string | undefined
optional

href?

type string | undefined
optional

align?

type 'left' | 'right' | 'above' | 'below'
optional

attrs?

type any
optional

icon?

type string | Snippet
optional

children

type Snippet

chatgpt_logo
#

claude_logo
#

COLOR_SCHEME_SCRIPT_HASH
#

COLOR_SCHEME_STORAGE_KEY
#

ColorSchemeInput
#

Contextmenu
#

contextmenu_attachment
#

contextmenu_state.svelte.ts view source

<T extends ContextmenuParams, U extends T | Array<T>>(params: U | null | undefined): Attachment<HTMLElement | SVGElement>

Creates an attachment that sets up contextmenu behavior on an element.

params

Contextmenu parameters or nullish to disable

type U | null | undefined

returns

Attachment<HTMLElement | SVGElement>

contextmenu_calculate_constrained_x
#

contextmenu_helpers.ts view source

(menu_x: number, menu_width: number, layout_width: number): number

menu_x

type number

menu_width

type number

layout_width

type number

returns

number

contextmenu_calculate_constrained_y
#

contextmenu_helpers.ts view source

(menu_y: number, menu_height: number, layout_height: number): number

menu_y

type number

menu_height

type number

layout_height

type number

returns

number

contextmenu_check_global_root
#

contextmenu_state.svelte.ts view source

(get_scoped: () => boolean): void

Registers a contextmenu root and warns if multiple non-scoped roots are detected. Only active in development mode. Automatically handles cleanup on unmount.

get_scoped

Getter function that returns the current scoped value

type () => boolean

returns

void

contextmenu_context
#

contextmenu_state.svelte.ts view source

{ get: (error_message?: string | undefined) => ContextmenuState; get_maybe: () => ContextmenuState | undefined; set: (value: ContextmenuState) => ContextmenuState; }

contextmenu_create_keyboard_handlers
#

contextmenu_create_keydown_handler
#

contextmenu_helpers.ts view source

(keyboard_handlers: Map<string, () => void>): (e: KeyboardEvent) => void

keyboard_handlers

type Map<string, () => void>

returns

(e: KeyboardEvent) => void

CONTEXTMENU_DEFAULT_BYPASS_MOVE_TOLERANCE
#

CONTEXTMENU_DEFAULT_BYPASS_WINDOW
#

CONTEXTMENU_DEFAULT_LONGPRESS_DURATION
#

CONTEXTMENU_DEFAULT_LONGPRESS_MOVE_TOLERANCE
#

CONTEXTMENU_DEFAULT_OPEN_OFFSET_X
#

CONTEXTMENU_DEFAULT_OPEN_OFFSET_Y
#

contextmenu_dimensions_context
#

contextmenu_is_valid_target
#

contextmenu_helpers.ts view source

(target: EventTarget | null, shiftKey: boolean): target is HTMLElement | SVGElement

Returns true if valid and narrows the type to HTMLElement | SVGElement.

target

type EventTarget | null

shiftKey

type boolean

returns

boolean

contextmenu_open
#

contextmenu_state.svelte.ts view source

(target: HTMLElement | SVGElement, x: number, y: number, contextmenu: ContextmenuState, options?: ContextmenuOpenOptions | undefined): boolean

Opens the contextmenu, if appropriate, querying the menu items from the DOM starting at the event target.

target

the leaf element from which to open the contextmenu

type HTMLElement | SVGElement

x

the page X coordinate at which to open the contextmenu, typically the mouse pageX

type number

y

the page Y coordinate at which to open the contextmenu, typically the mouse pageY

type number

contextmenu

the contextmenu store

options?

optional configuration for filtering entries and haptic feedback

type ContextmenuOpenOptions | undefined
optional

returns

boolean

a boolean indicating if the menu was opened or not

contextmenu_submenu_context
#

contextmenu_state.svelte.ts view source

{ get: (error_message?: string | undefined) => SubmenuState; get_maybe: () => SubmenuState | undefined; set: (value: SubmenuState) => SubmenuState; }

ContextmenuActivateResult
#

ContextmenuEntry
#

ContextmenuLinkEntry
#

ContextmenuLinkEntry.svelte view source

href

type string

icon?

type string | Snippet
optional

children?

type Snippet
optional

disabled?

type boolean
optional

external_rel?

type string
optional

ContextmenuOpenOptions
#

ContextmenuParams
#

ContextmenuRoot
#

ContextmenuRoot.svelte view source

Touch event handler for tap-then-longpress bypass detection.

This allows users to access the native context menu by performing a tap followed by a longpress/rightclick within a specified time window. The bypass gesture is useful for accessing browser features like text selection or the native context menu when the Fuz contextmenu would normally override it.

Note: preventDefault is not called as we're only observing touch patterns, not intercepting them. The actual bypass happens in on_window_contextmenu.

contextmenu?

The contextmenu prop is not reactive because that's a rare corner case and it's easier to put the contextmenu directly in the context rather than wrapping with a store or other reactivity. If you need to change the contextmenu prop for some reason, use a {#key contextmenu} block: https://svelte.dev/docs#template-syntax-key

optional

open_offset_x?

The number of pixels to offset from the pointer X position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional

open_offset_y?

The number of pixels to offset from the pointer Y position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional

bypass_with_tap_then_longpress?

Whether to detect tap-then-longpress to bypass the Fuz contextmenu. This allows access to the system contextmenu by tapping once then rightclicking/long-pressing. Setting to false disables the gesture.

type boolean
optional

bypass_window?

The number of milliseconds between taps to detect a gesture that bypasses the Fuz contextmenu. Used only when bypass_with_tap_then_longpress is true. If the duration is too long, it'll detect more false positives and interrupt normal usage, but too short and some people will have difficulty performing the gesture.

type number
optional

bypass_move_tolerance?

The number of pixels the pointer can be moved between taps to detect a tap-then-longpress. Used only when bypass_with_tap_then_longpress is true.

type number
optional

scoped?

If true, wraps children with a div and listens to events on it instead of the window.

type boolean
optional

link_entry?

Snippet for rendering link entries. Set to null to disable automatic link detection. Defaults to link_entry_default which renders ContextmenuLinkEntry.

type Snippet<[ComponentProps<typeof ContextmenuLinkEntry>]> | null
optional

text_entry?

Snippet for rendering copy text entries. Set to null to disable automatic copy text detection. Defaults to text_entry_default which renders ContextmenuTextEntry.

type Snippet<[ComponentProps<typeof ContextmenuTextEntry>]> | null
optional

separator_entry?

Snippet for rendering separator entries. Set to null to disable automatic separator rendering. Defaults to separator_entry_default which renders ContextmenuSeparator.

type Snippet<[ComponentProps<typeof ContextmenuSeparator>]> | null
optional

children

type Snippet

ContextmenuRootForSafariCompatibility
#

ContextmenuRootForSafariCompatibility.svelte view source

Blocks the next click event. Set to true when a longpress completes to prevent iOS's synthesized click from activating the first menu item.

contextmenu?

The contextmenu prop is not reactive because that's a rare corner case and it's easier to put the contextmenu directly in the context rather than wrapping with a store or other reactivity. If you need to change the contextmenu prop for some reason, use a {#key contextmenu} block: https://svelte.dev/docs#template-syntax-key

optional

longpress_move_tolerance?

The number of pixels the pointer can be moved without canceling longpress.

type number
optional

longpress_duration?

The number of milliseconds after a touch starts before opening the Fuz contextmenu.

type number
optional

bypass_with_tap_then_longpress?

Whether to detect tap-then-longpress to bypass the Fuz contextmenu. This allows access to the system contextmenu by tapping once then long-pressing. Setting to false disables the gesture.

type boolean
optional

bypass_window?

The number of milliseconds between taps to detect a gesture that bypasses the Fuz contextmenu. Used only when bypass_with_tap_then_longpress is true. If the duration is too long, it'll detect more false positives and interrupt normal usage, but too short and some people will have difficulty performing the gesture.

type number
optional

bypass_move_tolerance?

The number of pixels the pointer can be moved between taps to detect a tap-then-longpress. Used only when bypass_with_tap_then_longpress is true.

type number
optional

open_offset_x?

The number of pixels to offset from the pointer X position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional

open_offset_y?

The number of pixels to offset from the pointer Y position when opened. Useful to ensure the first menu item is immediately under the pointer.

type number
optional

scoped?

If true, wraps children with a div and listens to events on it instead of the window.

type boolean
optional

link_entry?

Snippet for rendering link entries. Set to null to disable automatic link detection. Defaults to link_entry_default which renders ContextmenuLinkEntry.

type Snippet<[ComponentProps<typeof ContextmenuLinkEntry>]> | null
optional

text_entry?

Snippet for rendering copy text entries. Set to null to disable automatic copy text detection. Defaults to text_entry_default which renders ContextmenuTextEntry.

type Snippet<[ComponentProps<typeof ContextmenuTextEntry>]> | null
optional

separator_entry?

Snippet for rendering separator entries. Set to null to disable automatic separator rendering. Defaults to separator_entry_default which renders ContextmenuSeparator.

type Snippet<[ComponentProps<typeof ContextmenuSeparator>]> | null
optional

children

type Snippet

ContextmenuRun
#

ContextmenuSeparator
#

ContextmenuState
#

contextmenu_state.svelte.ts view source

Creates a contextmenu store. See usage with ContextmenuRoot.svelte and Contextmenu.svelte.

see also

layout

type Dimensions

has_custom_layout

If an initial layout is provided, control is deferred externally. Otherwise the layout syncs to the page dimensions.

type boolean

readonly

opened

type boolean

x

type number

y

type number

params

type ReadonlyArray<ContextmenuParams>

error

type string | undefined

root_menu

type RootMenuState

readonly

selections

type ReadonlyArray<ItemState>

can_collapse

can_expand

can_select_next

can_select_previous

can_activate

constructor

type new (options?: ContextmenuStateOptions): ContextmenuState

options
default EMPTY_OBJECT

open

type (params: ContextmenuParams[], x: number, y: number): void

params
type ContextmenuParams[]
x
type number
y
type number
returns void

close

type (): void

returns void

reset_items

type (items: readonly ItemState[]): void

items
type readonly ItemState[]
returns void

activate

type (item: ItemState): boolean | Promise<ContextmenuActivateResult>

item
returns boolean | Promise<ContextmenuActivateResult>

activate_selected

type (): boolean | void | Promise<ContextmenuActivateResult>

returns boolean | void | Promise<ContextmenuActivateResult>

select

Activates the selected entry, or if none, selects the first.

type (item: ItemState): void

item
returns void

collapse_selected

type (): void

returns void

expand_selected

type (): void

returns void

select_next

type (): void

returns void

select_previous

type (): void

returns void

select_first

type (): void

returns void

select_last

type (): void

returns void

add_entry

Used by ContextmenuEntry and custom entry components

type (run: () => ContextmenuRun, disabled?: () => boolean): EntryState

run
type () => ContextmenuRun
disabled
type () => boolean
default () => false
returns EntryState

add_submenu

type (): SubmenuState

returns SubmenuState

ContextmenuStateOptions
#

ContextmenuSubmenu
#

ContextmenuTextEntry
#

CopyToClipboard
#

CopyToClipboard.svelte view source

text

type string | null

copied_display_duration?

type number
optional

allow_copying_empty_string?

type boolean
optional

icon_button?

Defaults to true, ignored if children is provided.

type boolean
optional

oncopy?

type (text: string | null, e: MouseEvent) => void
optional

children?

type Snippet<[copied: boolean, failed: boolean]>
optional

create_context
#

context_helpers.ts view source

<T>(fallback: () => T): { get: () => T; set: (value?: T | undefined) => T; }

Wraps Svelte's setContext and getContext for better ergonomics. When no value is set in the context, get throws an error and get_maybe returns undefined. If a fallback is provided, the value argument to set is optional and get_maybe is omitted from the type.

fallback

type () => T

returns

{ get: () => T; set: (value?: T | undefined) => T; }

generics

T

create_csp_directives
#

csp.ts view source

(options?: CreateCspDirectivesOptions): CspDirectives

This is designed for compatibility with SvelteKit and maps to the KitConfig directives option. The goal is to provide an ergonomic, modern, and safe API for Content Security Policy (CSP) creation that's simple to write and audit, and isn't error-prone.

Things like validation and rendering to a string are out of scope and left to SvelteKit.

options

default {}

returns

CspDirectives

create_declaration_contextmenu
#

create_declaration_search
#

create_module_contextmenu
#

create_module_declaration_search
#

CreateCspDirectivesOptions
#

csp.ts view source

CreateCspDirectivesOptions

directives

Override or transform specific directives. Returning null or undefined from a transform function will remove the directive.

type { [K in CspDirective]?: | CspDirectiveValue<K> // Static value replacement | null // Removes the directive // Transform function returning one of the previous types | ((value: CspDirectiveValue<K>) => CspDirectiveValue<K> | null); }

trusted_sources

Sources to include based on their trust levels.

type Array<CspSourceSpec>

value_defaults

Override default values for specific directives, merging with value_defaults_base (or replacing if that directive is null in the base).

type Partial<typeof csp_directive_value_defaults>

value_defaults_base

Base values for directive defaults. Set to null or {} to start with no defaults. Defaults to csp_directive_value_defaults.

type Partial<typeof csp_directive_value_defaults> | null

required_trust_defaults

Override trust requirements for specific directives, merging with required_trust_defaults_base (or replacing if that directive is null in the base).

type Partial<typeof csp_directive_required_trust_defaults>

required_trust_defaults_base

Base values for directive trust requirements. Set to null or {} to start with no trust requirements. Defaults to csp_directive_required_trust_defaults.

type Partial<typeof csp_directive_required_trust_defaults> | null

csp_directive_required_trust_defaults
#

csp.ts view source

Record<keyof CspDirectives, "low" | "medium" | "high" | null>

Sources that meet this trust requirement are included for it by default. If null, no trusted sources are added to the directive automatically. Directives that don't support sources or default to ['none'] are null.

Feedback is welcome, please see the issues - https://github.com/ryanatkn/fuz/issues

csp_directive_spec_by_name
#

csp_directive_specs
#

csp_directive_value_defaults
#

csp.ts view source

Record<keyof CspDirectives, boolean | (CspSource | CspActionSource)[] | CspSources | CspFrameSource[] | string[] | "script"[] | ("allow-downloads-without-user-activation" | ... 11 more ... | "allow-top-navigation-by-user-activation")[] | null>

The base CSP directive defaults. Prioritizes safety but loosens around media and styles, relying on defense-in-depth. Customizable via CreateCspDirectivesOptions.defaults.

csp_trust_level_value
#

csp.ts view source

Record<"low" | "medium" | "high", number | undefined>

Numeric values for CSP trust levels, csp_trust_levels. Lower is less trusted. Includes undefined in the type for safety.

csp_trust_levels
#

csp_trusted_sources_of_ryanatkn
#

CspActionSource
#

CspBaseSource
#

CspCryptoSource
#

csp.ts view source

`nonce-${string}` | `sha256-${string}` | `sha384-${string}` | `sha512-${string}`

CspDirective
#

CspDirectives
#

csp.ts view source

CspDirectives

sandbox

type Array< | 'allow-downloads-without-user-activation' | 'allow-forms' | 'allow-modals' | 'allow-orientation-lock' | 'allow-pointer-lock' | 'allow-popups' | 'allow-popups-to-escape-sandbox' | 'allow-presentation' | 'allow-same-origin' | 'allow-scripts' | 'allow-storage-access-by-user-activation' | 'allow-top-navigation' | 'allow-top-navigation-by-user-activation' >

CspDirectiveSpec
#

CspDirectiveValue
#

CspFrameSource
#

CspHostNameScheme
#

CspHostProtocolSchemes
#

CspHostSource
#

csp.ts view source

`${string}.${string}` | "localhost" | `${string}.${string}:${number}` | `${string}.${string}:*` | `localhost:${number}` | "localhost:*" | `${string}://${string}.${string}` | `${string}://${string}.${string}:${number}` | `${string}://${string}.${string}:*` | `${string}://localhost` | `${string}://localhost:${number}`...

CspPortScheme
#

CspSchemeSource
#

CspSource
#

CspSources
#

CspSourceSpec
#

CspTrustLevel
#

csp.ts view source

"low" | "medium" | "high"

Trust levels for CSP sources.

With the base defaults, trust levels roughly correspond to:

- low – Passive resources only (no script execution, no styling or UI control). Examples: img-src, font-src. - medium – Content that may affect layout, styling, or embed external browsing contexts, but cannot directly run code in the page's JS execution environment or perform other high-risk actions. Examples: style-src, frame-src, frame-ancestors. - high – Sources that can execute code in the page's context or open powerful network channels. Examples: script-src, connect-src, child-src. - null – No trust. This is used for directives that don't support sources.

Declaration
#

declaration.svelte.ts view source

Rich runtime representation of an exported declaration.

module

type Module

readonly

declaration_json

type DeclarationJson

readonly

library

module_path

Module path where this declaration is defined.

name

kind

url_github

GitHub source URL with line number.

url_api

API documentation URL.

import_statement

Generated TypeScript import statement.

url_api_full

Public documentation link (if homepage_url is available).

display_name

Display name with generic parameters.

type_signature

doc_comment

deprecated_message

parameters

props

return_type

return_description

generic_params

extends

implements

throws

since

examples

see_also

members

type Array<DeclarationJson> | undefined

properties

type Array<DeclarationJson> | undefined

has_examples

is_deprecated

has_documentation

has_parameters

has_props

has_generics

constructor

type new (module: Module, declaration_json: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }): Declaration

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

DeclarationDetail
#

DeclarationLink
#

DeclarationSearchState
#

Details
#

Details.svelte view source

Like details but renders children lazily by default.

open?

type boolean
optional bindable

eager?

Children are lazily rendered by default, enabling transitions and improving performance, sometimes significantly. Pass true to render children eagerly to gain ctrl+f functionality while trading away the benefits. Consider a <details> element instead of making this component eager.

type boolean
optional

summary

type string | Snippet

summary_attrs?

type SvelteHTMLElements['summary']
optional

children

type Snippet

Dialog
#

Dialog.svelte view source

container?

type HTMLElement
optional

layout?

optional

index?

index 0 is under 1 is under 2 etc -- the topmost dialog is the last in the array

type number
optional

active?

type boolean
optional

content_selector?

If provided, prevents clicks that would close the dialog from bubbling past any elements matching this selector.

type string | null
optional

onclose?

type () => void
optional

children

type Snippet<[close: (e?: Event) => void]>

dialog_layouts
#

DialogLayout
#

DialogParams
#

dialog.ts view source

DialogParams<T>

This pattern is based on: https://github.com/ivanhofer/sveltekit-typescript-showcase/blob/main/src/01-props/09-svelte-component/Component.svelte The main limitation is that the generic cannot be inferred automatically, so we use to_dialog_params to construct instances in most cases. Definining DialogParams with no concrete T lacks typechecking for props.

generics

T

constraint Component<any>
default Component<any>

Component

type T

props

type ComponentProps<T>

dialog_props

type Partial<ComponentProps<typeof Dialog>> | undefined

Dialogs
#

Dialogs.svelte view source

dialogs

type Array<DialogParams>

onclose?

type () => void
optional

children?

type Snippet<[dialog: DialogParams]>
optional

Dimensions
#

DisconnectState
#

intersect.svelte.ts view source

DisconnectState

intersecting

type boolean

intersections

type number

el

type HTMLElement | SVGElement

observer

type IntersectionObserver

Docs
#

Docs.svelte view source

tomes

type Array<Tome>

library

type Library

breadcrumb_children?

type Snippet<[is_primary_nav: boolean]>
optional

children

type Snippet

DOCS_API_PATH
#

docs_links_context
#

DOCS_PATH
#

docs_helpers.svelte.ts view source

"/docs" | "/" | "/about" | "/docs/Alert" | "/docs/Breadcrumb" | "/docs/Breadcrumb/a" | "/docs/Breadcrumb/a/b" | "/docs/Breadcrumb/a/b/c" | "/docs/Breadcrumb/a/b/c/d" | "/docs/Card" | ... 94 more ... | `/${string}/help/`

DOCS_PATH_DEFAULT
#

docs_slugify
#

docs_helpers.svelte.ts view source

(str: string): string

Convert a string to a URL-safe fragment identifier, preserving case for API declarations. Only transforms spaces and special characters, keeping valid identifier characters intact. Used for hash anchors in documentation.

str

- The string to convert to a fragment

type string

returns

string

A URL-safe fragment identifier

DocsContent
#

DocsContent.svelte view source

tomes

type Array<Tome>

library

type Library

repo_name?

type Snippet<[repo_name: string]>
optional

content?

type Snippet
optional

header?

type Snippet
optional

DocsFooter
#

DocsFooter.svelte view source

library

type Library

root_url?

type Url | null
optional

logo?

type Snippet
optional

logo_header?

type Snippet
optional

logo_footer?

type Snippet
optional

children?

type Snippet
optional

DocsLink
#

DocsLinkInfo
#

docs_helpers.svelte.ts view source

DocsLinkInfo

id

type string

text

type string

fragment

type string

tag

type DocsLinkTag | undefined

depth

type number

order

type number

parent_id

type string | undefined

DocsLinks
#

DocsLinkTag
#

DocsList
#

DocsList.svelte view source

expand_width?

type boolean
optional

margin?

type boolean
optional

class?

type string
optional

children

type Snippet

DocsMenu
#

DocsMenu.svelte view source

tomes

type Array<Tome>

children?

type Snippet<[category: string]>
optional

expand_width?

type boolean
optional

DocsMenuHeader
#

DocsModulesList
#

DocsPageLinks
#

DocsPrimaryNav
#

DocsSearch
#

DocsSearch.svelte view source

placeholder?

type string
optional

total_count

type number

result_count?

type number
optional

search_query

type string
bindable

DocsSecondaryNav
#

DocsTertiaryNav
#

earbetter_logo
#

EcosystemLinks
#

EcosystemLinksPanel
#

effect_with_count
#

rune_helpers.svelte.ts view source

(fn: (count: number) => void, initial?: number): void

Runs fn in an $effect, passing true as the skip argument for the first count runs. Calls fn even when skipping so callers can read any dependent signals.

fn

type (count: number) => void

initial

type number
default 0

returns

void

EntryState
#

contextmenu_state.svelte.ts view source

is_menu

readonly

menu

type SubmenuState | RootMenuState

readonly

run

type () => ContextmenuRun

readonly

disabled

type () => boolean

readonly

selected

type boolean

pending

type boolean

error_message

type string | null

promise

type Promise<ContextmenuActivateResult> | null

constructor

type new (menu: SubmenuState | RootMenuState, run: () => ContextmenuRun, disabled?: () => boolean): EntryState

menu
type SubmenuState | RootMenuState
run
type () => ContextmenuRun
disabled
type () => boolean
default () => false

fuz_blog_logo
#

fuz_code_logo
#

fuz_gitops_logo
#

fuz_logo
#

fuz_mastodon_logo
#

fuz_template_logo
#

gemini_logo
#

get_tome_by_name
#

tome.ts view source

(name: string): { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }

name

type string

returns

{ name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }

github_logo
#

github_owner_parse
#

library_helpers.ts view source

(repo_url: string): string | null

Parse GitHub owner/org name from repository URL.

repo_url

type string

returns

string | null

GithubLink
#

Glyph
#

gro_logo
#

Hashlink
#

HiddenPersonalLinks
#

HueInput
#

HueInput.svelte view source

value?

type Hue
optional bindable

oninput?

type (hue: Hue) => void
optional

children?

type Snippet
optional

ImgOrSvg
#

ImgOrSvg.svelte view source

src

type string

label?

type string
optional

size?

Sets both the width and height of the svg. Overridden by the width and height props.

type string
optional

width?

Sets the width of the svg. Overrides size.

type string
optional

height?

Sets the height of the svg. Overrides size.

type string
optional

svg_attrs?

type SvelteHTMLElements['svg']
optional

img_attrs?

type SvelteHTMLElements['img']
optional

attrs?

Shared attributes for both img and svg.

type Pick<SvelteHTMLElements['div'], 'class' | 'style'>
optional

intersect
#

intersect.svelte.ts view source

(get_params: () => IntersectParamsOrCallback | null | undefined): Attachment<HTMLElement | SVGElement>

Creates an attachment that observes element viewport intersection. Uses the lazy function pattern to optimize reactivity: callbacks can update without recreating the observer, preserving state.

get_params

Function that returns callback, params object, or nullish to disable

type () => IntersectParamsOrCallback | null | undefined

returns

Attachment<HTMLElement | SVGElement>

IntersectParams
#

intersect.svelte.ts view source

IntersectParams

onintersect

Called when the element enters or leaves the viewport until disconnected.

ondisconnect

Called when the attachment's observer is disconnected, either by the user calling disconnect or the attachment being destroyed.

count

A value of 1 disconnects after el enters and leaves the viewport one time, similar to 'once' for an event. 0 disables and undefined or a negative number like -1 never disconnects.

type number

options

Same as the options param to IntersectionObserver

type IntersectionObserverInit

IntersectParamsOrCallback
#

IntersectState
#

intersect.svelte.ts view source

IntersectState

intersecting

type boolean

intersections

type number

el

type HTMLElement | SVGElement

observer

type IntersectionObserver

disconnect

type () => void

is_csp_trusted
#

csp.ts view source

(required_trust: "low" | "medium" | "high" | null | undefined, granted_trust: "low" | "medium" | "high" | null | undefined): boolean

Determines if a granted trust level is sufficient to satisfy a required trust level.

Trust levels have the following hierarchy: - 'high' sources can be used in high, medium, and low trust directives (highest privilege) - 'medium' sources can be used in medium and low trust directives - 'low' sources can only be used in low trust directives (lowest privilege)

required_trust

type "low" | "medium" | "high" | null | undefined

granted_trust

type "low" | "medium" | "high" | null | undefined

returns

boolean

ItemState
#

Library
#

library.svelte.ts view source

Rich runtime representation of a library.

Wraps LibraryJson with computed properties and provides the root of the API documentation hierarchy: Library → modules → declarations

see also

  • module.svelte.ts for Module class

  • declaration.svelte.ts for Declaration class

library_json

type LibraryJson

readonly

package_json

source_json

name

repo_name

repo_url

owner_name

homepage_url

logo_url

logo_alt

npm_url

changelog_url

published

org_url

Organization URL (e.g., 'https://github.com/ryanatkn').

modules

All modules as rich Module instances.

modules_sorted

All modules sorted alphabetically by path.

declarations

All declarations across all modules as a flat array.

declaration_map

Declaration lookup map by name. Provides O(1) lookup.

constructor

type new (library_json: LibraryJson): Library

library_json
type LibraryJson

lookup_declaration

Look up a declaration by name.

type (name: string): Declaration | undefined

name
type string
returns Declaration | undefined

has_declaration

Check if a declaration exists.

type (name: string): boolean

name
type string
returns boolean

lookup_module

Look up a module by its canonical path.

type (path: string): Module | undefined

path
type string
returns Module | undefined

search_declarations

Search declarations by query string with multi-term AND logic.

type (query: string): Declaration[]

query
type string
returns Declaration[]

library_context
#

library.svelte.ts view source

{ get: (error_message?: string | undefined) => Library; get_maybe: () => Library | undefined; set: (value: Library) => Library; }

library_gen
#

library_gen.ts view source

(options?: LibraryGenOptions | undefined): Gen

Creates a Gen object for generating library metadata with full TypeScript analysis.

Usage in a .gen.ts file: ```ts import {library_gen} from '@ryanatkn/fuz/library_gen.js'; export const gen = library_gen(); ```

options?

type LibraryGenOptions | undefined
optional

returns

Gen

library_gen_analyze_svelte_file
#

library_gen_helpers.ts view source

(disknode: Disknode, module_path: string, checker: TypeChecker): { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | ... 6 more ... | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; }

Analyze a Svelte component file and extract metadata.

Uses svelte_analyze_file for core analysis, then adds Gro-specific dependency information from the disknode.

disknode

type Disknode

module_path

type string

checker

type TypeChecker

returns

{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...

library_gen_analyze_typescript_file
#

library_gen_helpers.ts view source

(disknode: Disknode, source_file: SourceFile, module_path: string, checker: TypeChecker): TsFileAnalysis

Analyze a TypeScript file and extract all declarations.

Uses ts_analyze_module_exports for core analysis, then adds Gro-specific dependency information from the disknode.

Returns both the module metadata and re-export information for post-processing.

disknode

type Disknode

source_file

type SourceFile

module_path

type string

checker

type TypeChecker

returns

TsFileAnalysis

library_gen_collect_source_files
#

library_gen_helpers.ts view source

(files: Map<PathId, Disknode>, log: Logger): Disknode[]

Collect and filter source files from filer.

Returns disknodes for TypeScript/JS files and Svelte components from src/lib, excluding test files. Returns an empty array with a warning if no source files are found.

files

type Map<PathId, Disknode>

log

type Logger

returns

Disknode[]

library_gen_extract_dependencies
#

library_gen_helpers.ts view source

(disknode: Disknode): { dependencies: string[]; dependents: string[]; }

Extract dependencies and dependents for a module from the filer's dependency graph.

Filters to only include source modules from src/lib (excludes external packages, node_modules, tests). Returns sorted arrays of module paths (relative to src/lib) for deterministic output.

disknode

type Disknode

returns

{ dependencies: string[]; dependents: string[]; }

library_gen_generate_ts
#

library_gen_helpers.ts view source

(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }, source_json: { ...; }): string

Generate the library.ts file content with library_json export. Parses at generation time so runtime only needs the pre-computed result.

package_json

type { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }

source_json

type { [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...

returns

string

library_gen_sort_modules
#

library_gen_helpers.ts view source

(modules: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; }[]): { ...; }[]

Sort modules alphabetically by path for deterministic output and cleaner diffs.

modules

type { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...

returns

{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...

library_gen_validate_no_duplicates
#

library_gen_helpers.ts view source

(source_json: { [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; }[] | undefined; }, log: Logger): void

Validates that no declaration names are duplicated across modules. The flat namespace is intentional - duplicates should fail fast.

source_json

type { [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...

log

type Logger

returns

void

throws

  • Error - if duplicate declaration names are found

LibraryDetail
#

LibraryDetail.svelte view source

library

type Library

repo_name?

type Snippet<[repo_name: string]>
optional

description?

type Snippet<[description: string]>
optional

motto?

type Snippet<[description: string]>
optional

npm_url?

type Snippet<[npm_url: string]>
optional

homepage_url?

type Snippet<[homepage_url: string]>
optional

children?

type Snippet<[library: Library]>
optional

LibraryGenOptions
#

LibrarySummary
#

LibrarySummary.svelte view source

library

type Library

repo_name?

type Snippet<[repo_name: string]>
optional

logo?

type Snippet<[logo_url: string, logo_alt: string]>
optional

motto?

type Snippet<[motto: string, glyph?: string]>
optional

description?

type Snippet<[description: string, glyph?: string]>
optional

npm_url?

type Snippet<[npm_url: string]>
optional

homepage_url?

type Snippet<[homepage_url: string]>
optional

children?

type Snippet
optional

load_color_scheme
#

themer.svelte.ts view source

(fallback?: ColorScheme, key?: string): ColorScheme

fallback

type ColorScheme
default 'auto'

key

type string
default COLOR_SCHEME_STORAGE_KEY

returns

ColorScheme

load_from_storage
#

storage.ts view source

<T>(key: string, is_json?: boolean, parse_fn?: ((value: unknown) => T | null) | undefined): T | null

Utility function to load a value from localStorage with optional parsing

key

The localStorage key

type string

is_json

Whether to parse the value as JSON

type boolean
default false

parse_fn?

Optional custom parsing function to transform the value

type ((value: unknown) => T | null) | undefined
optional

returns

T | null

The parsed value or null if not found or parsing fails

load_theme
#

themer.svelte.ts view source

(fallback?: Theme, key?: string): Theme

fallback

type Theme
default default_themes[0]!

key

type string
default THEME_STORAGE_KEY

returns

Theme

MAIN_HEADER_MARGIN_TOP
#

mdn_logo
#

MdnLink
#

Mdz
#

mdz_components_context
#

mdz_components.ts view source

{ get: (error_message?: string | undefined) => MdzComponents; get_maybe: () => MdzComponents | undefined; set: (value: MdzComponents) => MdzComponents; }

Context for providing custom mdz components. Must be set by the application using mdz.

mdz_elements_context
#

mdz_components.ts view source

{ get: (error_message?: string | undefined) => MdzElements; get_maybe: () => MdzElements | undefined; set: (value: MdzElements) => MdzElements; }

Context for providing allowed HTML elements. Must be set by the application using mdz. By default, no HTML elements are allowed.

mdz_parse
#

MdzBaseNode
#

MdzBoldNode
#

MdzCodeblockNode
#

MdzCodeNode
#

MdzComponentNode
#

MdzComponents
#

mdz_components.ts view source

MdzComponents

Component registry for custom Svelte components that can be used in mdz content.

For example, registering 'Alert' allows using <Alert>...</Alert> in mdz content.

The Map values are the Svelte component constructors.

MdzElementNode
#

MdzElements
#

mdz_components.ts view source

MdzElements

Element registry for HTML elements that can be used in mdz content.

For example, registering 'div' allows using <div>...</div> in mdz content.

The Map values are boolean placeholders for future configuration options.

MdzHeadingNode
#

mdz.ts view source

MdzHeadingNode

inheritance

extends:

type

type 'Heading'

level

type 1 | 2 | 3 | 4 | 5 | 6

children

type Array<MdzNode>

MdzHrNode
#

MdzItalicNode
#

MdzLinkNode
#

mdz.ts view source

MdzLinkNode

inheritance

extends:

type

type 'Link'

reference

type string

children

type Array<MdzNode>

link_type

type 'external' | 'internal'

MdzNode
#

MdzNodeView
#

MdzParagraphNode
#

MdzParser
#

mdz.ts view source

Parser for mdz format. Single-pass lexer/parser with text accumulation for efficiency. Used by mdz_parse, which should be preferred for simple usage.

constructor

type new (template: string): MdzParser

template
type string

parse

Main parse method. Returns flat array of nodes, with paragraph nodes wrapping content between double newlines.

type (): MdzNode[]

returns MdzNode[]

MdzStrikethroughNode
#

MdzTextNode
#

Module
#

module.svelte.ts view source

Rich runtime representation of a module with computed properties.

library

type Library

readonly

module_json

type ModuleJson

readonly

path

Canonical module path (e.g., 'Alert.ts', 'helpers/foo.ts').

path_import

Import-style path with ./ prefix.

module_comment

declarations

Array of Declaration instances. Filters out default exports.

url_api

API documentation URL for this module.

url_github

GitHub source URL.

has_declarations

type boolean

has_module_comment

type boolean

dependencies

Modules this imports (paths relative to src/lib).

dependents

Modules that import this (paths relative to src/lib).

constructor

type new (library: Library, module_json: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; }): Module

library
type Library
module_json
type { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...

get_declaration_by_name

Look up a declaration by name within this module.

type (name: string): Declaration | undefined

name
type string
returns Declaration | undefined

module_extract_path
#

module_helpers.ts view source

(source_id: string): string

Extract module path relative to src/lib from absolute source ID.

source_id

type string

returns

string

examples

Example 1

module_get_component_name
#

module_helpers.ts view source

(module_path: string): string

Extract component name from a Svelte module path.

module_path

type string

returns

string

examples

Example 1

module_get_key
#

module_helpers.ts view source

(module_path: string): string

Convert module path to module key format (with ./ prefix).

module_path

type string

returns

string

examples

Example 1

module_is_css
#

module_is_json
#

module_is_svelte
#

module_is_test
#

module_is_typescript
#

module_matches_source
#

module_helpers.ts view source

(path: string, options?: ModuleSourceOptions | undefined): boolean

Check if a path matches source criteria.

Checks source directory paths, file extensions, and exclusion patterns. Uses defaults if no options provided.

Rejects nested repo paths by ensuring the first /src/ leads to the source directory (e.g. rejects /src/fixtures/repos/foo/src/lib/index.ts because /src/fixtures/ ≠ /src/lib/).

path

Full path to check

type string

options?

Configuration options (uses defaults if not provided)

type ModuleSourceOptions | undefined
optional

returns

boolean

True if the path matches all criteria

MODULE_SOURCE_DEFAULTS
#

ModuleExportsAnalysis
#

ts_helpers.ts view source

ModuleExportsAnalysis

Result of analyzing a module's exports.

module_comment

Module-level documentation comment.

type string

declarations

All exported declarations with their metadata (excludes same-name re-exports).

type Array<DeclarationJson>

re_exports

Same-name re-exports (for building also_exported_from in post-processing).

type Array<ReExportInfo>

ModuleLink
#

ModuleSourceOptions
#

module_helpers.ts view source

ModuleSourceOptions

Configuration for module source detection.

Allows customizing which paths are considered source modules, useful for projects with non-standard directory structures.

source_paths

Source directory paths to include.

type Array<string>

extensions

File extensions to analyze.

type Array<string>

exclude_patterns

Patterns to exclude (matched against full path).

type Array<RegExp>

moss_logo
#

OnDisconnect
#

OnIntersect
#

package_is_published
#

library_helpers.ts view source

(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }): boolean

Check if a package is published to npm.

package_json

type { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; public?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; ... 24 more ...; exports?: string | ... 2 more ... | undefined; }

returns

boolean

parse_csp_directive
#

csp.ts view source

(directive: unknown): keyof CspDirectives | null

directive

type unknown

returns

keyof CspDirectives | null

parse_csp_trust_level
#

csp.ts view source

(trust: unknown): "low" | "medium" | "high" | null

Validates and extracts a CSP trust level from an unknown value.

trust

type unknown

returns

"low" | "medium" | "high" | null

PasteFromClipboard
#

PendingAnimation
#

PendingAnimation.svelte view source

inline?

type boolean
optional

running?

type boolean
optional

item_attrs?

type SvelteHTMLElements['span']
optional

children?

type Snippet<[index: number]>
optional

PendingButton
#

PendingButton.svelte view source

pending

type boolean

onclick

type () => void

running?

type boolean
optional

title?

type string
optional

disabled?

type boolean
optional

animation?

type Snippet
optional

children

type Snippet

ProjectLinks
#

Redirect
#

Redirect.svelte view source

host?

The target host to redirect to. Defaults to the current location.host.

type string
optional

path?

The target path to redirect to. Defaults to the current location.pathname.

type string
optional

auto?

Should the redirect happen automatically without user input? Defaults to true.

type boolean
optional

children?

type Snippet<[url: string]>
optional

ReExportInfo
#

ts_helpers.ts view source

ReExportInfo

Information about a same-name re-export. Used for post-processing to build also_exported_from arrays.

name

Name of the re-exported declaration.

type string

original_module

Module path (relative to src/lib) where the declaration is originally declared.

type string

render_value_to_string
#

repo_name_parse
#

repo_url_parse
#

library_helpers.ts view source

(repository: string | { [x: string]: unknown; type: string; url: string; directory?: string | undefined; } | undefined): string | null

Parse repository URL from package.json format.

repository

type string | { [x: string]: unknown; type: string; url: string; directory?: string | undefined; } | undefined

returns

string | null

RootMenuState
#

save_color_scheme
#

themer.svelte.ts view source

(color_scheme: ColorScheme | null, key?: string): void

color_scheme

type ColorScheme | null

key

type string
default COLOR_SCHEME_STORAGE_KEY

returns

void

save_theme
#

themer.svelte.ts view source

(theme: Theme | null, key?: string): void

theme

type Theme | null

key

type string
default THEME_STORAGE_KEY

returns

void

save_to_storage
#

storage.ts view source

(key: string, value: any, is_json?: boolean): void

Utility function to save a value to localStorage.

key

type string

value

type any

is_json

type boolean
default false

returns

void

Spiders
#

Spiders.svelte view source

spiders?

type Array<string>
optional

seed?

type unknown
optional

random?

type typeof Math.random
optional

spiderspace_logo
#

SubmenuState
#

svelte_analyze_component
#

svelte_helpers.ts view source

(ts_code: string, source_file: SourceFile, checker: TypeChecker, component_name: string): { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | ... 4 more ... | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }

Analyze a Svelte component from its svelte2tsx transformation.

ts_code

type string

source_file

type SourceFile

checker

type TypeChecker

component_name

type string

returns

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

svelte_analyze_file
#

svelte_helpers.ts view source

(file_path: string, module_path: string, checker: TypeChecker): { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }

Analyze a Svelte component file from disk.

This is a high-level function that handles the complete workflow: 1. Read the Svelte source from disk 2. Transform to TypeScript via svelte2tsx 3. Extract component metadata (props, documentation)

Suitable for use in documentation generators, build tools, and analysis.

file_path

Absolute path to the .svelte file

type string

module_path

Module path relative to src/lib (e.g., 'Alert.svelte')

type string

checker

TypeScript type checker for type resolution

type TypeChecker

returns

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

Complete declaration metadata for the component

Svg
#

Svg.svelte view source

data

type SvgData

fill?

Overrides data.fill.

type string | null
optional

size?

Sets both the width and height of the svg. Overridden by the width and height props.

type string
optional

width?

Sets the width of the svg. Overrides size.

type string
optional

height?

Sets the height of the svg. Overrides size.

type string
optional

label?

type string
optional

inline?

Renders the SVG as an inline block with spacing appropriate for text. Defaults to false.

type boolean
optional

shrink?

type boolean
optional

attrs?

type SvelteHTMLElements['svg']
optional

sync_color_scheme
#

Teleport
#

Teleport.svelte view source

to?

Defaults to undefined to lessen friction with SSR. We may want to change this to optionally accept a string selector, but that didn't seem to be the best API for the Dialog.

type HTMLElement | undefined | null
optional

onmove?

type (el: HTMLElement, to: HTMLElement) => void
optional

children

type Snippet

THEME_STORAGE_KEY
#

Themed
#

Themed.svelte view source

sync_color_scheme?

type typeof default_sync_color_scheme
optional

load_color_scheme?

type typeof default_load_color_scheme
optional

save_color_scheme?

type typeof default_save_color_scheme
optional

load_theme?

type typeof default_load_theme
optional

save_theme?

type typeof default_save_theme
optional

theme_fallback?

type Theme | undefined
optional

themer?

A reactive class containing the selected theme and color scheme. Defaults to the first default theme. The class reference is not reactive because it's set in context without a wrapper, use {#key theme} if it changes.

type Themer
optional

children

type Snippet<[themer: Themer, style: string | null, theme_style_html: string | null]>

ThemeInput
#

ThemeInput.svelte view source

selected_theme?

type {theme: Theme}
optional

themes?

type Array<Theme>
optional

enable_editing?

type boolean
optional

select?

type ((theme: Theme) => void | boolean) | null
optional

onselect?

type (theme: Theme) => void
optional

onedit?

type (theme: Theme) => void
optional

Themer
#

themer.svelte.ts view source

theme

type Theme

color_scheme

type ColorScheme

constructor

type new (theme?: Theme, color_scheme?: ColorScheme): Themer

theme
type Theme
default default_themes[0]!
color_scheme
type ColorScheme
default 'auto'

toJSON

type (): ThemerJson

returns ThemerJson

themer_context
#

themer.svelte.ts view source

{ get: (error_message?: string | undefined) => Themer; get_maybe: () => Themer | undefined; set: (value: Themer) => Themer; }

ThemerJson
#

to_dialog_params
#

dialog.ts view source

<T extends Component<any>>(Component: T, props: ComponentProps<T>, dialog_props?: Partial<Record<string, any>> | undefined): DialogParams<T>

This helper function is needed to construct DialogParams with type safety. It uses TypeScript's inferred generics for functions, which do not work for plain objects as of v5.0.4. * ContextmenuParams uses a similar strategy.

Component

type T

props

type ComponentProps<T>

dialog_props?

type Partial<Record<string, any>> | undefined
optional

returns

DialogParams<T>

to_docs_path_info
#

docs_helpers.svelte.ts view source

(path_slug: string, pathname: string, root_path?: string): { path: string; path_is_selected: boolean; path_segment: string | undefined; }

path_slug

type string

pathname

type string

root_path

type string
default DOCS_PATH_DEFAULT

returns

{ path: string; path_is_selected: boolean; path_segment: string | undefined; }

to_tome_pathname
#

tome.ts view source

(item: string | { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }, docs_path?: string, hash?: string | undefined): string

item

type string | { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }

docs_path

type string
default DOCS_PATH_DEFAULT

hash?

type string | undefined
optional

returns

string

Tome
#

tome.ts view source

ZodObject<{ name: ZodString; category: ZodString; Component: ZodCustom<Component<any, any, string>, Component<any, any, string>>; related_tomes: ZodArray<...>; related_modules: ZodArray<...>; related_declarations: ZodArray<...>; }, $strip>

tome_context
#

tome.ts view source

{ get: (error_message?: string | undefined) => { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }; get_maybe: () => { ...; } | undefined; set: (value: { ...; }) => { ...; }; }

TomeContent
#

TomeHeader
#

TomeLink
#

tomes_context
#

tome.ts view source

{ get: (error_message?: string | undefined) => Map<string, { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }>; get_maybe: () => Map<...> | undefined; set: (value: Map<...>) => Map<...>; }

TomeSection
#

TomeSectionHeader
#

ts_analyze_declaration
#

ts_helpers.ts view source

(symbol: Symbol, source_file: SourceFile, checker: TypeChecker): TsDeclarationAnalysis

Analyze a TypeScript symbol and extract rich metadata.

This is a high-level function that combines TSDoc parsing with TypeScript type analysis to produce complete declaration metadata. Suitable for use in documentation generators, IDE integrations, and other tooling.

symbol

The TypeScript symbol to analyze

type Symbol

source_file

The source file containing the symbol

type SourceFile

checker

The TypeScript type checker

type TypeChecker

returns

TsDeclarationAnalysis

Complete declaration metadata including docs, types, and parameters, plus nodocs flag

ts_analyze_module_exports
#

ts_helpers.ts view source

(source_file: SourceFile, checker: TypeChecker): ModuleExportsAnalysis

Analyze all exports from a TypeScript source file.

Extracts the module-level comment and all exported declarations with complete metadata. Handles re-exports by: - Same-name re-exports: tracked in re_exports for also_exported_from building - Renamed re-exports: included as new declarations with alias_of metadata

This is a high-level function suitable for building documentation, API explorers, or analysis tools.

source_file

The TypeScript source file to analyze

type SourceFile

checker

The TypeScript type checker

type TypeChecker

returns

ModuleExportsAnalysis

Module comment, array of analyzed declarations, and re-export information

ts_create_program
#

ts_helpers.ts view source

(log: { warn: (message: string) => void; }): Program | null

Create TypeScript program for analysis.

log

type { warn: (message: string) => void; }

returns

Program | null

ts_extract_class_info
#

ts_helpers.ts view source

(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }): void

Extract class information with rich member metadata.

node

type Node

_symbol

type Symbol

checker

type TypeChecker

declaration

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

returns

void

ts_extract_function_info
#

ts_helpers.ts view source

(node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }, tsdoc: TsdocParsedComment | undefined): void

Extract function/method information including parameters with descriptions and default values.

node

type Node

symbol

type Symbol

checker

type TypeChecker

declaration

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

tsdoc

type TsdocParsedComment | undefined

returns

void

ts_extract_module_comment
#

ts_helpers.ts view source

(source_file: SourceFile): string | undefined

Extract module-level comment.

Only accepts JSDoc/TSDoc comments (/** ... *\/) followed by a blank line to distinguish them from identifier-level comments. This prevents accidentally treating function/class comments as module comments. Module comments can appear after imports.

source_file

type SourceFile

returns

string | undefined

ts_extract_type_info
#

ts_helpers.ts view source

(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }): void

Extract type/interface information with rich property metadata.

node

type Node

_symbol

type Symbol

checker

type TypeChecker

declaration

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

returns

void

ts_extract_variable_info
#

ts_helpers.ts view source

(node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }): void

Extract variable information.

node

type Node

symbol

type Symbol

checker

type TypeChecker

declaration

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

returns

void

ts_infer_declaration_kind
#

ts_helpers.ts view source

(symbol: Symbol, node: Node): "function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"

Infer declaration kind from symbol and node.

symbol

type Symbol

node

type Node

returns

"function" | "type" | "json" | "variable" | "class" | "constructor" | "component" | "css"

TsDeclarationAnalysis
#

ts_helpers.ts view source

TsDeclarationAnalysis

Result of analyzing a single declaration.

declaration

The analyzed declaration metadata.

type DeclarationJson

nodocs

Whether the declaration is marked

type boolean

tsdoc_apply_to_declaration
#

tsdoc_helpers.ts view source

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

Apply parsed TSDoc metadata to a declaration.

Consolidates the common pattern of assigning TSDoc fields to declarations, with conditional assignment for array fields (only if non-empty).

declaration

declaration object to update

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

tsdoc

parsed TSDoc comment (if available)

type TsdocParsedComment | undefined

returns

void

tsdoc_parse
#

tsdoc_helpers.ts view source

(node: Node, source_file: SourceFile): TsdocParsedComment | undefined

Parse JSDoc comment from a TypeScript node.

Extracts and parses all JSDoc tags including:

- @param - parameter descriptions - @returns - return value description - @throws - error documentation - @example - code examples - @deprecated - deprecation warnings - @see - related references - @since - version information - @mutates - mutation documentation (non-standard)

node

The TypeScript node to extract JSDoc from

type Node

source_file

Source file (used for extracting full @see tag text)

type SourceFile

returns

TsdocParsedComment | undefined

TsdocParsedComment
#

tsdoc_helpers.ts view source

TsdocParsedComment

Parsed JSDoc/TSDoc comment with structured metadata.

text

Comment text (excluding comment markers)

type string

params

Parameter descriptions mapped by parameter name

type Map<string, string>

returns

Return value description from @returns

type string

throws

Thrown errors from @throws

type Array<{type?: string; description: string}>

examples

Code examples from @example

type Array<string>

deprecated_message

Deprecation message from @deprecated

type string

see_also

Related references from @see

type Array<string>

since

Version information from @since

type string

mutates

Mutation documentation from @mutates (non-standard)

type Array<string>

nodocs

Whether to exclude from documentation. From @nodocs tag.

type boolean

TsFileAnalysis
#

library_gen_helpers.ts view source

TsFileAnalysis

Result of analyzing a TypeScript file. Includes both the module metadata and re-export information for post-processing.

module

Module metadata for inclusion in source_json.

type ModuleJson

re_exports

Re-exports from this module for building also_exported_from.

type Array<ReExportInfo>

TypeLink
#

url_api_declaration
#

library_helpers.ts view source

(declaration_name: string): string

Build project-relative API documentation URL with hash anchor.

declaration_name

type string

returns

string

url_api_declaration_full
#

library_helpers.ts view source

(homepage: string, declaration_name: string): string

Build full API documentation URL with domain and hash anchor.

homepage

type string

declaration_name

type string

returns

string

url_api_module
#

library_helpers.ts view source

(module_path: string): string

Build project-relative module documentation URL.

module_path

type string

returns

string

url_github_file
#

library_helpers.ts view source

(repo_url: string, file_path: string, line?: number | undefined): string

Build GitHub file URL for a repository.

repo_url

type string

file_path

type string

line?

type number | undefined
optional

returns

string

url_github_org
#

library_helpers.ts view source

(repo_url: string, repo_name: string): string | null

Build GitHub organization URL from repo URL and repo name.

repo_url

type string

repo_name

type string

returns

string | null

url_npm_package
#

url_package_logo
#

url_to_root_relative
#

library_helpers.ts view source

(url: string, origin?: string): string

Convert a full URL to root-relative format by removing the origin.

url

type string

origin

type string
default page.url.origin

returns

string

url_well_known
#

library_helpers.ts view source

(homepage_url: string, filename: string): string

Build .well-known URL for package metadata files.

homepage_url

type string

filename

type string

returns

string

webdevladder_logo
#

zzz_logo
#