On this page
Overview
Loads a positive static document inventory with complete cache, search, hydration, and context content.
- Artifact
StaticDocumentCatalog.js· esm - Classification
public first party - Availability
Browser / native WebView / server with fetch - Normalization
Complete mutable catalog, hydration, search, and context content; malformed catalog/cache data and transport failures remain visible.
Import and lifecycle
import * as module from '/arcane/modules/StaticDocumentCatalog.js';
Construction normalizes and indexes the manifest without freezing caller-visible records. Search/list/get are in-memory. hydrate() uses complete memory/cache content or one fetch with UTF-8 decoding and best-effort cache write. buildContext() may hydrate every matching candidate and returns complete context.
Application-facing behavior: default catalog, schema constant, catalog normalizer/cache-key; list/get/search/hydrate/context APIs.
Protocol and host implementation
HTTP(S), optional cache This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
default | default · class | class StaticDocumentCatalog | — |
CATALOG_SCHEMA_VERSION | variable · value | variable CATALOG_SCHEMA_VERSION | — |
normalizeStaticDocumentCatalog | function | function normalizeStaticDocumentCatalog(input,options={}) | input,options={} |
staticDocumentCacheKey | function | function staticDocumentCacheKey(version,id) | version,id |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
StaticDocumentCatalog.constructor | constructor | constructor(manifest,options={}) | manifest,options={} |
StaticDocumentCatalog.version | get | get version() | — |
StaticDocumentCatalog.size | get | get size() | — |
StaticDocumentCatalog.timeouts | get | get timeouts() | — |
StaticDocumentCatalog.list | method | list() | — |
StaticDocumentCatalog.get | method | get(id) | id |
StaticDocumentCatalog.search | method | search(query,options={}) | query,options={} |
StaticDocumentCatalog.hydrate | async method | async hydrate(id,options={}) | id,options={} |
StaticDocumentCatalog.buildContext | async method | async buildContext(query,options={}) | query,options={} |
Parameter meanings and results
CATALOG_SCHEMA_VERSION is 1. new Catalog({version,documents},options); getters version/size/limits; list(), get(id), search(query,{kinds?,tags?}); hydrate(id,{bypassCache?,signal?}) resolves mutable {record,text,url,source}; buildContext(query,{bodySearch?,signal?}) resolves complete mutable {characters,documents,failures,text}; normalizeStaticDocumentCatalog(); staticDocumentCacheKey(version,id).
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- STATIC_DOCUMENT_INVALID_CATALOG
- STATIC_DOCUMENT_INVALID_OPTIONS
- STATIC_DOCUMENT_INVALID_LIMIT
- STATIC_DOCUMENT_CASE_COLLISION
- STATIC_DOCUMENT_INVALID_BASE_URL
- STATIC_DOCUMENT_INVALID_ID
- STATIC_DOCUMENT_INVALID_QUERY
- STATIC_DOCUMENT_NOT_FOUND
- STATIC_DOCUMENT_BASE_URL_REQUIRED
- STATIC_DOCUMENT_FETCH_UNAVAILABLE
- STATIC_DOCUMENT_TIMEOUT
- STATIC_DOCUMENT_ABORTED
- STATIC_DOCUMENT_HTTP_ERROR
- STATIC_DOCUMENT_INVALID_RESPONSE
- STATIC_DOCUMENT_UNSAFE_PATH
- STATIC_DOCUMENT_UNSAFE_REDIRECT
- STATIC_DOCUMENT_INVALID_TEXT
- STATIC_DOCUMENT_CACHE_INVALID (cache diagnostic)
- STATIC_DOCUMENT_ERROR (complete buildContext failure detail)
Availability and capabilities
Browser / native WebView / server with fetch. Complete mutable catalog, hydration, search, and context content; malformed catalog/cache data and transport failures remain visible.
None; fetch and cache adapters own their Web/API authority.
Contract example
import StaticDocumentCatalog from '/arcane/modules/StaticDocumentCatalog.js';
const catalog = new StaticDocumentCatalog({
version:'1',
documents:[{
id:'welcome',
path:'welcome.md',
kind:'guide',
title:'Welcome'
}]
});
console.log(catalog.search('welcome')[0]);
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.