API Reference / @gtkx/storybook / @gtkx/storybook/explorer / StoryCatalog
Class: StoryCatalog
Defined in: packages/storybook/src/catalog.ts:195
Loads CSF modules and publishes subscribable explorer snapshots.
Constructors
Constructor
new StoryCatalog():
StoryCatalog
Returns
StoryCatalog
Methods
getSnapshot()
getSnapshot():
StoryCatalogSnapshot
Defined in: packages/storybook/src/catalog.ts:204
Returns the current snapshot, retaining its identity until the next update.
Returns
load()
load(
sources,preview?):Promise<void>
Defined in: packages/storybook/src/catalog.ts:228
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?
Preview = EMPTY_PREVIEW
Returns
Promise<void>
reportError()
reportError(
cause):void
Defined in: packages/storybook/src/catalog.ts:256
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
subscribe()
subscribe(
listener): () =>void
Defined in: packages/storybook/src/catalog.ts:207
Registers a snapshot listener and returns a function that unsubscribes it.
Parameters
listener
() => void
Returns
() => void