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 → Module → Declaration.

see also

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

readonly

source_json

readonly

name

readonly

repo_name

readonly

repo_url

readonly

owner_name

readonly

homepage_url

readonly

logo_url

readonly

logo_alt

readonly

npm_url

readonly

changelog_url

readonly

published

readonly

org_url

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

readonly

modules

All modules as rich Module instances.

readonly

modules_sorted

All modules sorted alphabetically by path.

readonly

declarations

All declarations across all modules as a flat array.

readonly

module_by_path

Module lookup map by path. Provides O(1) lookup.

readonly

declaration_by_name

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

readonly

constructor

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

library_json
type LibraryJson
url_prefix
type string
default ''

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
type string
returns Module[] | null

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
#