import { ChildrenLike, VirtualDOM } from '@youwol/rx-vdom';
import type { MdParsingOptions, ViewGenerator } from '../markdown';
import { Router } from '../router';
import { Scope, State } from './state';
import { DisplayFactory } from './display-utils';
/**
* The common set for attributes of a notebook cell.
*
* When provided from a DOM element in the markdown source, they are defined using kebab case:
* ```
*
* ```
*/
export type CellCommonAttributes = {
/**
* Whether to display line numbers on cell.
*/
lineNumbers?: boolean;
/**
* Whether the cell is readonly.
*/
readOnly?: boolean;
};
/**
* Default values for {@link CellCommonAttributes}.
*/
export declare const defaultCellAttributes: CellCommonAttributes;
/**
* Global options for a {@link NotebookPage}.
*/
export type NotebookOptions = {
/**
* Whether to run all the cells of a notebook page when loaded.
*/
runAtStart?: boolean;
/**
* The default values for cell's attribute.
*/
defaultCellAttributes?: CellCommonAttributes;
/**
* Options for markdown parsing.
*/
markdown?: MdParsingOptions;
};
export declare const notebookViews: ({ state }: {
state: State;
}) => {
'cell-output': (elem: HTMLElement) => import("./cell-views").OutputsView;
'js-cell': (elem: HTMLElement) => import("./js-cell-view").JsCellView;
'md-cell': (elem: HTMLElement, parserOptions: MdParsingOptions) => import("./md-cell-view").MdCellView;
'py-cell': (elem: HTMLElement) => import("./py-cell-view").PyCellView;
'interpreter-cell': (elem: HTMLElement) => import("./interpreter-cell-view").InterpreterCellView;
'worker-cell': (elem: HTMLElement) => import("./worker-cell-view").WorkerCellView;
};
/**
* Represents a page of a notebook.
*
* A notebook page is a markdown content including definition of executable cells
* (*e.g.* {@link JsCellView}, {@link MdCellView}) as well as other related components.
*
* Cells run in the order of inclusion, and share their top level scope.
*/
export declare class NotebookPage implements VirtualDOM<'div'> {
readonly tag = "div";
/**
* Classes associated to the view.
*/
readonly class = "mknb-NotebookPage";
readonly url: string;
readonly views: {
[k: string]: ViewGenerator;
};
readonly router: Router;
readonly children: ChildrenLike;
/**
* State manager.
*/
readonly state: State;
readonly options: NotebookOptions;
/**
* Constructs the page.
*
* @param params The parameters
* @param params.url Url pointing to the markdown content, only used if the `src` attribute is not provided.
* @param params.src Markdown source content. To fetch from a URL leave it empty & provide instead
* the `url` attribute.
* @param params.router Application's router.
* @param params.initialScope Initial scope provided to the first executing cell.
* @param params.displayFactory Additional custom {@link DisplayFactory} invoked when `display` is used.
* @param params.options Global options for the page, in particular defined the default attribute for the various
* cells.
*/
constructor(params: {
url?: string;
src?: string;
router: Router;
initialScope?: Partial;
displayFactory?: DisplayFactory;
options?: NotebookOptions;
});
}