API Reference / @gtkx/storybook / explorer / StoryCatalog
Class: StoryCatalog
Defined in: catalog.d.ts:45
Loads CSF modules and publishes subscribable explorer snapshots.
Constructors
Constructor
new StoryCatalog():
StoryCatalog
Returns
StoryCatalog
Properties
getSnapshot
getSnapshot: () =>
StoryCatalogSnapshot
Defined in: catalog.d.ts:53
Returns the current snapshot, retaining its identity until the next update.
Returns
subscribe
subscribe: (
listener) => () =>void
Defined in: catalog.d.ts:55
Registers a snapshot listener and returns a function that unsubscribes it.
Parameters
listener
() => void
Returns
() => void
Methods
load()
load(
sources,preview?):Promise<void>
Defined in: catalog.d.ts:62
Replaces the catalog with stories composed from the supplied sources and preview. Only the latest load publishes results; unchanged module identities reuse composed stories. Rejects with an AggregateError after publishing healthy stories when any source fails.
Parameters
sources
preview?
Returns
Promise<void>
reportError()
reportError(
cause):void
Defined in: catalog.d.ts:67
Replaces the current session failure while preserving source errors and superseding pending loads. Ignores aggregate failures already published by this catalog's load operation.
Parameters
cause
unknown
Returns
void