97 api #
Svelte UI library
111 modules ยท 386 declarations
Modules #
- Alert.svelte
- alert.ts
- analysis_context.ts
- api_search.svelte.ts
- ApiDeclarationList.svelte
- ApiIndex.svelte
- ApiModule.svelte
- ApiModulesList.svelte
- autofocus.svelte.ts
- Breadcrumb.svelte
- Card.svelte
- ColorSchemeInput.svelte
- constants.ts
- context_helpers.ts
- contextmenu_helpers.ts
- contextmenu_state.svelte.ts
- Contextmenu.svelte
- ContextmenuEntry.svelte
- ContextmenuLinkEntry.svelte
- ContextmenuRoot.svelte
- ContextmenuRootForSafariCompatibility.svelte
- ContextmenuSeparator.svelte
- ContextmenuSubmenu.svelte
- ContextmenuTextEntry.svelte
- CopyToClipboard.svelte
- csp_of_ryanatkn.ts
- csp.ts
- declaration_contextmenu.ts
- declaration.svelte.ts
- DeclarationDetail.svelte
- DeclarationLink.svelte
- Details.svelte
- Dialog.svelte
- dialog.ts
- Dialogs.svelte
- dimensions.svelte.ts
- docs_helpers.svelte.ts
- Docs.svelte
- DocsContent.svelte
- DocsFooter.svelte
- DocsLink.svelte
- DocsList.svelte
- DocsMenu.svelte
- DocsMenuHeader.svelte
- DocsPageLinks.svelte
- DocsPrimaryNav.svelte
- DocsSearch.svelte
- DocsSecondaryNav.svelte
- DocsTertiaryNav.svelte
- EcosystemLinks.svelte
- EcosystemLinksPanel.svelte
- GithubLink.svelte
- Glyph.svelte
- Hashlink.svelte
- helpers.ts
- HueInput.svelte
- ImgOrSvg.svelte
- intersect.svelte.ts
- library_analysis.ts
- library_gen.ts
- library_generate.ts
- library_helpers.ts
- library_output.ts
- library_pipeline.ts
- library.svelte.ts
- LibraryDetail.svelte
- LibrarySummary.svelte
- logos.ts
- MdnLink.svelte
- mdz_components.ts
- mdz_helpers.ts
- mdz_lexer.ts
- mdz_to_svelte.ts
- mdz_token_parser.ts
- Mdz.svelte
- mdz.ts
- MdzNodeView.svelte
- MdzPrecompiled.svelte
- module_contextmenu.ts
- module_helpers.ts
- module.svelte.ts
- ModuleLink.svelte
- package_helpers.ts
- PasteFromClipboard.svelte
- PendingAnimation.svelte
- PendingButton.svelte
- ProjectLinks.svelte
- Redirect.svelte
- rune_helpers.svelte.ts
- Spiders.svelte
- storage.ts
- style_variable_helpers.svelte.ts
- StyleVariableButton.svelte
- svelte_helpers.ts
- svelte_preprocess_mdz.ts
- Svg.svelte
- Teleport.svelte
- Themed.svelte
- ThemeInput.svelte
- themer.svelte.ts
- tome.ts
- TomeContent.svelte
- TomeHeader.svelte
- TomeLink.svelte
- TomeSection.svelte
- TomeSectionHeader.svelte
- ts_helpers.ts
- tsdoc_helpers.ts
- tsdoc_mdz.ts
- TypeLink.svelte
- vite_plugin_library_well_known.ts
A_LOWER #
A_UPPER #
65 Alert #
status?
color?
stringonclick?
(() => void) | undefineddisabled?
booleanicon?
string | Snippet<[icon: string]> | null | undefinedchildren
Snippetsee also
alert_status_options #
Record<AlertStatus, AlertStatusOptions> AlertStatus #
AlertStatus AlertStatusOptions #
AlertStatusOptions color
stringicon
string | nullAMPERSAND #
38 AnalysisContext #
analysis_context.ts view source
Context for collecting diagnostics during source analysis.
Thread an instance through analysis functions to collect errors and warnings
without halting analysis. After analysis completes, check has_errors() and
report collected diagnostics.
examples
const ctx = new AnalysisContext(); ts_analyze_module_exports(source_file, checker, options, ctx); if (ctx.has_errors()) { console.error('Analysis completed with errors:'); for (const d of ctx.errors()) { console.error(format_diagnostic(d)); } }
diagnostics
type Array<Diagnostic>
add
Add a diagnostic to the collection.
type (diagnostic: Diagnostic): void
diagnostic
voidhas_errors
Check if any errors were collected.
type (): boolean
booleanhas_warnings
Check if any warnings were collected.
type (): boolean
booleanerrors
Get all error diagnostics.
type (): Diagnostic[]
Diagnostic[]warnings
Get all warning diagnostics.
type (): Diagnostic[]
Diagnostic[]by_kind
Get diagnostics of a specific kind.
type <K extends DiagnosticKind>(kind: K): (Extract<TypeExtractionDiagnostic, { kind: K; }> | Extract<SignatureAnalysisDiagnostic, { ...; }> | Extract<...> | Extract<...> | Extract<...>)[]
kind
K(Extract<TypeExtractionDiagnostic, { kind: K; }> | Extract<SignatureAnalysisDiagnostic, { kind: K; }> | Extract<...> | Extract<...> | Extract<...>)[]AnalyzerType #
AnalyzerType Analyzer type for source files.
- 'typescript' - TypeScript/JS files analyzed via TypeScript Compiler API
- 'svelte' - Svelte components analyzed via svelte2tsx + TypeScript Compiler API
ApiDeclarationList #
ApiDeclarationList.svelte view source
declarations
Array<Declaration>search_query?
stringApiIndex #
library?
The library instance to render API docs for. Defaults to getting from library_context.
tome?
The tome for the API docs page. Defaults to looking up the 'api' tome.
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.
booleanApiModule #
module_path
The module path parameter from the route (e.g., "lib/Button.svelte").
string | Array<string>library?
The library instance to render API docs for. Defaults to getting from library_context.
tome?
The tome for the API docs page. Defaults to looking up the 'api' tome.
ApiModulesList #
ApiModulesList.svelte view source
modules
The modules to display.
Array<Module>search_query?
The current search query for highlighting.
stringApiSearchState #
api_search.svelte.ts view source
ApiSearchState query
stringmodules
{
all: Array<Module>;
filtered: Array<Module>;
}declarations
{
all: Array<Declaration>;
filtered: Array<Declaration>;
}APOSTROPHE #
39 ASTERISK #
42 AT #
64 autofocus #
autofocus.svelte.ts view source
(options?: FocusOptions | undefined): Attachment<HTMLElement | SVGElement> Creates an attachment that focuses the element on mount.
Use this instead of the HTML autofocus attribute for elements
that mount dynamically from reactive conditionals like {#if}.
options?
focus options forwarded to element.focus(); defaults to {focusVisible: true} to show focus indicators on programmatic focus
FocusOptions | undefinedreturns
Attachment<HTMLElement | SVGElement> BACKTICK #
96 BaseDiagnostic #
analysis_context.ts view source
BaseDiagnostic Base diagnostic fields shared by all diagnostic types.
kind
file
File path relative to project root (display with './' prefix).
stringline
Line number (1-based), or null if location unavailable.
number | nullcolumn
Column number (1-based), or null if location unavailable.
number | nullmessage
Human-readable description of the issue.
stringseverity
Breadcrumb #
path?
Prefixed with a slash and relative to the base path.
string | undefinedselected_path?
Prefixed with a slash and relative to the base path.
null means none and undefined is detected from the current url.
string | null | undefinedbase_path?
Sets a custom base path of path and selected_path.
Defaults to base from $app/paths.
stringseparator?
Snippetchildren?
SnippetCard #
tag?
string | undefinedalign?
'left' | 'right' | 'above' | 'below'icon?
string | Snippetchildren
SnippetClassMemberDiagnostic #
analysis_context.ts view source
ClassMemberDiagnostic Class member analysis failed.
inheritance
kind
'class_member_failed'class_name
Name of the class.
stringmember_name
Name of the member that failed.
stringCollectedReExport #
library_pipeline.ts view source
CollectedReExport A collected re-export with its source module context.
Used during the two-phase re-export resolution:
1. Phase 1: Collect re-exports from each module during analysis
2. Phase 2: Group by original module and merge into also_exported_from
re_exporting_module
The module that re-exports the declaration.
stringre_export
The re-export info (name and original module).
COLON #
58 COLOR_SCHEME_SCRIPT_HASH #
"sha256-QOxqn7EUzb3ydF9SALJoJGWSvywW9R0AfTDSenB83Z8=" COLOR_SCHEME_STORAGE_KEY #
"fuz:color-scheme" ColorSchemeInput #
ColorSchemeInput.svelte view source
value?
{color_scheme: ColorScheme}COMMA #
44 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
U | null | undefinedreturns
Attachment<HTMLElement | SVGElement> contextmenu_calculate_constrained_x #
contextmenu_helpers.ts view source
(menu_x: number, menu_width: number, layout_width: number): number menu_x
numbermenu_width
numberlayout_width
numberreturns
number contextmenu_calculate_constrained_y #
contextmenu_helpers.ts view source
(menu_y: number, menu_height: number, layout_height: number): number menu_y
numbermenu_height
numberlayout_height
numberreturns
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
() => booleanreturns
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_helpers.ts view source
(contextmenu: ContextmenuState): Map<string, () => void> contextmenu
returns
Map<string, () => void> contextmenu_create_keydown_handler #
contextmenu_helpers.ts view source
(keyboard_handlers: Map<string, () => void>): (e: KeyboardEvent) => void keyboard_handlers
Map<string, () => void>returns
(e: KeyboardEvent) => void CONTEXTMENU_DEFAULT_BYPASS_MOVE_TOLERANCE #
contextmenu_helpers.ts view source
11 CONTEXTMENU_DEFAULT_BYPASS_WINDOW #
contextmenu_helpers.ts view source
750 CONTEXTMENU_DEFAULT_LONGPRESS_DURATION #
contextmenu_helpers.ts view source
633 CONTEXTMENU_DEFAULT_LONGPRESS_MOVE_TOLERANCE #
contextmenu_helpers.ts view source
21 CONTEXTMENU_DEFAULT_OPEN_OFFSET_X #
contextmenu_helpers.ts view source
-2 CONTEXTMENU_DEFAULT_OPEN_OFFSET_Y #
contextmenu_helpers.ts view source
-2 contextmenu_dimensions_context #
contextmenu_state.svelte.ts view source
{ get: () => Dimensions; set: (value?: Dimensions | undefined) => Dimensions; } 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
EventTarget | nullshiftKey
booleanreturns
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
HTMLElement | SVGElementx
the page X coordinate at which to open the contextmenu, typically the mouse pageX
numbery
the page Y coordinate at which to open the contextmenu, typically the mouse pageY
numbercontextmenu
the contextmenu store
options?
optional configuration for filtering entries and haptic feedback
ContextmenuOpenOptions | undefinedreturns
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 #
contextmenu_state.svelte.ts view source
ContextmenuActivateResult ContextmenuEntry #
ContextmenuEntry.svelte view source
run
icon?
string | Snippetchildren
Snippetdisabled?
booleanContextmenuLinkEntry #
ContextmenuLinkEntry.svelte view source
href
stringicon?
string | Snippetchildren?
Snippetdisabled?
booleanexternal_rel?
stringContextmenuOpenOptions #
contextmenu_state.svelte.ts view source
ContextmenuOpenOptions link_enabled
booleantext_enabled
booleanseparator_enabled
booleanvibrate
booleanContextmenuParams #
contextmenu_state.svelte.ts view source
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
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.
numberopen_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.
numberbypass_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.
booleanbypass_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.
numberbypass_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.
numberscoped?
If true, wraps children with a div and listens to events on it instead of the window.
booleanlink_entry?
Snippet for rendering link entries.
Set to null to disable automatic link detection.
Defaults to link_entry_default which renders ContextmenuLinkEntry.
Snippet<[ComponentProps<typeof ContextmenuLinkEntry>]> | nulltext_entry?
Snippet for rendering copy text entries.
Set to null to disable automatic copy text detection.
Defaults to text_entry_default which renders ContextmenuTextEntry.
Snippet<[ComponentProps<typeof ContextmenuTextEntry>]> | nullseparator_entry?
Snippet for rendering separator entries.
Set to null to disable automatic separator rendering.
Defaults to separator_entry_default which renders ContextmenuSeparator.
Snippet<[ComponentProps<typeof ContextmenuSeparator>]> | nullchildren
SnippetContextmenuRootForSafariCompatibility #
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
longpress_move_tolerance?
The number of pixels the pointer can be moved without canceling longpress.
numberlongpress_duration?
The number of milliseconds after a touch starts before opening the Fuz contextmenu.
numberbypass_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.
booleanbypass_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.
numberbypass_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.
numberopen_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.
numberopen_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.
numberscoped?
If true, wraps children with a div and listens to events on it instead of the window.
booleanlink_entry?
Snippet for rendering link entries.
Set to null to disable automatic link detection.
Defaults to link_entry_default which renders ContextmenuLinkEntry.
Snippet<[ComponentProps<typeof ContextmenuLinkEntry>]> | nulltext_entry?
Snippet for rendering copy text entries.
Set to null to disable automatic copy text detection.
Defaults to text_entry_default which renders ContextmenuTextEntry.
Snippet<[ComponentProps<typeof ContextmenuTextEntry>]> | nullseparator_entry?
Snippet for rendering separator entries.
Set to null to disable automatic separator rendering.
Defaults to separator_entry_default which renders ContextmenuSeparator.
Snippet<[ComponentProps<typeof ContextmenuSeparator>]> | nullchildren
SnippetContextmenuRun #
contextmenu_state.svelte.ts view source
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
opened
type boolean
x
type number
y
type number
params
type ReadonlyArray<ContextmenuParams>
error
type string | undefined
root_menu
type RootMenuState
selections
type ReadonlyArray<ItemState>
can_collapse
can_expand
can_select_next
can_select_previous
can_activate
constructor
type new (options?: ContextmenuStateOptions): ContextmenuState
options
EMPTY_OBJECTopen
type (params: ContextmenuParams[], x: number, y: number): void
params
ContextmenuParams[]x
numbery
numbervoidclose
type (): void
voidreset_items
type (items: readonly ItemState[]): void
items
readonly ItemState[]voidactivate
type (item: ItemState): boolean | Promise<ContextmenuActivateResult>
item
boolean | Promise<ContextmenuActivateResult>activate_selected
type (): boolean | void | Promise<ContextmenuActivateResult>
boolean | void | Promise<ContextmenuActivateResult>select
Activates the selected entry, or if none, selects the first.
type (item: ItemState): void
item
voidcollapse_selected
type (): void
voidexpand_selected
type (): void
voidselect_next
type (): void
voidselect_previous
type (): void
voidselect_first
type (): void
voidselect_last
type (): void
voidadd_entry
Used by ContextmenuEntry and custom entry components
type (run: () => ContextmenuRun, disabled?: () => boolean): EntryState
run
() => ContextmenuRundisabled
() => boolean() => falseadd_submenu
type (): SubmenuState
ContextmenuStateOptions #
contextmenu_state.svelte.ts view source
ContextmenuStateOptions layout
ContextmenuSubmenu #
ContextmenuSubmenu.svelte view source
icon?
Snippetmenu
Snippetchildren
SnippetContextmenuTextEntry #
ContextmenuTextEntry.svelte view source
run
content
stringicon
stringCopyToClipboard #
CopyToClipboard.svelte view source
text
string | nullcopied_display_duration?
numberallow_copying_empty_string?
booleanicon_button?
Defaults to true, ignored if children is provided.
booleanoncopy?
(text: string | null, e: MouseEvent) => voidchildren?
Snippet<[copied: boolean, failed: boolean]>create_api_search #
api_search.svelte.ts view source
(library: Library): ApiSearchState Creates unified search state for the API index page (modules and declarations).
library
returns
ApiSearchState 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
() => Treturns
{ get: () => T; set: (value?: T | undefined) => T; } generics
T
create_csp_directives #
(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
{}returns
CspDirectives create_declaration_contextmenu #
declaration_contextmenu.ts view source
(declaration: Declaration): ContextmenuParams[] declaration
returns
ContextmenuParams[] create_module_contextmenu #
module_contextmenu.ts view source
(module: Module): ContextmenuParams[] module
returns
ContextmenuParams[] create_module_declaration_search #
api_search.svelte.ts view source
(declarations: Declaration[]): DeclarationSearchState Creates search state for module-specific declaration lists.
declarations
Declaration[]returns
DeclarationSearchState CreateCspDirectivesOptions #
CreateCspDirectivesOptions directives
Override or transform specific directives.
Returning null or undefined from a transform function will remove the directive.
{
[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.
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).
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.
Partial<typeof csp_directive_value_defaults> | nullrequired_trust_defaults
Override trust requirements for specific directives,
merging with required_trust_defaults_base (or replacing if that directive is null in the base).
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.
Partial<typeof csp_directive_required_trust_defaults> | nullcsp_directive_required_trust_defaults #
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/fuzdev/fuz_ui/issues
csp_directive_spec_by_name #
Map<keyof CspDirectives, CspDirectiveSpec> csp_directive_specs #
CspDirectiveSpec[] Static data descriptors for the CSP directives. Fuz excludes deprecated directives, so those are intentionally omitted, but any newer missing directives are bugs.
Could be moved to csp.ts but is currently here to keep that module smaller.
see also
csp_directive_value_defaults #
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 #
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 #
readonly ["low", "medium", "high"] csp_trusted_sources_of_ryanatkn #
csp_of_ryanatkn.ts view source
CspSourceSpec[] Trusted sources owned by ryanatkn.
CspActionSource #
CspActionSource CspBaseSource #
CspBaseSource CspCryptoSource #
`nonce-${string}` | `sha256-${string}` | `sha384-${string}` | `sha512-${string}` CspDirective #
keyof CspDirectives CspDirectives #
CspDirectives sandbox
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 #
CspDirectiveSpec name
fallback
Array<CspDirective> | nullfallback_of
Array<CspDirective> | nullCspDirectiveValue #
CspDirectiveValue<T> generics
T
CspFrameSource #
CspFrameSource CspHostNameScheme #
CspHostNameScheme CspHostProtocolSchemes #
CspHostProtocolSchemes CspHostSource #
`${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 #
CspPortScheme CspSchemeSource #
CspSchemeSource CspSource #
CspSource CspSources #
CspSources CspSourceSpec #
CspSourceSpec source
trust
directives
Array<CspDirective>CspTrustLevel #
"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
declaration_json
type DeclarationJson
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" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 19 more ...; alias_of?: { ...; } | undefined; }): Declaration
module
declaration_json
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }DeclarationAnalysis #
library_analysis.ts view source
DeclarationAnalysis Result of analyzing a single declaration. Used by both TypeScript and Svelte analyzers for uniform handling.
declaration
The analyzed declaration metadata.
DeclarationJsonnodocs
Whether the declaration is marked
booleanDeclarationDetail #
DeclarationDetail.svelte view source
declaration
DeclarationLink #
DeclarationLink.svelte view source
name
stringhash?
URL fragment to append, with or without the #.
stringDeclarationSearchState #
api_search.svelte.ts view source
DeclarationSearchState query
stringall
Array<Declaration>filtered
Array<Declaration>Details #
Like details but renders children lazily by default.
open?
booleaneager?
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.
booleansummary
string | Snippetsummary_attrs?
SvelteHTMLElements['summary']children
SnippetDiagnostic #
analysis_context.ts view source
Diagnostic Union of all diagnostic types.
DiagnosticKind #
analysis_context.ts view source
DiagnosticKind Discriminant for diagnostic types.
DiagnosticSeverity #
analysis_context.ts view source
DiagnosticSeverity Diagnostic severity levels.
- error: Analysis failed, declaration may be incomplete or missing data
- warning: Partial success, something seems off but analysis continued
Dialog #
container?
HTMLElementlayout?
index?
index 0 is under 1 is under 2 etc -- the topmost dialog is the last in the array
numberactive?
booleancontent_selector?
If provided, prevents clicks that would close the dialog from bubbling past any elements matching this selector.
string | nullonclose?
() => voidchildren
Snippet<[close: (e?: Event) => void]>dialog_layouts #
DialogLayout[] DialogLayout #
DialogLayout DialogParams #
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
Component<any>Component<any>Component
Tprops
ComponentProps<T>dialog_props
Partial<ComponentProps<typeof Dialog>> | undefinedDialogs #
dialogs
Array<DialogParams>onclose?
() => voidchildren?
Snippet<[dialog: DialogParams]>Dimensions #
dimensions.svelte.ts view source
width
type number
height
type number
DisconnectState #
intersect.svelte.ts view source
DisconnectState intersecting
booleanintersections
numberel
HTMLElement | SVGElementobserver
IntersectionObserverDocs #
tomes
Array<Tome>library
breadcrumb_children?
Snippet<[is_primary_nav: boolean]>children
SnippetDOCS_API_PATH #
docs_helpers.svelte.ts view source
string docs_links_context #
docs_helpers.svelte.ts view source
{ get: (error_message?: string | undefined) => DocsLinks; get_maybe: () => DocsLinks | undefined; set: (value: DocsLinks) => DocsLinks; } 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" | ... 63 more ... | `/${string}${`/docs/api/${string}` & {}}` DOCS_PATH_DEFAULT #
docs_helpers.svelte.ts view source
"/docs" 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
stringreturns
string A URL-safe fragment identifier
DocsContent #
DocsContent.svelte view source
tomes
Array<Tome>library
repo_name?
Snippet<[repo_name: string]>content?
Snippetheader?
SnippetDocsFooter #
library
root_url?
Url | nulllogo?
Snippetlogo_header?
Snippetlogo_footer?
SnippetDocsLink #
reference
stringhash?
URL fragment to append, with or without the #.
stringdisplay_text?
string | nullchildren?
Snippet<[Declaration | undefined, Module | undefined]>DocsLinkInfo #
docs_helpers.svelte.ts view source
DocsLinkInfo id
stringtext
stringfragment
stringtag
DocsLinkTag | undefineddepth
numberorder
numberparent_id
string | undefinedDocsLinks #
docs_helpers.svelte.ts view source
root_path
type string
links
type SvelteMap<string, DocsLinkInfo>
docs_links
fragments_onscreen
type SvelteSet<string>
constructor
type new (root_path?: string): DocsLinks
root_path
stringDOCS_PATH_DEFAULTadd
type (fragment: string, text: string, pathname: string, tag?: DocsLinkTag | undefined, depth?: number, parent_id?: string | undefined, explicit_id?: string | undefined): string
fragment
stringtext
stringpathname
stringtag?
DocsLinkTag | undefineddepth
number1parent_id?
string | undefinedexplicit_id?
string | undefinedstringremove
type (id: string): void
id
stringvoidgenerate_section_id
Generate a unique section ID for the current page render. This counter is instance-scoped, ensuring SSR/client consistency.
type (): string
stringDocsLinkTag #
docs_helpers.svelte.ts view source
DocsLinkTag DocsList #
expand_width?
booleanmargin?
booleanchildren
SnippetDocsMenu #
tomes
Array<Tome>children?
Snippet<[category: string]>expand_width?
booleanDocsMenuHeader #
DocsMenuHeader.svelte view source
children
SnippetDocsPageLinks #
DocsPageLinks.svelte view source
sidebar?
booleanexpand_width?
booleanDocsPrimaryNav #
DocsPrimaryNav.svelte view source
library
breadcrumb_children?
Snippet<[is_primary_nav: boolean]>children?
SnippetDocsSearch #
placeholder?
stringmodule_count?
Total number of modules.
numberdeclaration_count?
Total number of declarations.
numberfiltered_module_count?
Number of modules after filtering.
numberfiltered_declaration_count?
Number of declarations after filtering.
numbersearch_query
stringDocsSecondaryNav #
DocsSecondaryNav.svelte view source
tomes
Array<Tome>sidebar?
booleanDocsTertiaryNav #
DocsTertiaryNav.svelte view source
tomes
Array<Tome>tomes_by_name
Map<string, Tome>sidebar?
booleanDOLLAR #
36 DuplicateInfo #
library_pipeline.ts view source
DuplicateInfo A duplicate declaration with its full metadata and module path.
declaration
The full declaration metadata.
DeclarationJsonmodule
Module path where this declaration is defined.
stringEcosystemLinks #
EcosystemLinks.svelte view source
selected?
'fuz.dev'EcosystemLinksPanel #
EcosystemLinksPanel.svelte view source
children?
Snippeteffect_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
(count: number) => voidinitial
number0returns
void EntryState #
contextmenu_state.svelte.ts view source
is_menu
menu
type SubmenuState | RootMenuState
run
type () => ContextmenuRun
disabled
type () => boolean
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
SubmenuState | RootMenuStaterun
() => ContextmenuRundisabled
() => boolean() => falseEQUALS #
61 EXCLAMATION #
33 extract_single_tag #
(nodes: MdzNode[]): MdzElementNode | MdzComponentNode | null nodes
MdzNode[]returns
MdzElementNode | MdzComponentNode | null format_diagnostic #
analysis_context.ts view source
(diagnostic: Diagnostic, options?: FormatDiagnosticOptions | undefined): string Format a diagnostic for display.
diagnostic
The diagnostic to format
options?
Formatting options
FormatDiagnosticOptions | undefinedreturns
string Formatted string like './file.ts:10:5: error: message'
FormatDiagnosticOptions #
analysis_context.ts view source
FormatDiagnosticOptions Options for formatting diagnostics.
prefix
Prefix for file path (default: './').
stringstrip_base
Base path to strip from absolute file paths (e.g., process.cwd()).
stringget_tome_by_name #
(name: string): { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; } name
stringreturns
{ name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; } GithubLink #
path?
GitHub path - can be a full URL or a relative path like owner/repo or owner/repo/blob/main/file.ts
stringhash?
URL fragment to append, with or without the #.
stringGlyph #
glyph
stringsize?
string | undefinedHASH #
35 Hashlink #
fragment
stringHR_HYPHEN_COUNT #
3 HTTP_PREFIX_LENGTH #
7 HTTPS_PREFIX_LENGTH #
8 HueInput #
value?
Huechildren?
SnippetHYPHEN #
45 ImgOrSvg #
src
stringlabel?
stringsize?
Sets both the width and height of the svg. Overridden by the width and height props.
stringwidth?
Sets the width of the svg. Overrides size.
stringheight?
Sets the height of the svg. Overrides size.
stringsvg_attrs?
SvelteHTMLElements['svg']img_attrs?
SvelteHTMLElements['img']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
() => IntersectParamsOrCallback | null | undefinedreturns
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.
numberoptions
Same as the options param to
IntersectionObserver
IntersectionObserverInitIntersectParamsOrCallback #
intersect.svelte.ts view source
IntersectParamsOrCallback IntersectState #
intersect.svelte.ts view source
IntersectState intersecting
booleanintersections
numberel
HTMLElement | SVGElementobserver
IntersectionObserverdisconnect
() => voidis_at_absolute_path #
(text: string, index: number): boolean Check if position in text is the start of an absolute path (starts with /).
Must be preceded by whitespace or be at the start of the string.
Rejects // (comments/protocol-relative) and / (bare slash).
text
stringindex
numberreturns
boolean is_at_relative_path #
(text: string, index: number): boolean Check if position in text is the start of a relative path (./ or ../).
Must be preceded by whitespace or be at the start of the string.
Requires at least one path character after the prefix.
text
stringindex
numberreturns
boolean is_csp_trusted #
(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
"low" | "medium" | "high" | null | undefinedgranted_trust
"low" | "medium" | "high" | null | undefinedreturns
boolean is_letter #
(char_code: number): boolean Check if character code is a letter (A-Z, a-z).
char_code
numberreturns
boolean is_tag_name_char #
(char_code: number): boolean Check if character code is valid for tag name (letter, number, hyphen, underscore).
char_code
numberreturns
boolean is_valid_path_char #
(char_code: number): boolean Check if character code is valid in URI path per RFC 3986.
Validates against the pchar production plus path/query/fragment separators.
Valid characters: - unreserved: A-Z a-z 0-9 - . _ ~ - sub-delims: ! $ & ' ( ) * + , ; = - path allowed: : @ - separators: / ? # - percent-encoding: %
char_code
numberreturns
boolean is_word_char #
(char_code: number): boolean Check if character is part of a word for word boundary detection.
Used to prevent intraword emphasis with _ and ~ delimiters.
Formatting delimiters (*, _, ~) are NOT word characters - they're transparent.
Only alphanumeric characters (A-Z, a-z, 0-9) are considered word characters.
This prevents false positives with snake_case identifiers while allowing
adjacent formatting like **bold**_italic_.
char_code
numberreturns
boolean ItemState #
contextmenu_state.svelte.ts view source
ItemState LEFT_ANGLE #
60 LEFT_BRACKET #
91 LEFT_PAREN #
40 Library #
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
url_prefix
URL path prefix for multi-package documentation sites.
Prepended to /docs/api/ paths in Module.url_api and Declaration.url_api.
Default '' preserves single-package behavior.
type string
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.
module_by_path
Module lookup map by path. Provides O(1) lookup.
declaration_by_name
Declaration lookup map by name. Provides O(1) lookup.
constructor
type new (library_json: LibraryJson, url_prefix?: string): Library
library_json
LibraryJsonurl_prefix
string''lookup_directory_modules
Look up modules within a directory prefix.
Returns modules whose paths start with path + "/", or null if none match.
type (path: string): Module[] | null
path
stringModule[] | nullsearch_declarations
Search declarations by query string with multi-term AND logic.
type (query: string): Declaration[]
query
stringDeclaration[]library_analyze_module #
library_analysis.ts view source
(source_file: SourceFileInfo, program: Program, options: ModuleSourceOptions, ctx: AnalysisContext, log?: Logger | undefined): ModuleAnalysis | undefined Analyze a source file and extract module metadata.
Unified entry point that dispatches to the appropriate analyzer based on file type: - TypeScript/JS files โ ts_analyze_module - Svelte components โ svelte_analyze_module
Returns raw analysis data including nodocs flags on declarations.
Consumer is responsible for filtering based on their policy.
This function can be called incrementally - consumers may cache results and only re-analyze changed files. The TypeScript program should include all files for accurate type resolution, but only changed files need re-analysis.
source_file
The source file info with content and optional dependency data
program
TypeScript program (used for type checking and source file lookup)
Programoptions
Module source options for path extraction
ctx
Analysis context for collecting diagnostics
log?
Optional logger for warnings
Logger | undefinedreturns
ModuleAnalysis | undefined Module metadata and re-exports, or undefined if source file not found in program
library_collect_source_files #
library_pipeline.ts view source
(files: Iterable<SourceFileInfo>, options: ModuleSourceOptions, log?: Logger | undefined): SourceFileInfo[] Collect and filter source files.
Returns source files for TypeScript/JS files and Svelte components, excluding test files. Returns an empty array with a warning if no source files are found.
File types are determined by options.get_analyzer. By default, .ts, .js, and .svelte
files are supported. Customize get_analyzer to support additional file types like .svx.
files
Iterable of source file info (from Gro filer, file system, or other source)
Iterable<SourceFileInfo>options
Module source options for filtering
log?
Optional logger for status messages
Logger | undefinedreturns
SourceFileInfo[] library_collect_source_files_from_disknodes #
(disknodes: Iterable<Disknode>, options: ModuleSourceOptions, log?: { info: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; } | undefined): SourceFileInfo[] Collect source files from Gro disknodes, filtering BEFORE conversion to SourceFileInfo.
This avoids errors from files outside source directories (like test fixtures that may
have malformed paths or missing content). The filtering uses module_is_source which
checks source_paths to only include files in configured source directories.
disknodes
Iterator of Gro disknodes from filer
Iterable<Disknode>options
Module source options for filtering
log?
Optional logger for status messages
{ info: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; } | undefinedreturns
SourceFileInfo[] library_context #
{ get: (error_message?: string | undefined) => Library; get_maybe: () => Library | undefined; set: (value: Library) => Library; } library_find_duplicates #
library_pipeline.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" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; star_exports?: string[] | undefined; }[] | undefined; }): Map<...> Find duplicate declaration names across modules.
Returns a Map of declaration names to their full metadata (only includes duplicates). Callers can decide how to handle duplicates (throw, warn, ignore).
source_json
{ [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefine...returns
Map<string, DuplicateInfo[]> examples
const duplicates = library_find_duplicates(source_json);
if (duplicates.size > 0) {
for (const [name, occurrences] of duplicates) {
console.error("${name}" found in:);
for (const {declaration, module} of occurrences) {
console.error( - ${module}:${declaration.source_line} (${declaration.kind}));
}
}
throw new Error(Found ${duplicates.size} duplicate declaration names);
}
library_gen #
(options?: LibraryGenOptions | undefined): Gen Creates a Gen object for generating library metadata with full TypeScript analysis.
This is the Gro-specific entry point. It handles: - Reading files from Gro's filer - Loading package.json via Gro utilities - Returning output in Gro's Gen format
For build-tool agnostic usage, use library_generate directly.
Usage in a .gen.ts file:
import {library_gen} from '@fuzdev/fuz_ui/library_gen.js';
export const gen = library_gen();options?
Optional generation options
LibraryGenOptions | undefinedreturns
Gen library_generate #
library_generate.ts view source
(input: LibraryGenerateInput): LibraryGenerateResult Generate library metadata from source files.
This is the main entry point for library generation. It analyzes source files, extracts metadata, and produces both structured data and file contents.
input
returns
LibraryGenerateResult examples
const result = library_generate({
source_files,
package_json: {name: '@my/lib', version: '1.0.0'},
source_options: module_create_source_options(process.cwd()),
});
await writeFile('library.json', result.json_content);
await writeFile('library.ts', result.ts_content);library_generate_output #
(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }, source_json: { ...; }): LibraryOutputResult Generate the library.json and library.ts file contents. Parses at generation time so runtime only needs the pre-computed result.
Returns JSON + .ts wrapper because:
- JSON is natively importable by Node.js and Vite without TypeScript loaders
- Works in CI environments that don't have TS compilation
- The .ts wrapper validates with zod and exports with proper types
(JSON imports get widened types like string instead of literal unions)
package_json
{ [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }source_json
{ [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefine...returns
LibraryOutputResult library_merge_re_exports #
library_pipeline.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" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; star_exports?: string[] | undefined; }[] | undefined; }, collected_re_exports: CollectedReExport[]): void Build also_exported_from arrays from collected re-export data.
This function resolves the two-phase re-export problem:
Problem: When module A re-exports from module B, we discover this while analyzing A, but need to update B's declarations. However, B may already be processed or may be processed later.
Solution: Collect all re-exports in phase 1, then merge them in phase 2 after all modules are analyzed.
source_json
The source JSON with all modules (will be mutated)
{ [x: string]: unknown; name: string; version: string; modules?: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefine...collected_re_exports
Array of re-exports collected during phase 1
CollectedReExport[]returns
void examples
// helpers.ts exports: foo, bar // index.ts does: export {foo, bar} from './helpers.js' // // After processing: // - helpers.ts foo declaration gets: also_exported_from: ['index.ts'] // - helpers.ts bar declaration gets: also_exported_from: ['index.ts']
library_sort_modules #
library_pipeline.ts view source
(modules: { [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; star_exports?: string[] | undefined; }[]): { ...; }[] Sort modules alphabetically by path for deterministic output and cleaner diffs.
modules
{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...returns
{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un... library_throw_on_duplicates #
library_generate.ts view source
(duplicates: Map<string, DuplicateInfo[]>, log: { error: (...args: unknown[]) => void; }): void Strict duplicate handler that throws on any duplicate declaration names.
Use this callback with library_generate({ on_duplicates: library_throw_on_duplicates })
to enforce a flat namespace where all declaration names must be unique.
duplicates
Map<string, DuplicateInfo[]>log
{ error: (...args: unknown[]) => void; }returns
void throws
Error- if any duplicate declaration names are found
LibraryDetail #
LibraryDetail.svelte view source
library
repo_name?
Snippet<[repo_name: string]>description?
Snippet<[description: string]>motto?
Snippet<[description: string]>npm_url?
Snippet<[npm_url: string]>homepage_url?
Snippet<[homepage_url: string]>children?
Snippet<[library: Library]>LibraryGenerateInput #
library_generate.ts view source
LibraryGenerateInput Input for library metadata generation.
source_files
Source files to analyze (must have content loaded).
Array<SourceFileInfo>package_json
Package metadata (name, version).
PackageJsonsource_options
Module source options for path extraction.
program
Optional TypeScript program. If not provided, one will be created. Pass an existing program to reuse across multiple calls.
ts.Programon_duplicates
Optional callback for handling duplicate declaration names.
log
Optional logger for status and diagnostic messages.
LoggerLibraryGenerateResult #
library_generate.ts view source
LibraryGenerateResult Result of library metadata generation.
source_json
The generated source metadata.
SourceJsonjson_content
JSON file content string.
stringts_content
TypeScript wrapper file content string.
stringLibraryGenOptions #
LibraryGenOptions Options for Gro library generation.
source
Module source options for filtering and path extraction.
Can provide full ModuleSourceOptions or partial options that will be
merged with defaults. The project_root is automatically set to
process.cwd() if not provided.
ModuleSourceOptions | Partial<ModuleSourcePartial>on_duplicates
Callback invoked when duplicate declaration names are found.
Consumers decide how to handle duplicates: throw, warn, or ignore. Use library_throw_on_duplicates for strict flat namespace enforcement.
LibraryOutputResult #
LibraryOutputResult Result of generating library output files. Contains both the JSON data and the TypeScript wrapper file.
json_content
JSON content for library.json
stringts_content
TypeScript wrapper content for library.ts
stringLibrarySummary #
LibrarySummary.svelte view source
library
repo_name?
Snippet<[repo_name: string]>logo?
Snippet<[logo_url: string, logo_alt: string]>motto?
Snippet<[motto: string, glyph?: string]>description?
Snippet<[description: string, glyph?: string]>npm_url?
Snippet<[npm_url: string]>homepage_url?
Snippet<[homepage_url: string]>children?
Snippetload_color_scheme #
(fallback?: ColorScheme, key?: string): ColorScheme fallback
ColorScheme'auto'key
stringCOLOR_SCHEME_STORAGE_KEYreturns
ColorScheme load_from_storage #
<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
stringis_json
Whether to parse the value as JSON
booleanfalseparse_fn?
Optional custom parsing function to transform the value
((value: unknown) => T | null) | undefinedreturns
T | null The parsed value or null if not found or parsing fails
load_theme #
(fallback?: Theme, key?: string): Theme fallback
Themedefault_themes[0]!key
stringTHEME_STORAGE_KEYreturns
Theme logo_fuz #
SvgData logo_fuz_blog #
SvgData logo_fuz_code #
SvgData logo_fuz_css #
SvgData logo_fuz_gitops #
SvgData logo_fuz_mastodon #
SvgData logo_fuz_template #
SvgData logo_fuz_ui #
SvgData logo_fuz_util #
SvgData logo_github #
SvgData logo_gro #
SvgData logo_mdn #
SvgData MAIN_HEADER_MARGIN_TOP #
"calc(60px + var(--space_lg))" MAX_HEADING_LEVEL #
6 MdnLink #
path
stringhash?
URL fragment to append, with or without the #.
stringMdz #
content
stringinline?
booleannowrap?
booleanbase?
stringmdz_base_context #
{ get: (error_message?: string | undefined) => () => string | undefined; get_maybe: () => (() => string | undefined) | undefined; set: (value: () => string | undefined) => () => string | undefined; } Context for providing a base path getter for resolving relative links in mdz content.
Set to a getter (e.g., () => base) so changes to the base prop are reflected
without needing an effect. When the getter returns a path like '/docs/mdz/',
relative paths like ./grammar resolve to /docs/mdz/grammar before rendering.
When not set, relative paths use raw hrefs (browser resolves them).
mdz_components_context #
{ 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 #
{ 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_is_url #
(s: string): boolean s
stringreturns
boolean mdz_parse #
(text: string): MdzNode[] Parses text to an array of MdzNode.
text
stringreturns
MdzNode[] mdz_parse_lexer #
mdz_token_parser.ts view source
(text: string): MdzNode[] Parses text to an array of MdzNode using a two-phase lexer+parser approach.
text
stringreturns
MdzNode[] mdz_to_svelte #
(nodes: MdzNode[], components: Record<string, string>, elements: ReadonlySet<string>, base?: string | undefined): MdzToSvelteResult Converts an array of MdzNode to a Svelte markup string.
Each node type produces output matching what MdzNodeView.svelte renders at runtime. Collects required imports and flags unconfigured component/element references.
nodes
Parsed mdz nodes to render.
MdzNode[]components
Component name to import path mapping (e.g., {Alert: '$lib/Alert.svelte'}).
If content references a component not in this map, has_unconfigured_tags is set.
Record<string, string>elements
Allowed HTML element names (e.g., new Set(['aside', 'details'])).
If content references an element not in this set, has_unconfigured_tags is set.
ReadonlySet<string>base?
Base path for resolving relative links (e.g., '/docs/mdz/').
When provided, relative references (./, ../) are resolved to absolute paths
and passed through resolve(). Trailing slash recommended.
string | undefinedreturns
MdzToSvelteResult MdzBaseNode #
MdzBaseNode type
stringstart
numberend
numberMdzBoldNode #
MdzBoldNode inheritance
type
'Bold'children
Array<MdzNode>MdzCodeblockNode #
MdzCodeblockNode inheritance
type
'Codeblock'lang
string | nullcontent
stringMdzCodeNode #
MdzCodeNode inheritance
type
'Code'content
stringMdzComponentNode #
MdzComponentNode inheritance
type
'Component'name
stringchildren
Array<MdzNode>MdzComponents #
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 #
MdzElementNode inheritance
type
'Element'name
stringchildren
Array<MdzNode>MdzElements #
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 #
MdzHeadingNode inheritance
type
'Heading'level
1 | 2 | 3 | 4 | 5 | 6children
Array<MdzNode>MdzHrNode #
MdzHrNode inheritance
type
'Hr'MdzItalicNode #
MdzItalicNode inheritance
type
'Italic'children
Array<MdzNode>MdzLexer #
constructor
type new (text: string): MdzLexer
text
stringtokenize
type (): MdzToken[]
MdzToken[]MdzLinkNode #
MdzLinkNode inheritance
type
'Link'reference
stringchildren
Array<MdzNode>link_type
'external' | 'internal'MdzNode #
MdzNode MdzNodeView #
MdzNodeView.svelte view source
node
MdzParagraphNode #
MdzParagraphNode inheritance
type
'Paragraph'children
Array<MdzNode>MdzParser #
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
stringparse
Main parse method. Returns flat array of nodes, with paragraph nodes wrapping content between double newlines.
Block elements (headings, HR, codeblocks) are detected at every column-0 position โ they can interrupt paragraphs without requiring blank lines.
type (): MdzNode[]
MdzNode[]MdzPrecompiled #
MdzPrecompiled.svelte view source
Wrapper for precompiled mdz content. Used by svelte_preprocess_mdz. Not intended for direct use.
inline?
booleannowrap?
booleanchildren
SnippetMdzStrikethroughNode #
MdzStrikethroughNode inheritance
type
'Strikethrough'children
Array<MdzNode>MdzTextNode #
MdzTextNode inheritance
type
'Text'content
stringMdzToken #
MdzToken MdzTokenAutolink #
MdzTokenAutolink inheritance
type
'autolink'reference
stringlink_type
'external' | 'internal'MdzTokenBase #
MdzTokenBase start
numberend
numberMdzTokenBoldClose #
MdzTokenBoldClose inheritance
type
'bold_close'MdzTokenBoldOpen #
MdzTokenBoldOpen inheritance
type
'bold_open'MdzTokenCode #
MdzTokenCode inheritance
type
'code'content
stringMdzTokenCodeblock #
MdzTokenCodeblock inheritance
type
'codeblock'lang
string | nullcontent
stringMdzTokenHeadingEnd #
MdzTokenHeadingEnd inheritance
type
'heading_end'MdzTokenHeadingStart #
MdzTokenHeadingStart inheritance
type
'heading_start'level
1 | 2 | 3 | 4 | 5 | 6MdzTokenHr #
MdzTokenHr inheritance
type
'hr'MdzTokenItalicClose #
MdzTokenItalicClose inheritance
type
'italic_close'MdzTokenItalicOpen #
MdzTokenItalicOpen inheritance
type
'italic_open'MdzTokenLinkRef #
MdzTokenLinkRef inheritance
type
'link_ref'reference
stringlink_type
'external' | 'internal'MdzTokenLinkTextClose #
MdzTokenLinkTextClose inheritance
type
'link_text_close'MdzTokenLinkTextOpen #
MdzTokenLinkTextOpen inheritance
type
'link_text_open'MdzTokenParagraphBreak #
MdzTokenParagraphBreak inheritance
type
'paragraph_break'MdzTokenStrikethroughClose #
MdzTokenStrikethroughClose inheritance
type
'strikethrough_close'MdzTokenStrikethroughOpen #
MdzTokenStrikethroughOpen inheritance
type
'strikethrough_open'MdzTokenTagClose #
MdzTokenTagClose inheritance
type
'tag_close'name
stringMdzTokenTagOpen #
MdzTokenTagOpen inheritance
type
'tag_open'name
stringis_component
booleanMdzTokenTagSelfClose #
MdzTokenTagSelfClose inheritance
type
'tag_self_close'name
stringis_component
booleanMdzTokenText #
MdzTokenText inheritance
type
'text'content
stringMdzToSvelteResult #
MdzToSvelteResult Result of converting MdzNode arrays to Svelte markup.
markup
Generated Svelte markup string.
stringimports
Required imports: Map<local_name, {path, kind}>.
Map<string, {path: string; kind: 'default' | 'named'}>has_unconfigured_tags
Whether content references unconfigured Component or Element tags.
booleanMIN_CODEBLOCK_BACKTICKS #
3 Module #
Rich runtime representation of a module with computed properties.
library
type Library
module_json
type ModuleJson
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" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; star_exports?: string[] | undefined; }): Module
library
module_json
{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 19 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
stringDeclaration | undefinedmodule_create_source_options #
(project_root: string, overrides?: Partial<ModuleSourcePartial> | undefined): ModuleSourceOptions Create complete source options from project root and optional overrides.
project_root
Absolute path to project root (typically process.cwd())
stringoverrides?
Optional overrides for default options
Partial<ModuleSourcePartial> | undefinedreturns
ModuleSourceOptions examples
// Standard SvelteKit library
const options = module_create_source_options(process.cwd());// Multiple source directories
const options = module_create_source_options(process.cwd(), {
source_paths: ['src/lib', 'src/routes'],
source_root: 'src',
});// Custom exclusions
const options = module_create_source_options(process.cwd(), {
exclude_patterns: [/\.test\.ts$/, /\.internal\.ts$/],
});module_extract_dependencies #
(source_file: SourceFileInfo, options: ModuleSourceOptions): { dependencies: string[]; dependents: string[]; } Extract dependencies and dependents for a module from source file info.
Filters to only include source modules (excludes external packages, node_modules, tests). Returns sorted arrays of module paths (relative to source_root) for deterministic output.
source_file
The source file info to extract dependencies from
options
Module source options for filtering and path extraction
returns
{ dependencies: string[]; dependents: string[]; } module_extract_path #
(source_id: string, options: ModuleSourceOptions): string Extract module path relative to source root from absolute source ID.
Uses proper path semantics: strips project_root/source_root/ prefix.
source_id
Absolute path to the source file
stringoptions
Module source options for path extraction
returns
string examples
const options = module_create_source_options('/home/user/project');
module_extract_path('/home/user/project/src/lib/foo.ts', options) // => 'foo.ts'
module_extract_path('/home/user/project/src/lib/nested/bar.svelte', options) // => 'nested/bar.svelte'const options = module_create_source_options('/home/user/project', {
source_paths: ['src/lib', 'src/routes'],
source_root: 'src',
});
module_extract_path('/home/user/project/src/lib/foo.ts', options) // => 'lib/foo.ts'
module_extract_path('/home/user/project/src/routes/page.svelte', options) // => 'routes/page.svelte'module_get_analyzer_default #
(path: string): AnalyzerType | null Default analyzer resolver based on file extension.
- .svelte โ 'svelte'
- .ts, .js โ 'typescript'
- Other extensions โ null (skip)
path
stringreturns
AnalyzerType | null module_get_component_name #
(module_path: string): string Extract component name from a Svelte module path.
module_path
stringreturns
string examples
module_get_component_name('Alert.svelte') // => 'Alert'
module_get_component_name('components/Button.svelte') // => 'Button'module_get_key #
(module_path: string): string Convert module path to module key format (with ./ prefix).
module_path
stringreturns
string examples
module_get_key('foo.ts') // => './foo.ts'module_get_source_root #
(options: ModuleSourceOptions): string Get the effective source_root from options.
Returns source_root if provided, otherwise returns source_paths[0] for single-path configs.
options
returns
string throws
Error- if source_root is required but not provided (multiple source_paths)
module_is_css #
(path: string): boolean path
stringreturns
boolean module_is_json #
(path: string): boolean path
stringreturns
boolean module_is_source #
(path: string, options: ModuleSourceOptions): boolean Check if a path is an analyzable source file.
Combines all filtering: exclusion patterns, source directory paths, and analyzer availability. This is the single check for whether a file should be included in library analysis.
Uses proper path semantics with startsWith matching against
project_root/source_path/. No heuristics needed - nested directories
are correctly excluded by the prefix check.
path
Full absolute path to check
stringoptions
Module source options for filtering
returns
boolean True if the path is an analyzable source file
examples
const options = module_create_source_options('/home/user/project');
module_is_source('/home/user/project/src/lib/foo.ts', options) // => true
module_is_source('/home/user/project/src/lib/foo.test.ts', options) // => false (excluded)
module_is_source('/home/user/project/src/fixtures/mini/src/lib/bar.ts', options) // => false (wrong prefix)module_is_svelte #
(path: string): boolean path
stringreturns
boolean module_is_test #
(path: string): boolean path
stringreturns
boolean module_is_typescript #
(path: string): boolean Check if a path is a TypeScript or JS file.
Includes both .ts and .js files since JS files are valid in TS projects.
Excludes .d.ts declaration files - use a custom get_analyzer to include them.
path
stringreturns
boolean MODULE_SOURCE_PARTIAL #
ModuleSourcePartial Default partial options for standard SvelteKit library structure.
Does not include project_root - use module_create_source_options() to create
complete options with your project root.
module_validate_source_options #
(options: ModuleSourceOptions): void Validate ModuleSourceOptions format and consistency.
Checks:
1. project_root is an absolute path (starts with /)
2. source_paths entries don't have leading/trailing slashes
3. source_root (if provided) doesn't have leading/trailing slashes
4. Multiple source_paths require explicit source_root
5. source_root is a prefix of all source_paths
options
returns
void throws
Error- if validation fails
examples
// Valid - single source path (source_root auto-derived)
module_validate_source_options({
project_root: '/home/user/project',
source_paths: ['src/lib'],
...
});// Valid - multiple source paths with explicit source_root
module_validate_source_options({
project_root: '/home/user/project',
source_paths: ['src/lib', 'src/routes'],
source_root: 'src',
...
});// Invalid - multiple source paths without source_root
module_validate_source_options({
project_root: '/home/user/project',
source_paths: ['src/lib', 'src/routes'], // throws
...
});ModuleAnalysis #
library_analysis.ts view source
ModuleAnalysis Result of analyzing a module (TypeScript or Svelte). Both analyzers return this same structure for uniform handling.
path
Module path relative to source root.
stringmodule_comment
Module-level documentation comment.
stringdeclarations
All declarations with nodocs flags - consumer filters based on policy.
Array<DeclarationAnalysis>dependencies
Dependencies (other source modules this module imports). Empty if none.
Array<string>dependents
Dependents (other source modules that import this module). Empty if none.
Array<string>star_exports
Star exports (export * from './module'). Empty for Svelte components.
Array<string>re_exports
Re-exports discovered during analysis. Empty for Svelte components.
Array<ReExportInfo>ModuleExportsAnalysis #
ModuleExportsAnalysis Result of analyzing a module's exports.
module_comment
Module-level documentation comment.
stringdeclarations
All exported declarations with nodocs flags - consumer filters based on policy.
Array<DeclarationAnalysis>re_exports
Same-name re-exports (for building also_exported_from in post-processing).
Array<ReExportInfo>star_exports
Star exports (export * from './module') - module paths that are fully re-exported.
Array<string>ModuleLink #
module_path
stringhash?
URL fragment to append, with or without the #.
stringModuleSkippedDiagnostic #
analysis_context.ts view source
ModuleSkippedDiagnostic Module was skipped during analysis. Could be due to missing source file in program or no analyzer available.
inheritance
kind
'module_skipped'reason
Reason the module was skipped.
'not_in_program' | 'no_analyzer'ModuleSourceOptions #
ModuleSourceOptions Configuration for module source detection and path extraction.
Uses proper path semantics with project_root as the base for all path operations.
Paths are matched using startsWith rather than substring search, which correctly
handles nested directories without special heuristics.
examples
const options = module_create_source_options(process.cwd(), {
source_paths: ['src/lib', 'src/routes'],
source_root: 'src',
});project_root
Absolute path to the project root directory.
All source_paths are relative to this. Typically process.cwd() when
running from the project root via Gro, Vite, or other build tools.
stringsource_paths
Source directory paths to include, relative to project_root.
Paths should not have leading or trailing slashes - they are added internally for correct matching.
Array<string>source_root
Source root for extracting relative module paths, relative to project_root.
When omitted:
- Single source_path: defaults to that path
- Multiple source_paths: required (no auto-derivation)
stringexclude_patterns
Patterns to exclude (matched against full path).
Array<RegExp>get_analyzer
Determine which analyzer to use for a file path.
Called for files in source directories. Return 'typescript', 'svelte',
or null to skip the file. This is the single source of truth for which
files are analyzable and how to analyze them.
(path: string) => AnalyzerType | nullModuleSourcePartial #
ModuleSourcePartial Partial source options without project_root.
Use with module_create_source_options to build complete options.
NEWLINE #
10 NINE #
57 OnDisconnect #
intersect.svelte.ts view source
OnDisconnect OnDuplicatesCallback #
library_generate.ts view source
OnDuplicatesCallback Callback for handling duplicate declaration names.
OnIntersect #
intersect.svelte.ts view source
OnIntersect package_is_published #
package_helpers.ts view source
(package_json: { [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }): boolean Check if a package is published to npm.
A package is considered published if: - It's not marked as private - It has exports defined - Its version is not the initial '0.0.1'
package_json
The package.json object to check
{ [x: string]: unknown; name: string; version: string; private?: boolean | undefined; description?: string | undefined; motto?: string | undefined; glyph?: string | undefined; logo?: string | undefined; ... 23 more ...; exports?: string | ... 2 more ... | undefined; }returns
boolean True if the package appears to be published
parse_csp_directive #
(directive: unknown): keyof CspDirectives | null directive
unknownreturns
keyof CspDirectives | null parse_csp_trust_level #
(trust: unknown): "low" | "medium" | "high" | null Validates and extracts a CSP trust level from an unknown value.
trust
unknownreturns
"low" | "medium" | "high" | null parse_library_url_prefix #
(value: unknown): string Normalizes a URL prefix: ensures leading /, strips trailing /, returns '' for falsy and non-string values.
value
unknownreturns
string PasteFromClipboard #
PasteFromClipboard.svelte view source
onclipboardtext
(text: string) => voidonerror?
(error: Error) => voidPendingAnimation #
PendingAnimation.svelte view source
inline?
booleanrunning?
booleanitem_attrs?
SvelteHTMLElements['span']children?
Snippet<[index: number]>PendingButton #
PendingButton.svelte view source
pending
booleanonclick
() => voidrunning?
booleantitle?
stringdisabled?
booleananimation?
Snippetchildren
SnippetPERCENT #
37 PERIOD #
46 PLUS #
43 ProjectLinks #
QUESTION #
63 Redirect #
host?
The target host to redirect to. Defaults to the current location.host.
stringpath?
The target path to redirect to. Defaults to the current location.pathname.
stringauto?
Should the redirect happen automatically without user input? Defaults to true.
booleanchildren?
Snippet<[url: string]>ReExportInfo #
library_analysis.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.
stringoriginal_module
Module path (relative to src/lib) where the declaration is originally declared.
stringrender_value_to_string #
(value: unknown): string value
unknownreturns
string repo_name_parse #
package_helpers.ts view source
(name: string): string Extract repository name without scope from package name.
name
Package name (can be scoped like '@org/package')
stringreturns
string Repository name without scope
throws
Error- if scoped package name is malformed
examples
repo_name_parse('@fuzdev/fuz_ui')
// => 'fuz_ui'repo_name_parse('lodash')
// => 'lodash'repo_url_github_owner #
package_helpers.ts view source
(repo_url: string): string | null Extract GitHub owner/org name from repository URL.
repo_url
Repository URL (e.g., 'https://github.com/owner/repo')
stringreturns
string | null Owner name, or null if not a valid GitHub URL
examples
repo_url_github_owner('https://github.com/fuzdev/fuz_ui')
// => 'fuzdev'repo_url_github_owner('https://gitlab.com/foo/bar')
// => null (not a GitHub URL)repo_url_parse #
package_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.
Handles both string format and object format with url property.
Strips common prefixes ('git+') and suffixes ('.git', '/').
repository
The repository field from package.json
string | { [x: string]: unknown; type: string; url: string; directory?: string | undefined; } | undefinedreturns
string | null Clean repository URL, or null if not provided
examples
repo_url_parse('https://github.com/foo/bar')
// => 'https://github.com/foo/bar'repo_url_parse({url: 'git+https://github.com/foo/bar.git'})
// => 'https://github.com/foo/bar'repo_url_parse(undefined)
// => nullresolve_relative_path #
(reference: string, base: string): string Resolves a relative path (./ or ../) against a base path.
The base is treated as a directory regardless of trailing slash
('/docs/mdz' and '/docs/mdz/' behave identically).
Handles embedded . and .. segments within the reference
(e.g., './a/../b' โ navigates up then down).
Clamps at root โ excess .. segments stop at / rather than escaping.
reference
A relative path starting with ./ or ../.
stringbase
An absolute base path (e.g., '/docs/mdz/'). Empty string is treated as root.
stringreturns
string An absolute resolved path (e.g., '/docs/mdz/grammar').
RIGHT_ANGLE #
62 RIGHT_BRACKET #
93 RIGHT_PAREN #
41 RootMenuState #
contextmenu_state.svelte.ts view source
is_menu
menu
depth
items
type ReadonlyArray<ItemState>
save_color_scheme #
(color_scheme: ColorScheme | null, key?: string): void color_scheme
ColorScheme | nullkey
stringCOLOR_SCHEME_STORAGE_KEYreturns
void save_theme #
(theme: Theme | null, key?: string): void theme
Theme | nullkey
stringTHEME_STORAGE_KEYreturns
void save_to_storage #
(key: string, value: any, is_json?: boolean): void Utility function to save a value to localStorage.
key
stringvalue
anyis_json
booleanfalsereturns
void selected_variable_context #
style_variable_helpers.svelte.ts view source
{ get: () => SelectedStyleVariable; set: (value?: SelectedStyleVariable | undefined) => SelectedStyleVariable; } SelectedStyleVariable #
style_variable_helpers.svelte.ts view source
value
type StyleVariable | null
constructor
type new (initial?: { name: string; light?: string | undefined; dark?: string | undefined; summary?: string | undefined; } | null): SelectedStyleVariable
initial
{ name: string; light?: string | undefined; dark?: string | undefined; summary?: string | undefined; } | nullnullSEMICOLON #
59 SignatureAnalysisDiagnostic #
analysis_context.ts view source
SignatureAnalysisDiagnostic Function/method signature analysis failed.
inheritance
kind
'signature_analysis_failed'function_name
Name of the function or method.
stringSLASH #
47 source_file_from_disknode #
(disknode: Disknode): SourceFileInfo Convert Gro's Disknode to the build-tool agnostic SourceFileInfo interface.
Use this when you want to analyze files using Gro's filer directly.
disknode
Disknodereturns
SourceFileInfo throws
Error- if disknode has no content (should be loaded by Gro filer)
SourceFileInfo #
SourceFileInfo File information for source analysis.
Can be constructed from Gro's Disknode or from plain file system access. This abstraction enables non-Gro usage while keeping Gro support via adapter.
Note: content is required to keep analysis functions pure (no hidden I/O).
Callers are responsible for reading file content before analysis.
id
Absolute path to the file.
stringcontent
File content (required - analysis functions don't read from disk).
stringdependencies
Absolute file paths of modules this file imports (optional). Only include resolved local imports, not node_modules. Order should be declaration order in source for deterministic output.
ReadonlyArray<string>dependents
Absolute file paths of modules that import this file (optional). Only include resolved local imports, not node_modules.
ReadonlyArray<string>SPACE #
32 Spiders #
spiders?
Array<string>seed?
unknownrandom?
typeof Math.randomStyleVariableButton #
StyleVariableButton.svelte view source
name
stringinline?
booleanplain?
booleanSubmenuState #
contextmenu_state.svelte.ts view source
is_menu
menu
type SubmenuState | RootMenuState
depth
type number
selected
type boolean
items
type ReadonlyArray<ItemState>
constructor
type new (menu: SubmenuState | RootMenuState, depth: number): SubmenuState
menu
SubmenuState | RootMenuStatedepth
numbersvelte_analyze_component #
(ts_code: string, source_file: SourceFile, checker: TypeChecker, component_name: string, file_path: string, source_map: TraceMap | null, ctx: AnalysisContext): { ...; } Analyze a Svelte component from its svelte2tsx transformation.
ts_code
stringsource_file
SourceFilechecker
TypeCheckercomponent_name
stringfile_path
stringsource_map
TraceMap | nullctx
returns
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; } svelte_analyze_file #
(source_file: SourceFileInfo, module_path: string, checker: TypeChecker, ctx: AnalysisContext): SvelteFileAnalysis Analyze a Svelte component file.
This is a high-level function that handles the complete workflow: 1. Transform Svelte source to TypeScript via svelte2tsx 2. Extract component metadata (props, documentation) 3. Extract module-level documentation
Suitable for use in documentation generators, build tools, and analysis.
source_file
Source file info with path and content
module_path
Module path relative to source root (e.g., 'Alert.svelte')
stringchecker
TypeScript type checker for type resolution
TypeCheckerctx
Analysis context for collecting diagnostics
returns
SvelteFileAnalysis Component declaration and optional module-level comment
svelte_analyze_module #
(source_file: SourceFileInfo, module_path: string, checker: TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext): ModuleAnalysis Analyze a Svelte component file and extract module metadata.
Wraps svelte_analyze_file and adds dependency information from the source file info if available.
This is a high-level function suitable for building documentation or library metadata. For lower-level analysis, use svelte_analyze_file directly.
Returns raw analysis data matching ModuleAnalysis structure. Consumer decides filtering policy (Svelte components are never nodocs).
source_file
The source file info (from Gro filer, file system, or other source)
module_path
The module path (relative to source root)
stringchecker
TypeScript type checker
TypeCheckeroptions
Module source options for path extraction
ctx
Analysis context for collecting diagnostics
returns
ModuleAnalysis Module analysis matching ModuleAnalysis structure
svelte_extract_module_comment #
(script_content: string): string | undefined Extract module-level comment from Svelte script content.
Requires @module tag to identify module comments. The tag line is stripped
from the output.
script_content
The content of the <script> tag.
stringreturns
string | undefined The cleaned module comment text, or undefined if none found.
svelte_extract_script_content #
(svelte_source: string): string | undefined Extract the content of the main <script> tag from Svelte source.
Matches <script> or <script lang="ts"> but not <script module>.
Returns undefined if no matching script tag is found.
svelte_source
stringreturns
string | undefined svelte_preprocess_mdz #
svelte_preprocess_mdz.ts view source
(options?: SveltePreprocessMdzOptions): PreprocessorGroup Creates a Svelte preprocessor that compiles static Mdz content at build time.
options
Configuration for component/element resolution and file filtering.
{}returns
PreprocessorGroup A Svelte PreprocessorGroup for use in svelte.config.js.
SvelteFileAnalysis #
SvelteFileAnalysis Result of analyzing a Svelte file.
declaration
The component declaration metadata.
DeclarationJsonmodule_comment
Module-level documentation comment, if present.
stringSveltePreprocessMdzOptions #
svelte_preprocess_mdz.ts view source
SveltePreprocessMdzOptions Options for svelte_preprocess_mdz.
exclude
File patterns to exclude.
Array<string | RegExp>components
Component import mapping for mdz content. Key: component name as used in mdz (e.g., 'Alert'). Value: import path (e.g., '$lib/Alert.svelte').
If mdz content references a component not in this map, that Mdz usage is skipped (left as runtime).
Record<string, string>elements
Allowed HTML elements in mdz content. If mdz content references an element not in this list, that Mdz usage is skipped (left as runtime).
Array<string>component_imports
Import sources that resolve to the Mdz component. Used to verify that Mdz in templates refers to fuz_ui's Mdz.svelte.
Array<string>compiled_component_import
Import path for the precompiled wrapper component.
stringon_error
How to handle errors during mdz parsing or rendering.
'log' | 'throw'SveltePropDiagnostic #
analysis_context.ts view source
SveltePropDiagnostic Svelte prop type resolution failed.
inheritance
kind
'svelte_prop_failed'component_name
Name of the component.
stringprop_name
Name of the prop.
stringSvg #
data
SvgDatafill?
Overrides data.fill.
string | nullsize?
Sets both the width and height of the svg. Overridden by the width and height props.
stringwidth?
Sets the width of the svg. Overrides size.
stringheight?
Sets the height of the svg. Overrides size.
stringlabel?
stringinline?
Renders the SVG as an inline block with spacing appropriate for text. Defaults to false.
booleanshrink?
booleansync_color_scheme #
(color_scheme: ColorScheme | null): void color_scheme
ColorScheme | nullreturns
void TAB #
9 Teleport #
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.
HTMLElement | undefined | nullonmove?
(el: HTMLElement, to: HTMLElement) => voidchildren
SnippetTHEME_STORAGE_KEY #
"fuz:theme" Themed #
sync_color_scheme?
typeof default_sync_color_schemeload_color_scheme?
typeof default_load_color_schemesave_color_scheme?
typeof default_save_color_schemeload_theme?
typeof default_load_themesave_theme?
typeof default_save_themetheme_fallback?
Theme | undefinedthemer?
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.
children
Snippet<[themer: Themer, style: string | null, theme_style_html: string | null]>ThemeInput #
selected_theme?
{theme: Theme}themes?
Array<Theme>enable_editing?
booleanselect?
((theme: Theme) => void | boolean) | nullonselect?
(theme: Theme) => voidonedit?
(theme: Theme) => voidThemer #
theme
type Theme
color_scheme
type ColorScheme
constructor
type new (options?: Partial<ThemerJson> | undefined): Themer
options?
Partial<ThemerJson> | undefinedtoJSON
type (): ThemerJson
themer_context #
{ get: (error_message?: string | undefined) => Themer; get_maybe: () => Themer | undefined; set: (value: Themer) => Themer; } ThemerJson #
ThemerJson theme
Themecolor_scheme
ColorSchemeThemerOptions #
Partial<ThemerJson> TILDE #
126 to_dialog_params #
<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
Tprops
ComponentProps<T>dialog_props?
Partial<Record<string, any>> | undefinedreturns
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
stringpathname
stringroot_path
stringDOCS_PATH_DEFAULTreturns
{ path: string; path_is_selected: boolean; path_segment: string | undefined; } to_tome_pathname #
(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
string | { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }docs_path
stringDOCS_PATH_DEFAULThash?
URL fragment to append, with or without the #.
string | undefinedreturns
string Tome #
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 #
{ 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 #
TomeContent.svelte view source
tome
docs_path?
stringheader?
Snippetchildren
SnippetTomeHeader #
TomeLink #
name
stringdocs_path?
stringhash?
URL fragment to append, with or without the #.
stringtomes_context #
{ 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 #
TomeSection.svelte view source
children
SnippetTomeSectionHeader #
TomeSectionHeader.svelte view source
text
stringtag?
children?
Snippettrim_trailing_punctuation #
(url: string): string Trim trailing punctuation from URL/path per RFC 3986 and GFM rules. - Trims simple trailing: .,;:!?] - Balanced logic for () only (valid in path components) - Invalid chars like [] {} are already stopped by whitelist, but ] trimmed as fallback
Optimized to avoid O(nยฒ) string slicing - tracks end index and slices once at the end.
url
stringreturns
string ts_analyze_declaration #
(symbol: Symbol, source_file: SourceFile, checker: TypeChecker, ctx: AnalysisContext): DeclarationAnalysis 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
Symbolsource_file
The source file containing the symbol
SourceFilechecker
The TypeScript type checker
TypeCheckerctx
Optional analysis context for collecting diagnostics
returns
DeclarationAnalysis Complete declaration metadata including docs, types, and parameters, plus nodocs flag
ts_analyze_module #
(source_file_info: SourceFileInfo, ts_source_file: SourceFile, module_path: string, checker: TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext): ModuleAnalysis Analyze a TypeScript file and extract module metadata.
Wraps ts_analyze_module_exports and adds dependency information from the source file info if available.
This is a high-level function suitable for building documentation or library metadata. For lower-level analysis, use ts_analyze_module_exports directly.
source_file_info
The source file info (from Gro filer, file system, or other source)
ts_source_file
TypeScript source file from the program
SourceFilemodule_path
The module path (relative to source root)
stringchecker
TypeScript type checker
TypeCheckeroptions
Module source options for path extraction
ctx
Analysis context for collecting diagnostics
returns
ModuleAnalysis Module metadata and re-export information
ts_analyze_module_exports #
(source_file: SourceFile, checker: TypeChecker, options: ModuleSourceOptions, ctx: AnalysisContext): 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
- Star exports (export * from): tracked in star_exports for namespace-level info
This is a mid-level function (above ts_extract_*, below library_gen)
suitable for building documentation, API explorers, or analysis tools.
For standard SvelteKit library layouts, use module_create_source_options(process.cwd()).
source_file
The TypeScript source file to analyze
SourceFilechecker
The TypeScript type checker
TypeCheckeroptions
Module source options for path extraction in re-exports
ctx
Analysis context for collecting diagnostics
returns
ModuleExportsAnalysis Module comment, declarations, re-exports, and star exports
ts_create_program #
(options?: TsProgramOptions | undefined, log?: Logger | undefined): TsProgram Create TypeScript program for analysis.
options?
Configuration options for program creation
TsProgramOptions | undefinedlog?
Optional logger for info messages
Logger | undefinedreturns
TsProgram The program and type checker
throws
Error- if tsconfig.json is not found
ts_extract_class_info #
(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract class information with rich member metadata.
node
Node_symbol
Symbolchecker
TypeCheckerdeclaration
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }ctx
returns
void ts_extract_function_info #
(node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }, tsdoc: TsdocParsedComment | undefined, ctx: AnalysisContext): void Extract function/method information including parameters with descriptions and default values.
node
Nodesymbol
Symbolchecker
TypeCheckerdeclaration
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }tsdoc
TsdocParsedComment | undefinedctx
returns
void ts_extract_module_comment #
(source_file: SourceFile): string | undefined Extract module-level comment.
Requires @module tag to identify module comments. The tag line is stripped
from the output. Supports optional module renaming: @module custom-name.
source_file
SourceFilereturns
string | undefined see also
ts_extract_signature_parameters #
(sig: Signature, checker: TypeChecker, tsdoc_params: Map<string, string> | undefined): { name: string; type: string; optional?: boolean | undefined; description?: string | undefined; default_value?: string | undefined; }[] Extract parameters from a TypeScript signature with TSDoc descriptions and default values.
Shared helper for extracting parameter information from both standalone functions and class methods/constructors.
sig
The TypeScript signature to extract parameters from
Signaturechecker
TypeScript type checker for type resolution
TypeCheckertsdoc_params
Map of parameter names to TSDoc descriptions (from tsdoc.params)
Map<string, string> | undefinedreturns
{ name: string; type: string; optional?: boolean | undefined; description?: string | undefined; default_value?: string | undefined; }[] Array of parameter info objects
ts_extract_type_info #
(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract type/interface information with rich property metadata.
node
Node_symbol
Symbolchecker
TypeCheckerdeclaration
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }ctx
returns
void ts_extract_variable_info #
(node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 20 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract variable information.
node
Nodesymbol
Symbolchecker
TypeCheckerdeclaration
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }ctx
returns
void ts_infer_declaration_kind #
(symbol: Symbol, node: Node): "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css" Infer declaration kind from symbol and node.
Maps TypeScript constructs to DeclarationKind:
- Classes โ 'class'
- Functions (declarations, expressions, arrows) โ 'function'
- Interfaces, type aliases โ 'type'
- Enums (regular and const) โ 'type'
- Variables โ 'variable' (unless function-valued โ 'function')
symbol
Symbolnode
Nodereturns
"function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css" tsdoc_apply_to_declaration #
(declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 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
{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }tsdoc
parsed TSDoc comment (if available)
TsdocParsedComment | undefinedreturns
void tsdoc_clean_comment #
(comment_text: string): string | undefined Clean raw JSDoc comment text by removing comment markers and leading asterisks.
Transforms /** ... *\/ style comments into clean text.
comment_text
The raw comment text including /** and *\/ markers
stringreturns
string | undefined Cleaned comment text, or undefined if empty after cleaning
tsdoc_parse #
(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
Nodesource_file
Source file (used for extracting full @see tag text)
SourceFilereturns
TsdocParsedComment | undefined tsdoc_see_to_mdz #
(content: string): string Convert raw TSDoc @see content to mdz format for rendering.
Handles TSDoc link syntax:
- |text โ [text](url) (markdown link)
- ://... โ https://... (bare URL, auto-linked by mdz)
- `` โ `` identifier `` (code formatting)
- Bare URLs โ returned as-is
- Bare identifiers โ wrapped in backticks
- identifier description text โ `` identifier description text `` (first token is the reference)
content
raw @see tag content in TSDoc format
stringreturns
string mdz-formatted string ready for Mdz component
examples
tsdoc_see_to_mdz('://fuz.dev|API Docs')
// โ '[API Docs](https://fuz.dev)'
tsdoc_see_to_mdz('')
// โ '`SomeType`'
tsdoc_see_to_mdz('https://example.com')
// โ 'https://example.com'
tsdoc_see_to_mdz('library_gen.ts for Gro-specific integration')
// โ '`library_gen.ts` for Gro-specific integration'TsdocParsedComment #
TsdocParsedComment Parsed JSDoc/TSDoc comment with structured metadata.
text
Comment text (excluding comment markers)
stringparams
Parameter descriptions mapped by parameter name
Map<string, string>returns
Return value description from @returns
stringthrows
Thrown errors from @throws
Array<{type?: string; description: string}>examples
Code examples from @example
Array<string>deprecated_message
Deprecation message from @deprecated
stringsee_also
Related references from @see
Array<string>since
Version information from @since
stringmutates
Mutation documentation from @mutates (non-standard)
Array<string>nodocs
Whether to exclude from documentation. From @nodocs tag.
booleanTsModifier #
TsModifier TypeScript modifier keywords extracted from declarations.
These are the access modifiers and other keywords that can appear on class members, interface properties, etc.
TsProgram #
TsProgram Result of creating a TypeScript program.
program
ts.Programchecker
ts.TypeCheckerTsProgramOptions #
TsProgramOptions Options for creating a TypeScript program.
root
Project root directory.
stringtsconfig
Path to tsconfig.json (relative to root).
stringcompiler_options
Override compiler options.
ts.CompilerOptionsTypeExtractionDiagnostic #
analysis_context.ts view source
TypeExtractionDiagnostic Type extraction failed (e.g., complex or recursive types).
inheritance
kind
'type_extraction_failed'symbol_name
Name of the symbol whose type couldn't be extracted.
stringTypeLink #
type
stringhash?
URL fragment to append, with or without the #.
stringUNDERSCORE #
95 url_api_declaration #
library_helpers.ts view source
(declaration_name: string): string Build project-relative API documentation URL with hash anchor.
declaration_name
Name of the declaration to link to
stringreturns
string URL path like '/docs/api#declaration_name'
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
Package homepage URL
stringdeclaration_name
Name of the declaration to link to
stringreturns
string Full URL like 'https://example.com/docs/api#declaration_name'
url_api_module #
library_helpers.ts view source
(module_path: string): string Build project-relative module documentation URL.
module_path
Module path (e.g., 'helpers.ts')
stringreturns
string URL path like '/docs/api/helpers.ts'
url_github_file #
package_helpers.ts view source
(repo_url: string, file_path: string, line?: number | undefined): string Build GitHub file URL for a repository.
repo_url
Repository URL (e.g., 'https://github.com/owner/repo')
stringfile_path
Path to the file (leading './' is stripped)
stringline?
Optional line number for deep linking
number | undefinedreturns
string Full GitHub URL to the file on the main branch
examples
url_github_file('https://github.com/foo/bar', 'src/index.ts')
// => 'https://github.com/foo/bar/blob/main/src/index.ts'url_github_file('https://github.com/foo/bar', './src/index.ts', 42)
// => 'https://github.com/foo/bar/blob/main/src/index.ts#L42'url_github_org #
package_helpers.ts view source
(repo_url: string, repo_name: string): string | null Build GitHub organization URL from repo URL and repo name.
repo_url
Repository URL (e.g., 'https://github.com/owner/repo')
stringrepo_name
Repository name to strip from the URL
stringreturns
string | null Organization URL, or null if repo_url doesn't end with repo_name
examples
url_github_org('https://github.com/fuzdev/fuz_ui', 'fuz_ui')
// => 'https://github.com/fuzdev'url_npm_package #
package_helpers.ts view source
(package_name: string): string Build npm package URL.
package_name
Package name (can be scoped like '@org/package')
stringreturns
string Full npm package page URL
examples
url_npm_package('@fuzdev/fuz_ui')
// => 'https://www.npmjs.com/package/@fuzdev/fuz_ui'url_package_logo #
library_helpers.ts view source
(homepage_url: string | null, logo_path?: string | undefined): string | null Build package logo URL with favicon.png fallback.
homepage_url
Package homepage URL, or null
string | nulllogo_path?
Optional custom logo path (defaults to 'favicon.png')
string | undefinedreturns
string | null Full URL to the logo, or null if no homepage
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.
Uses SvelteKit's page state for the current origin by default.
url
Full URL to convert
stringorigin
Origin to strip (defaults to current page origin)
stringpage.url.originreturns
string Root-relative URL starting with '/'
examples
// Assuming page.url.origin is 'https://example.com' url_to_root_relative('https://example.com/docs/api') // => '/docs/api'
url_well_known #
package_helpers.ts view source
(homepage_url: string, filename: string): string Build .well-known URL for package metadata files.
homepage_url
Package homepage URL
stringfilename
Filename in .well-known directory
stringreturns
string Full URL to the .well-known file
examples
url_well_known('https://fuz.dev', 'package.json')
// => 'https://fuz.dev/.well-known/package.json'vite_plugin_library_well_known #
vite_plugin_library_well_known.ts view source
(options?: VitePluginLibraryWellKnownOptions): Plugin<any> Vite plugin that publishes package.json and library.json to .well-known/.
Requires a generated library.json file (created by library_gen from gro gen).
The plugin reads this JSON file and publishes its metadata to .well-known/ for
both dev and production builds.
Note: This plugin respects SvelteKit's base path configuration, so .well-known/
will be served at {base}.well-known/ (e.g., /my-app/.well-known/). This deviates
from RFC 8615 which specifies .well-known should be at the domain root. This tradeoff
allows the plugin to work correctly when apps are deployed to non-root paths.
Note: CORS headers are only set for the dev server. For production, configure CORS at the server level (nginx, Caddy, etc.) if cross-origin access is needed.
options
{}returns
Plugin<any> examples
// vite.config.ts
import {defineConfig} from 'vite';
import {sveltekit} from '@sveltejs/kit/vite';
import {vite_plugin_library_well_known} from '@fuzdev/fuz_ui/vite_plugin_library_well_known.js';
export default defineConfig({
plugins: [sveltekit(), vite_plugin_library_well_known()],
});VitePluginLibraryWellKnownOptions #
vite_plugin_library_well_known.ts view source
VitePluginLibraryWellKnownOptions library_path
Path to the library.json file (relative to vite.config.ts).
stringZ_LOWER #
122 Z_UPPER #
90 ZERO #
48