status?
color?
stringonclick?
(() => void) | undefineddisabled?
booleanicon?
string | Snippet<[icon: string]> | null | undefinedchildren
SnippetSvelte UI library
301 declarations
status?color?stringonclick?(() => void) | undefineddisabled?booleanicon?string | Snippet<[icon: string]> | null | undefinedchildrenSnippetRecord<AlertStatus, AlertStatusOptions> AlertStatus AlertStatusOptions colorstringiconstring | nullanalysis_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.
diagnosticstype Array<Diagnostic>
addAdd a diagnostic to the collection.
type (diagnostic: Diagnostic): void
diagnosticvoidhas_errorsCheck if any errors were collected.
type (): boolean
booleanhas_warningsCheck if any warnings were collected.
type (): boolean
booleanerrorsGet all error diagnostics.
type (): Diagnostic[]
Diagnostic[]warningsGet all warning diagnostics.
type (): Diagnostic[]
Diagnostic[]by_kindGet diagnostics of a specific kind.
type <K extends DiagnosticKind>(kind: K): (Extract<TypeExtractionDiagnostic, { kind: K; }> | Extract<SignatureAnalysisDiagnostic, { ...; }> | Extract<...> | Extract<...> | Extract<...>)[]
kindK(Extract<TypeExtractionDiagnostic, { kind: K; }> | Extract<SignatureAnalysisDiagnostic, { kind: K; }> | Extract<...> | Extract<...> | Extract<...>)[]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.svelte view source
declarationsArray<Declaration>search_query?stringlibrary?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.
booleanmodule_pathThe 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.
analysis_context.ts view source
BaseDiagnostic Base diagnostic fields shared by all diagnostic types.
kindfileFile path relative to project root (display with './' prefix).
stringlineLine number (1-based), or null if location unavailable.
number | nullcolumnColumn number (1-based), or null if location unavailable.
number | nullmessageHuman-readable description of the issue.
stringseveritypath?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?Snippettag?string | undefinedalign?'left' | 'right' | 'above' | 'below'icon?string | SnippetchildrenSnippetanalysis_context.ts view source
ClassMemberDiagnostic Class member analysis failed.
kind'class_member_failed'class_nameName of the class.
stringmember_nameName of the member that failed.
stringlibrary_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_moduleThe module that re-exports the declaration.
stringre_exportThe re-export info (name and original module).
"sha256-QOxqn7EUzb3ydF9SALJoJGWSvywW9R0AfTDSenB83Z8=" "fuz:color-scheme" ColorSchemeInput.svelte view source
value?{color_scheme: ColorScheme}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.
paramsContextmenu parameters or nullish to disable
U | null | undefinedAttachment<HTMLElement | SVGElement> contextmenu_helpers.ts view source
(menu_x: number, menu_width: number, layout_width: number): number menu_xnumbermenu_widthnumberlayout_widthnumbernumber contextmenu_helpers.ts view source
(menu_y: number, menu_height: number, layout_height: number): number menu_ynumbermenu_heightnumberlayout_heightnumbernumber 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_scopedGetter function that returns the current scoped value
() => booleanvoid contextmenu_state.svelte.ts view source
{ get: (error_message?: string | undefined) => ContextmenuState; get_maybe: () => ContextmenuState | undefined; set: (value: ContextmenuState) => ContextmenuState; } contextmenu_helpers.ts view source
(contextmenu: ContextmenuState): Map<string, () => void> contextmenuMap<string, () => void> contextmenu_helpers.ts view source
(keyboard_handlers: Map<string, () => void>): (e: KeyboardEvent) => void keyboard_handlersMap<string, () => void>(e: KeyboardEvent) => void contextmenu_helpers.ts view source
11 contextmenu_helpers.ts view source
750 contextmenu_helpers.ts view source
633 contextmenu_helpers.ts view source
21 contextmenu_helpers.ts view source
-2 contextmenu_helpers.ts view source
-2 contextmenu_state.svelte.ts view source
{ get: () => Dimensions; set: (value?: Dimensions | undefined) => Dimensions; } 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.
targetEventTarget | nullshiftKeybooleanboolean 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.
targetthe leaf element from which to open the contextmenu
HTMLElement | SVGElementxthe page X coordinate at which to open the contextmenu, typically the mouse pageX
numberythe page Y coordinate at which to open the contextmenu, typically the mouse pageY
numbercontextmenuthe contextmenu store
options?optional configuration for filtering entries and haptic feedback
ContextmenuOpenOptions | undefinedboolean a boolean indicating if the menu was opened or not
contextmenu_state.svelte.ts view source
{ get: (error_message?: string | undefined) => SubmenuState; get_maybe: () => SubmenuState | undefined; set: (value: SubmenuState) => SubmenuState; } contextmenu_state.svelte.ts view source
ContextmenuActivateResult ContextmenuEntry.svelte view source
runicon?string | SnippetchildrenSnippetdisabled?booleanContextmenuLinkEntry.svelte view source
hrefstringicon?string | Snippetchildren?Snippetdisabled?booleanexternal_rel?stringcontextmenu_state.svelte.ts view source
ContextmenuOpenOptions link_enabledbooleantext_enabledbooleanseparator_enabledbooleanvibratebooleancontextmenu_state.svelte.ts view source
ContextmenuParams 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>]> | nullchildrenSnippetContextmenuRootForSafariCompatibility.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>]> | nullchildrenSnippetcontextmenu_state.svelte.ts view source
ContextmenuRun contextmenu_state.svelte.ts view source
Creates a contextmenu store.
See usage with ContextmenuRoot.svelte and Contextmenu.svelte.
layouttype Dimensions
has_custom_layoutIf an initial layout is provided, control is deferred externally. Otherwise the layout syncs to the page dimensions.
type boolean
openedtype boolean
xtype number
ytype number
paramstype ReadonlyArray<ContextmenuParams>
errortype string | undefined
root_menutype RootMenuState
selectionstype ReadonlyArray<ItemState>
can_collapsecan_expandcan_select_nextcan_select_previouscan_activateconstructortype new (options?: ContextmenuStateOptions): ContextmenuState
optionsEMPTY_OBJECTopentype (params: ContextmenuParams[], x: number, y: number): void
paramsContextmenuParams[]xnumberynumbervoidclosetype (): void
voidreset_itemstype (items: readonly ItemState[]): void
itemsreadonly ItemState[]voidactivatetype (item: ItemState): boolean | Promise<ContextmenuActivateResult>
itemboolean | Promise<ContextmenuActivateResult>activate_selectedtype (): boolean | void | Promise<ContextmenuActivateResult>
boolean | void | Promise<ContextmenuActivateResult>selectActivates the selected entry, or if none, selects the first.
type (item: ItemState): void
itemvoidcollapse_selectedtype (): void
voidexpand_selectedtype (): void
voidselect_nexttype (): void
voidselect_previoustype (): void
voidselect_firsttype (): void
voidselect_lasttype (): void
voidadd_entryUsed by ContextmenuEntry and custom entry components
type (run: () => ContextmenuRun, disabled?: () => boolean): EntryState
run() => ContextmenuRundisabled() => boolean() => falseadd_submenutype (): SubmenuState
contextmenu_state.svelte.ts view source
ContextmenuStateOptions layoutContextmenuSubmenu.svelte view source
icon?SnippetmenuSnippetchildrenSnippetContextmenuTextEntry.svelte view source
runcontentstringiconstringCopyToClipboard.svelte view source
textstring | 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]>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() => T{ get: () => T; set: (value?: T | undefined) => T; } T(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{}CspDirectives declaration_contextmenu.ts view source
(declaration: Declaration): ContextmenuParams[] declarationContextmenuParams[] api_search.svelte.ts view source
(library: Library): DeclarationSearchState Creates search state for the API index page (all declarations across all modules).
libraryDeclarationSearchState module_contextmenu.ts view source
(module: Module): ContextmenuParams[] moduleContextmenuParams[] api_search.svelte.ts view source
(declarations: Declaration[]): DeclarationSearchState Creates search state for module-specific declaration lists.
declarationsDeclaration[]DeclarationSearchState CreateCspDirectivesOptions directivesOverride 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_sourcesSources to include based on their trust levels.
Array<CspSourceSpec>value_defaultsOverride 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_baseBase 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_defaultsOverride 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_baseBase 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> | nullRecord<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
Map<keyof CspDirectives, CspDirectiveSpec> 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.
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.
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.
readonly ["low", "medium", "high"] csp_of_ryanatkn.ts view source
CspSourceSpec[] Trusted sources owned by ryanatkn.
CspActionSource CspBaseSource `nonce-${string}` | `sha256-${string}` | `sha384-${string}` | `sha512-${string}` keyof CspDirectives CspDirectives sandboxArray<
| '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 namefallbackArray<CspDirective> | nullfallback_ofArray<CspDirective> | nullCspDirectiveValue<T> TCspFrameSource CspHostNameScheme CspHostProtocolSchemes `${string}.${string}` | "localhost" | `${string}.${string}:${number}` | `${string}.${string}:*` | `localhost:${number}` | "localhost:*" | `${string}://${string}.${string}` | `${string}://${string}.${string}:${number}` | `${string}://${string}.${string}:*` | `${string}://localhost` | `${string}://localhost:${number}`... CspPortScheme CspSchemeSource CspSource CspSources CspSourceSpec sourcetrustdirectivesArray<CspDirective>"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.svelte.ts view source
Rich runtime representation of an exported declaration.
moduletype Module
declaration_jsontype DeclarationJson
librarymodule_pathModule path where this declaration is defined.
namekindurl_githubGitHub source URL with line number.
url_apiAPI documentation URL.
import_statementGenerated TypeScript import statement.
url_api_fullPublic documentation link (if homepage_url is available).
display_nameDisplay name with generic parameters.
type_signaturedoc_commentdeprecated_messageparameterspropsreturn_typereturn_descriptiongeneric_paramsextendsimplementsthrowssinceexamplessee_alsomemberstype Array<DeclarationJson> | undefined
propertiestype Array<DeclarationJson> | undefined
has_examplesis_deprecatedhas_documentationhas_parametershas_propshas_genericsconstructortype new (module: Module, declaration_json: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }): Declaration
moduledeclaration_json{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }library_analysis.ts view source
DeclarationAnalysis Result of analyzing a single declaration. Used by both TypeScript and Svelte analyzers for uniform handling.
declarationThe analyzed declaration metadata.
DeclarationJsonnodocsWhether the declaration is marked
booleanDeclarationDetail.svelte view source
declarationDeclarationLink.svelte view source
namestringhash?URL fragment to append, with or without the #.
stringapi_search.svelte.ts view source
DeclarationSearchState querystringallArray<Declaration>filteredArray<Declaration>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.
booleansummarystring | Snippetsummary_attrs?SvelteHTMLElements['summary']childrenSnippetanalysis_context.ts view source
Diagnostic Union of all diagnostic types.
analysis_context.ts view source
DiagnosticKind Discriminant for diagnostic types.
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
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?() => voidchildrenSnippet<[close: (e?: Event) => void]>DialogLayout[] DialogLayout 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.
TComponent<any>Component<any>ComponentTpropsComponentProps<T>dialog_propsPartial<ComponentProps<typeof Dialog>> | undefineddialogsArray<DialogParams>onclose?() => voidchildren?Snippet<[dialog: DialogParams]>dimensions.svelte.ts view source
widthtype number
heighttype number
intersect.svelte.ts view source
DisconnectState intersectingbooleanintersectionsnumberelHTMLElement | SVGElementobserverIntersectionObservertomesArray<Tome>librarybreadcrumb_children?Snippet<[is_primary_nav: boolean]>childrenSnippetdocs_helpers.svelte.ts view source
string docs_helpers.svelte.ts view source
{ get: (error_message?: string | undefined) => DocsLinks; get_maybe: () => DocsLinks | undefined; set: (value: DocsLinks) => DocsLinks; } 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" | ... 97 more ... | `/${string}/help/` docs_helpers.svelte.ts view source
"/docs" 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
stringstring A URL-safe fragment identifier
DocsContent.svelte view source
tomesArray<Tome>libraryrepo_name?Snippet<[repo_name: string]>content?Snippetheader?Snippetlibraryroot_url?Url | nulllogo?Snippetlogo_header?Snippetlogo_footer?Snippetreferencestringhash?URL fragment to append, with or without the #.
stringdisplay_text?string | nullchildren?Snippet<[Declaration | undefined, Module | undefined]>docs_helpers.svelte.ts view source
DocsLinkInfo idstringtextstringfragmentstringtagDocsLinkTag | undefineddepthnumberordernumberparent_idstring | undefineddocs_helpers.svelte.ts view source
root_pathtype string
linkstype SvelteMap<string, DocsLinkInfo>
docs_linksfragments_onscreentype SvelteSet<string>
constructortype new (root_path?: string): DocsLinks
root_pathstringDOCS_PATH_DEFAULTaddtype (fragment: string, text: string, pathname: string, tag?: DocsLinkTag | undefined, depth?: number, parent_id?: string | undefined, explicit_id?: string | undefined): string
fragmentstringtextstringpathnamestringtag?DocsLinkTag | undefineddepthnumber1parent_id?string | undefinedexplicit_id?string | undefinedstringremovetype (id: string): void
idstringvoidgenerate_section_idGenerate a unique section ID for the current page render. This counter is instance-scoped, ensuring SSR/client consistency.
type (): string
stringdocs_helpers.svelte.ts view source
DocsLinkTag expand_width?booleanmargin?booleanchildrenSnippettomesArray<Tome>children?Snippet<[category: string]>expand_width?booleanDocsMenuHeader.svelte view source
childrenSnippetDocsModulesList.svelte view source
expand_width?booleanDocsPageLinks.svelte view source
sidebar?booleanexpand_width?booleanDocsPrimaryNav.svelte view source
librarybreadcrumb_children?Snippet<[is_primary_nav: boolean]>children?Snippetplaceholder?stringtotal_countnumberresult_count?numbersearch_querystringDocsSecondaryNav.svelte view source
tomesArray<Tome>sidebar?booleanDocsTertiaryNav.svelte view source
tomesArray<Tome>tomes_by_nameMap<string, Tome>sidebar?booleanlibrary_pipeline.ts view source
DuplicateInfo A duplicate declaration with its full metadata and module path.
declarationThe full declaration metadata.
DeclarationJsonmoduleModule path where this declaration is defined.
stringEcosystemLinks.svelte view source
selected?'fuz.dev'EcosystemLinksPanel.svelte view source
children?Snippetrune_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) => voidinitialnumber0void contextmenu_state.svelte.ts view source
is_menumenutype SubmenuState | RootMenuState
runtype () => ContextmenuRun
disabledtype () => boolean
selectedtype boolean
pendingtype boolean
error_messagetype string | null
promisetype Promise<ContextmenuActivateResult> | null
constructortype new (menu: SubmenuState | RootMenuState, run: () => ContextmenuRun, disabled?: () => boolean): EntryState
menuSubmenuState | RootMenuStaterun() => ContextmenuRundisabled() => boolean() => falseanalysis_context.ts view source
(diagnostic: Diagnostic, options?: FormatDiagnosticOptions | undefined): string Format a diagnostic for display.
diagnosticThe diagnostic to format
options?Formatting options
FormatDiagnosticOptions | undefinedstring Formatted string like './file.ts:10:5: error: message'
analysis_context.ts view source
FormatDiagnosticOptions Options for formatting diagnostics.
prefixPrefix for file path (default: './').
stringstrip_baseBase path to strip from absolute file paths (e.g., process.cwd()).
string(name: string): { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; } namestring{ name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; } 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 #.
stringglyphstringsize?string | undefinedfragmentstringvalue?Huechildren?Snippetsrcstringlabel?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.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_paramsFunction that returns callback, params object, or nullish to disable
() => IntersectParamsOrCallback | null | undefinedAttachment<HTMLElement | SVGElement> intersect.svelte.ts view source
IntersectParams onintersectCalled when the element enters or leaves the viewport until disconnected.
ondisconnectCalled when the attachment's observer is disconnected, either by the user calling disconnect or the attachment being destroyed.
countA 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.
numberoptionsSame as the options param to
IntersectionObserver
IntersectionObserverInitintersect.svelte.ts view source
IntersectParamsOrCallback intersect.svelte.ts view source
IntersectState intersectingbooleanintersectionsnumberelHTMLElement | SVGElementobserverIntersectionObserverdisconnect() => void(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 | undefinedboolean contextmenu_state.svelte.ts view source
ItemState Rich runtime representation of a library.
Wraps LibraryJson with computed properties and provides the root
of the API documentation hierarchy: Library → modules → declarations
module.svelte.ts for Module class
declaration.svelte.ts for Declaration class
library_jsontype LibraryJson
package_jsonsource_jsonnamerepo_namerepo_urlowner_namehomepage_urllogo_urllogo_altnpm_urlchangelog_urlpublishedorg_urlOrganization URL (e.g., 'https://github.com/ryanatkn').
modulesAll modules as rich Module instances.
modules_sortedAll modules sorted alphabetically by path.
declarationsAll declarations across all modules as a flat array.
declaration_mapDeclaration lookup map by name. Provides O(1) lookup.
constructortype new (library_json: LibraryJson): Library
library_jsonLibraryJsonlookup_declarationLook up a declaration by name.
type (name: string): Declaration | undefined
namestringDeclaration | undefinedhas_declarationCheck if a declaration exists.
type (name: string): boolean
namestringbooleanlookup_moduleLook up a module by its canonical path.
type (path: string): Module | undefined
pathstringModule | undefinedsearch_declarationsSearch declarations by query string with multi-term AND logic.
type (query: string): Declaration[]
querystringDeclaration[]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_fileThe source file info with content and optional dependency data
programTypeScript program (used for type checking and source file lookup)
ProgramoptionsModule source options for path extraction
ctxAnalysis context for collecting diagnostics
log?Optional logger for warnings
Logger | undefinedModuleAnalysis | undefined Module metadata and re-exports, or undefined if source file not found in program
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.
filesIterable of source file info (from Gro filer, file system, or other source)
Iterable<SourceFileInfo>optionsModule source options for filtering
log?Optional logger for status messages
Logger | undefinedSourceFileInfo[] (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.
disknodesIterator of Gro disknodes from filer
Iterable<Disknode>optionsModule source options for filtering
log?Optional logger for status messages
{ info: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; } | undefinedSourceFileInfo[] { get: (error_message?: string | undefined) => Library; get_maybe: () => Library | undefined; set: (value: Library) => Library; } 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"; ... 19 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"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...Map<string, DuplicateInfo[]> (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 | undefinedGen 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.
inputLibraryGenerateResult (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"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...LibraryOutputResult 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"; ... 19 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_jsonThe 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"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefine...collected_re_exportsArray of re-exports collected during phase 1
CollectedReExport[]void 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; ... 18 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; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...{ [x: string]: unknown; path: string; declarations?: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un... 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.
duplicatesMap<string, DuplicateInfo[]>log{ error: (...args: unknown[]) => void; }void Error - if any duplicate declaration names are foundLibraryDetail.svelte view source
libraryrepo_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]>library_generate.ts view source
LibraryGenerateInput Input for library metadata generation.
source_filesSource files to analyze (must have content loaded).
Array<SourceFileInfo>package_jsonPackage metadata (name, version).
PackageJsonsource_optionsModule source options for path extraction.
programOptional TypeScript program. If not provided, one will be created. Pass an existing program to reuse across multiple calls.
ts.Programon_duplicatesOptional callback for handling duplicate declaration names.
logOptional logger for status and diagnostic messages.
Loggerlibrary_generate.ts view source
LibraryGenerateResult Result of library metadata generation.
source_jsonThe generated source metadata.
SourceJsonjson_contentJSON file content string.
stringts_contentTypeScript wrapper file content string.
stringLibraryGenOptions Options for Gro library generation.
sourceModule 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_duplicatesCallback 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 Result of generating library output files. Contains both the JSON data and the TypeScript wrapper file.
json_contentJSON content for library.json
stringts_contentTypeScript wrapper content for library.ts
stringLibrarySummary.svelte view source
libraryrepo_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?Snippet(fallback?: ColorScheme, key?: string): ColorScheme fallbackColorScheme'auto'keystringCOLOR_SCHEME_STORAGE_KEYColorScheme <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
keyThe localStorage key
stringis_jsonWhether to parse the value as JSON
booleanfalseparse_fn?Optional custom parsing function to transform the value
((value: unknown) => T | null) | undefinedT | null The parsed value or null if not found or parsing fails
(fallback?: Theme, key?: string): Theme fallbackThemedefault_themes[0]!keystringTHEME_STORAGE_KEYTheme SvgData SvgData SvgData SvgData SvgData SvgData SvgData SvgData SvgData SvgData SvgData SvgData "calc(60px + var(--space_lg))" pathstringhash?URL fragment to append, with or without the #.
stringcontentstringinline?booleannowrap?boolean{ 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.
{ 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.
(s: string): boolean sstringboolean (text: string): MdzNode[] Parses text to an array of MdzNode.
textstringMdzNode[] MdzBaseNode typestringstartnumberendnumberMdzBoldNode type'Bold'childrenArray<MdzNode>MdzCodeblockNode type'Codeblock'langstring | nullcontentstringMdzCodeNode type'Code'contentstringMdzComponentNode type'Component'namestringchildrenArray<MdzNode>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 type'Element'namestringchildrenArray<MdzNode>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 type'Heading'level1 | 2 | 3 | 4 | 5 | 6childrenArray<MdzNode>MdzHrNode type'Hr'MdzItalicNode type'Italic'childrenArray<MdzNode>MdzLinkNode type'Link'referencestringchildrenArray<MdzNode>link_type'external' | 'internal'MdzNode MdzNodeView.svelte view source
nodeMdzParagraphNode type'Paragraph'childrenArray<MdzNode>Parser for mdz format. Single-pass lexer/parser with text accumulation for efficiency. Used by mdz_parse, which should be preferred for simple usage.
constructortype new (template: string): MdzParser
templatestringparseMain parse method. Returns flat array of nodes, with paragraph nodes wrapping content between double newlines.
type (): MdzNode[]
MdzNode[]MdzStrikethroughNode type'Strikethrough'childrenArray<MdzNode>MdzTextNode type'Text'contentstringRich runtime representation of a module with computed properties.
librarytype Library
module_jsontype ModuleJson
pathCanonical module path (e.g., 'Alert.ts', 'helpers/foo.ts').
path_importImport-style path with ./ prefix.
module_commentdeclarationsArray of Declaration instances. Filters out default exports.
url_apiAPI documentation URL for this module.
url_githubGitHub source URL.
has_declarationstype boolean
has_module_commenttype boolean
dependenciesModules this imports (paths relative to src/lib).
dependentsModules that import this (paths relative to src/lib).
constructortype 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"; ... 19 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | undefined; dependencies?: string[] | undefined; dependents?: string[] | undefined; star_exports?: string[] | undefined; }): Module
librarymodule_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; ... 18 more ...; alias_of?: { ...; } | undefined; }[] | undefined; module_comment?: string | un...get_declaration_by_nameLook up a declaration by name within this module.
type (name: string): Declaration | undefined
namestringDeclaration | undefined(project_root: string, overrides?: Partial<ModuleSourcePartial> | undefined): ModuleSourceOptions Create complete source options from project root and optional overrides.
project_rootAbsolute path to project root (typically process.cwd())
stringoverrides?Optional overrides for default options
Partial<ModuleSourcePartial> | undefinedModuleSourceOptions (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_fileThe source file info to extract dependencies from
optionsModule source options for filtering and path extraction
{ dependencies: string[]; dependents: string[]; } (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_idAbsolute path to the source file
stringoptionsModule source options for path extraction
string (path: string): AnalyzerType | null Default analyzer resolver based on file extension.
- .svelte → 'svelte'
- .ts, .js → 'typescript'
- Other extensions → null (skip)
pathstringAnalyzerType | null (module_path: string): string Extract component name from a Svelte module path.
module_pathstringstring (module_path: string): string Convert module path to module key format (with ./ prefix).
module_pathstringstring (options: ModuleSourceOptions): string Get the effective source_root from options.
Returns source_root if provided, otherwise returns source_paths[0] for single-path configs.
optionsstring Error - if source_root is required but not provided (multiple source_paths)(path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (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.
pathFull absolute path to check
stringoptionsModule source options for filtering
boolean True if the path is an analyzable source file
(path: string): boolean pathstringboolean (path: string): boolean pathstringboolean (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.
pathstringboolean 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.
(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
optionsvoid Error - if validation failslibrary_analysis.ts view source
ModuleAnalysis Result of analyzing a module (TypeScript or Svelte). Both analyzers return this same structure for uniform handling.
pathModule path relative to source root.
stringmodule_commentModule-level documentation comment.
stringdeclarationsAll declarations with nodocs flags - consumer filters based on policy.
Array<DeclarationAnalysis>dependenciesDependencies (other source modules this module imports). Empty if none.
Array<string>dependentsDependents (other source modules that import this module). Empty if none.
Array<string>star_exportsStar exports (export * from './module'). Empty for Svelte components.
Array<string>re_exportsRe-exports discovered during analysis. Empty for Svelte components.
Array<ReExportInfo>ModuleExportsAnalysis Result of analyzing a module's exports.
module_commentModule-level documentation comment.
stringdeclarationsAll exported declarations with nodocs flags - consumer filters based on policy.
Array<DeclarationAnalysis>re_exportsSame-name re-exports (for building also_exported_from in post-processing).
Array<ReExportInfo>star_exportsStar exports (export * from './module') - module paths that are fully re-exported.
Array<string>module_pathstringhash?URL fragment to append, with or without the #.
stringanalysis_context.ts view source
ModuleSkippedDiagnostic Module was skipped during analysis. Could be due to missing source file in program or no analyzer available.
kind'module_skipped'reasonReason the module was skipped.
'not_in_program' | 'no_analyzer'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.
project_rootAbsolute 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_pathsSource 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_rootSource 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_patternsPatterns to exclude (matched against full path).
Array<RegExp>get_analyzerDetermine 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 Partial source options without project_root.
Use with module_create_source_options to build complete options.
intersect.svelte.ts view source
OnDisconnect library_generate.ts view source
OnDuplicatesCallback Callback for handling duplicate declaration names.
intersect.svelte.ts view source
OnIntersect 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_jsonThe 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; }boolean True if the package appears to be published
(directive: unknown): keyof CspDirectives | null directiveunknownkeyof CspDirectives | null (trust: unknown): "low" | "medium" | "high" | null Validates and extracts a CSP trust level from an unknown value.
trustunknown"low" | "medium" | "high" | null PasteFromClipboard.svelte view source
onclipboardtext(text: string) => voidonerror?(error: Error) => voidPendingAnimation.svelte view source
inline?booleanrunning?booleanitem_attrs?SvelteHTMLElements['span']children?Snippet<[index: number]>PendingButton.svelte view source
pendingbooleanonclick() => voidrunning?booleantitle?stringdisabled?booleananimation?SnippetchildrenSnippethost?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]>library_analysis.ts view source
ReExportInfo Information about a same-name re-export.
Used for post-processing to build also_exported_from arrays.
nameName of the re-exported declaration.
stringoriginal_moduleModule path (relative to src/lib) where the declaration is originally declared.
string(value: unknown): string valueunknownstring package_helpers.ts view source
(name: string): string Extract repository name without scope from package name.
namePackage name (can be scoped like '@org/package')
stringstring Repository name without scope
Error - if scoped package name is malformedpackage_helpers.ts view source
(repo_url: string): string | null Extract GitHub owner/org name from repository URL.
repo_urlRepository URL (e.g., 'https://github.com/owner/repo')
stringstring | null Owner name, or null if not a valid GitHub URL
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', '/').
repositoryThe repository field from package.json
string | { [x: string]: unknown; type: string; url: string; directory?: string | undefined; } | undefinedstring | null Clean repository URL, or null if not provided
contextmenu_state.svelte.ts view source
is_menumenudepthitemstype ReadonlyArray<ItemState>
(color_scheme: ColorScheme | null, key?: string): void color_schemeColorScheme | nullkeystringCOLOR_SCHEME_STORAGE_KEYvoid (theme: Theme | null, key?: string): void themeTheme | nullkeystringTHEME_STORAGE_KEYvoid (key: string, value: any, is_json?: boolean): void Utility function to save a value to localStorage.
keystringvalueanyis_jsonbooleanfalsevoid analysis_context.ts view source
SignatureAnalysisDiagnostic Function/method signature analysis failed.
kind'signature_analysis_failed'function_nameName of the function or method.
string(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.
disknodeDisknodeSourceFileInfo Error - if disknode has no content (should be loaded by Gro filer)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.
idAbsolute path to the file.
stringcontentFile content (required - analysis functions don't read from disk).
stringdependenciesAbsolute 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>dependentsAbsolute file paths of modules that import this file (optional). Only include resolved local imports, not node_modules.
ReadonlyArray<string>spiders?Array<string>seed?unknownrandom?typeof Math.randomcontextmenu_state.svelte.ts view source
is_menumenutype SubmenuState | RootMenuState
depthtype number
selectedtype boolean
itemstype ReadonlyArray<ItemState>
constructortype new (menu: SubmenuState | RootMenuState, depth: number): SubmenuState
menuSubmenuState | RootMenuStatedepthnumber(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_codestringsource_fileSourceFilecheckerTypeCheckercomponent_namestringfile_pathstringsource_mapTraceMap | nullctx{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; } (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_fileSource file info with path and content
module_pathModule path relative to source root (e.g., 'Alert.svelte')
stringcheckerTypeScript type checker for type resolution
TypeCheckerctxAnalysis context for collecting diagnostics
SvelteFileAnalysis Component declaration and optional module-level comment
(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_fileThe source file info (from Gro filer, file system, or other source)
module_pathThe module path (relative to source root)
stringcheckerTypeScript type checker
TypeCheckeroptionsModule source options for path extraction
ctxAnalysis context for collecting diagnostics
ModuleAnalysis Module analysis matching ModuleAnalysis structure
(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.
stringstring | undefined The cleaned module comment text, or undefined if none found.
(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_sourcestringstring | undefined SvelteFileAnalysis Result of analyzing a Svelte file.
declarationThe component declaration metadata.
DeclarationJsonmodule_commentModule-level documentation comment, if present.
stringanalysis_context.ts view source
SveltePropDiagnostic Svelte prop type resolution failed.
kind'svelte_prop_failed'component_nameName of the component.
stringprop_nameName of the prop.
stringdataSvgDatafill?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?boolean(color_scheme: ColorScheme | null): void color_schemeColorScheme | nullvoid 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) => voidchildrenSnippet"fuz:theme" 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.
childrenSnippet<[themer: Themer, style: string | null, theme_style_html: string | null]>selected_theme?{theme: Theme}themes?Array<Theme>enable_editing?booleanselect?((theme: Theme) => void | boolean) | nullonselect?(theme: Theme) => voidonedit?(theme: Theme) => voidthemetype Theme
color_schemetype ColorScheme
constructortype new (options?: Partial<ThemerJson> | undefined): Themer
options?Partial<ThemerJson> | undefinedtoJSONtype (): ThemerJson
{ get: (error_message?: string | undefined) => Themer; get_maybe: () => Themer | undefined; set: (value: Themer) => Themer; } ThemerJson themeThemecolor_schemeColorSchemePartial<ThemerJson> <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.
ComponentTpropsComponentProps<T>dialog_props?Partial<Record<string, any>> | undefinedDialogParams<T> 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_slugstringpathnamestringroot_pathstringDOCS_PATH_DEFAULT{ path: string; path_is_selected: boolean; path_segment: string | undefined; } (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 itemstring | { name: string; category: string; Component: Component<any, any, string>; related_tomes: string[]; related_modules: string[]; related_declarations: string[]; }docs_pathstringDOCS_PATH_DEFAULThash?- URL fragment to append, with or without the #.
string | undefinedstring 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> { 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.svelte view source
tomedocs_path?stringheader?SnippetchildrenSnippetnamestringdocs_path?stringhash?URL fragment to append, with or without the #.
string{ 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.svelte view source
childrenSnippetTomeSectionHeader.svelte view source
textstringtag?children?Snippet(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.
symbolThe TypeScript symbol to analyze
Symbolsource_fileThe source file containing the symbol
SourceFilecheckerThe TypeScript type checker
TypeCheckerctxOptional analysis context for collecting diagnostics
DeclarationAnalysis Complete declaration metadata including docs, types, and parameters, plus nodocs flag
(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_infoThe source file info (from Gro filer, file system, or other source)
ts_source_fileTypeScript source file from the program
SourceFilemodule_pathThe module path (relative to source root)
stringcheckerTypeScript type checker
TypeCheckeroptionsModule source options for path extraction
ctxAnalysis context for collecting diagnostics
ModuleAnalysis Module metadata and re-export information
(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_fileThe TypeScript source file to analyze
SourceFilecheckerThe TypeScript type checker
TypeCheckeroptionsModule source options for path extraction in re-exports
ctxAnalysis context for collecting diagnostics
ModuleExportsAnalysis Module comment, declarations, re-exports, and star exports
(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 | undefinedTsProgram The program and type checker
Error - if tsconfig.json is not found(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract class information with rich member metadata.
nodeNode_symbolSymbolcheckerTypeCheckerdeclaration{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }ctxvoid (node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }, tsdoc: TsdocParsedComment | undefined, ctx: AnalysisContext): void Extract function/method information including parameters with descriptions and default values.
nodeNodesymbolSymbolcheckerTypeCheckerdeclaration{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }tsdocTsdocParsedComment | undefinedctxvoid (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_fileSourceFilestring | undefined (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.
sigThe TypeScript signature to extract parameters from
SignaturecheckerTypeScript type checker for type resolution
TypeCheckertsdoc_paramsMap of parameter names to TSDoc descriptions (from tsdoc.params)
Map<string, string> | undefined{ name: string; type: string; optional?: boolean | undefined; description?: string | undefined; default_value?: string | undefined; }[] Array of parameter info objects
(node: Node, _symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract type/interface information with rich property metadata.
nodeNode_symbolSymbolcheckerTypeCheckerdeclaration{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }ctxvoid (node: Node, symbol: Symbol, checker: TypeChecker, declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; ... 19 more ...; alias_of?: { ...; } | undefined; }, ctx: AnalysisContext): void Extract variable information.
nodeNodesymbolSymbolcheckerTypeCheckerdeclaration{ [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }ctxvoid (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')
symbolSymbolnodeNode"function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css" (declaration: { [x: string]: unknown; name: string; kind: "function" | "json" | "type" | "variable" | "class" | "constructor" | "component" | "css"; doc_comment?: string | undefined; type_signature?: string | undefined; ... 17 more ...; alias_of?: { ...; } | undefined; }, tsdoc: TsdocParsedComment | undefined): void Apply parsed TSDoc metadata to a declaration.
Consolidates the common pattern of assigning TSDoc fields to declarations, with conditional assignment for array fields (only if non-empty).
declarationdeclaration 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; ... 17 more ...; alias_of?: { ...; } | undefined; }tsdocparsed TSDoc comment (if available)
TsdocParsedComment | undefinedvoid (comment_text: string): string | undefined Clean raw JSDoc comment text by removing comment markers and leading asterisks.
Transforms /** ... *\/ style comments into clean text.
comment_textThe raw comment text including /** and *\/ markers
stringstring | undefined Cleaned comment text, or undefined if empty after cleaning
(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)
nodeThe TypeScript node to extract JSDoc from
Nodesource_fileSource file (used for extracting full @see tag text)
SourceFileTsdocParsedComment | undefined (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
contentRaw @see tag content in TSDoc format
stringstring mdz-formatted string ready for <Mdz> component
TsdocParsedComment Parsed JSDoc/TSDoc comment with structured metadata.
textComment text (excluding comment markers)
stringparamsParameter descriptions mapped by parameter name
Map<string, string>returnsReturn value description from @returns
stringthrowsThrown errors from @throws
Array<{type?: string; description: string}>examplesCode examples from @example
Array<string>deprecated_messageDeprecation message from @deprecated
stringsee_alsoRelated references from @see
Array<string>sinceVersion information from @since
stringmutatesMutation documentation from @mutates (non-standard)
Array<string>nodocsWhether to exclude from documentation. From @nodocs tag.
booleanTsModifier TypeScript modifier keywords extracted from declarations.
These are the access modifiers and other keywords that can appear on class members, interface properties, etc.
TsProgram Result of creating a TypeScript program.
programts.Programcheckerts.TypeCheckerTsProgramOptions Options for creating a TypeScript program.
rootProject root directory.
stringtsconfigPath to tsconfig.json (relative to root).
stringcompiler_optionsOverride compiler options.
ts.CompilerOptionsanalysis_context.ts view source
TypeExtractionDiagnostic Type extraction failed (e.g., complex or recursive types).
kind'type_extraction_failed'symbol_nameName of the symbol whose type couldn't be extracted.
stringtypestringhash?URL fragment to append, with or without the #.
stringlibrary_helpers.ts view source
(declaration_name: string): string Build project-relative API documentation URL with hash anchor.
declaration_nameName of the declaration to link to
stringstring URL path like '/docs/api#declaration_name'
library_helpers.ts view source
(homepage: string, declaration_name: string): string Build full API documentation URL with domain and hash anchor.
homepagePackage homepage URL
stringdeclaration_nameName of the declaration to link to
stringstring Full URL like 'https://example.com/docs/api#declaration_name'
library_helpers.ts view source
(module_path: string): string Build project-relative module documentation URL.
module_pathModule path (e.g., 'helpers.ts')
stringstring URL path like '/docs/api/helpers.ts'
package_helpers.ts view source
(repo_url: string, file_path: string, line?: number | undefined): string Build GitHub file URL for a repository.
repo_urlRepository URL (e.g., 'https://github.com/owner/repo')
stringfile_pathPath to the file (leading './' is stripped)
stringline?Optional line number for deep linking
number | undefinedstring Full GitHub URL to the file on the main branch
package_helpers.ts view source
(repo_url: string, repo_name: string): string | null Build GitHub organization URL from repo URL and repo name.
repo_urlRepository URL (e.g., 'https://github.com/owner/repo')
stringrepo_nameRepository name to strip from the URL
stringstring | null Organization URL, or null if repo_url doesn't end with repo_name
package_helpers.ts view source
(package_name: string): string Build npm package URL.
package_namePackage name (can be scoped like '@org/package')
stringstring Full npm package page URL
library_helpers.ts view source
(homepage_url: string | null, logo_path?: string | undefined): string | null Build package logo URL with favicon.png fallback.
homepage_urlPackage homepage URL, or null
string | nulllogo_path?Optional custom logo path (defaults to 'favicon.png')
string | undefinedstring | null Full URL to the logo, or null if no homepage
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.
urlFull URL to convert
stringoriginOrigin to strip (defaults to current page origin)
stringpage.url.originstring Root-relative URL starting with '/'
package_helpers.ts view source
(homepage_url: string, filename: string): string Build .well-known URL for package metadata files.
homepage_urlPackage homepage URL
stringfilenameFilename in .well-known directory
stringstring Full URL to the .well-known file
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{}Plugin<any> vite_plugin_library_well_known.ts view source
VitePluginLibraryWellKnownOptions library_pathPath to the library.json file (relative to vite.config.ts).
string