histoire
Version:
A fast story book powered by Vite
35 lines • 1.57 kB
TypeScript
import type { HistoireDiagnostic, HistoireMeta } from '@histoire/protocol';
/** Running total of `meta` published in one catalog. */
export interface CatalogMetaBudget {
/** JSON bytes of published `meta`. */
bytes: number;
/** JSON values of published `meta`. */
nodes: number;
/** Set once one `meta` did not fit: every later `meta` is left out too. */
exhausted: boolean;
}
/** Creates an empty catalog-wide `meta` budget. */
export declare function createCatalogMetaBudget(): CatalogMetaBudget;
/**
* Projects collected story or variant `meta` to catalog JSON. Metadata over its own bounds, or
* past the catalog-wide budget, is left out and reported, so neither one oversized story nor
* many valid ones can make the whole catalog invalid.
* @param source Story or variant as collected (with `meta` and `metaOmitted`).
* @param source.meta Collected `meta`.
* @param source.metaOmitted Whether collection already dropped oversized `meta`.
* @param owner Story (and variant) the metadata belongs to, for the warning.
* @param owner.storyId Story id.
* @param owner.variantId Variant id when projecting variant metadata.
* @param budget Catalog-wide totals, updated with published `meta`.
* @param warnings Receives the omission warning.
*/
export declare function projectMeta(source: {
meta?: unknown;
metaOmitted?: boolean;
} | undefined, owner: {
storyId: string;
variantId?: string;
}, budget: CatalogMetaBudget, warnings: HistoireDiagnostic[]): {
meta?: HistoireMeta;
};
//# sourceMappingURL=meta.d.ts.map