myst-cli
Version:
Command line tools for MyST
63 lines • 2.41 kB
TypeScript
import type { CitationRenderer } from 'citation-js-utils';
import type { Logger } from 'myst-cli-utils';
import type { MystPlugin, RuleId, ValidatedMystPlugin } from 'myst-common';
import type { ResolvedExternalReference } from 'myst-transforms';
import type { MinifiedContentCache } from 'nbtx';
import type { Store } from 'redux';
import type { RequestInfo, RequestInit, Response } from 'node-fetch';
import type { Limit } from 'p-limit';
import type { BuildWarning, RootState } from '../store/index.js';
import type { PreRendererData, RendererData, SingleCitationRenderer } from '../transforms/types.js';
import type { SessionManager } from '@jupyterlab/services';
import type MystTemplate from 'myst-templates';
import type { PluginInfo } from 'myst-config';
import type { Semaphore } from 'async-mutex';
export type ISession = {
API_URL: string;
configFiles: string[];
store: Store<RootState>;
log: Logger;
doiLimiter: Limit;
executionSemaphore: Semaphore;
reload(): Promise<ISession>;
clone(): Promise<ISession>;
sourcePath(): string;
buildPath(): string;
sitePath(): string;
contentPath(): string;
publicPath(): string;
showUpgradeNotice(): void;
plugins: ValidatedMystPlugin | undefined;
loadPlugins(plugins: PluginInfo[]): Promise<MystPlugin>;
getAllWarnings(ruleId: RuleId): (BuildWarning & {
file: string;
})[];
jupyterSessionManager(): Promise<SessionManager | undefined>;
dispose(): void;
fetch(url: URL | RequestInfo, init?: RequestInit): Promise<Response>;
};
export type ISessionWithCache = ISession & {
$citationRenderers: Record<string, CitationRenderer>;
$doiRenderers: Record<string, SingleCitationRenderer>;
$externalReferences: Record<string, ResolvedExternalReference>;
$mdast: Record<string, {
sha256?: string;
pre: PreRendererData;
post?: RendererData;
}>;
$siteTemplate: MystTemplate;
$outputs: MinifiedContentCache;
/** Method to get $mdast value with normalized path */
$getMdast(file: string): {
sha256?: string;
pre: PreRendererData;
post?: RendererData;
} | undefined;
/** Method to set $mdast value with normalized path */
$setMdast(file: string, data: {
sha256?: string;
pre: PreRendererData;
post?: RendererData;
}): void;
};
//# sourceMappingURL=types.d.ts.map