library.svelte.ts

Declarations
#

3 declarations

view source

Library
#

library.svelte.ts view source

Rich runtime representation of a library.

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

see also

  • module.svelte.ts for Module class

  • declaration.svelte.ts for Declaration class

library_json

type LibraryJson

readonly

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

readonly

package_json

source_json

name

repo_name

repo_url

owner_name

homepage_url

logo_url

logo_alt

npm_url

changelog_url

published

org_url

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

modules

All modules as rich Module instances.

modules_sorted

All modules sorted alphabetically by path.

declarations

All declarations across all modules as a flat array.

declaration_map

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

constructor

type new (library_json: LibraryJson, url_prefix?: string): Library

library_json
type LibraryJson
url_prefix
type string
default ''

lookup_declaration

Look up a declaration by name.

type (name: string): Declaration | undefined

name
type string
returns Declaration | undefined

has_declaration

Check if a declaration exists.

type (name: string): boolean

name
type string
returns boolean

lookup_module

Look up a module by its canonical path.

type (path: string): Module | undefined

path
type string
returns Module | undefined

search_declarations

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

type (query: string): Declaration[]

query
type string
returns Declaration[]

library_context
#

library.svelte.ts view source

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

parse_library_url_prefix
#

library.svelte.ts view source

(value: unknown): string

Normalizes a URL prefix: ensures leading /, strips trailing /, returns '' for falsy and non-string values.

value

type unknown

returns

string

Depends on
#

Imported by
#