@curvenote/cli
Version:
CLI Client library for Curvenote
30 lines • 1.52 kB
TypeScript
import type { GenericNode } from 'myst-common';
import type { Blocks } from '@curvenote/blocks';
import { ReferenceFormatTypes } from '@curvenote/blocks';
import { Block, Version } from '../../../models.js';
import type { ISession } from '../../../session/types.js';
import { getEditorState } from './getEditorState.js';
export interface ArticleStateChild {
state: ReturnType<typeof getEditorState>;
block?: Block;
version?: Version;
templateTags?: string[];
}
export interface ArticleStateReference {
label: string;
bibtex?: string;
version?: Version<Blocks.Reference>;
state?: ReturnType<typeof getEditorState>;
}
export type ArticleState = {
children: ArticleStateChild[];
images: Record<string, Version<Blocks.Image | Blocks.Output>>;
references: Record<string, ArticleStateReference>;
tagged: Record<string, ArticleStateChild[]>;
};
export declare function outputHasHtml(version: Version<Blocks.Output>): boolean;
export declare function outputHasImage(version: Version<Blocks.Output>): boolean;
export declare function walkArticle(session: ISession, data: Blocks.Article, templateTags?: string[], referenceFormat?: ReferenceFormatTypes): Promise<ArticleState>;
export declare function loadImagesToBuffers(session: ISession, images: ArticleState['images']): Promise<Record<string, Buffer<ArrayBufferLike>>>;
export declare function loadLocalImagesToBuffers(images: GenericNode[]): Record<string, Buffer<ArrayBufferLike>>;
//# sourceMappingURL=walkArticle.d.ts.map