import { IFrame } from '@jupyterlab/apputils'; import { ABCWidgetFactory, DocumentRegistry, DocumentWidget } from '@jupyterlab/docregistry'; import { INotebookModel } from '@jupyterlab/notebook'; import { ITranslator } from '@jupyterlab/translation'; import { CommandRegistry } from '@lumino/commands'; import { ISignal } from '@lumino/signaling'; import { IRisePreviewFactory } from './tokens'; /** * A DocumentWidget that shows a Rise preview in an IFrame. */ export declare class RisePreview extends DocumentWidget { /** * Instantiate a new RisePreview. * @param options The RisePreview instantiation options. */ constructor(options: RisePreview.IOptions); /** * Promise that resolves when the slideshow is ready */ get ready(): Promise; get iframe(): HTMLIFrameElement | null; /** * Dispose the preview widget. */ dispose(): void; /** * Reload the preview. */ reload(): void; /** * Whether the preview reloads when the context is saved. */ get renderOnSave(): boolean; setActiveCellIndex(index: number, reload?: boolean): Promise; protected get path(): string; protected set path(v: string); private _waitForIFrame; protected getRiseUrl: (path: string, index?: number) => string; private _ready; private _renderOnSave; private _path; } /** * A namespace for RisePreview statics. */ export declare namespace RisePreview { const FACTORY_NAME = "rise"; /** * Instantiation options for `RisePreview`. */ interface IOptions extends DocumentWidget.IOptionsOptionalContent { /** * Application commands registry */ commands: CommandRegistry; /** * The Rise URL function. */ getRiseUrl: (path: string, index?: number) => string; /** * Whether to reload the preview on context saved. */ renderOnSave?: boolean; } /** * Generate the URL required to open a file as RISE slideshow. * * @param path File path * @param activeCellIndex Active cell index * @returns URL to open */ function getRiseUrl(path: string, activeCellIndex?: number): string; /** * RISE Preview document factory token implementation. */ class FactoryToken implements IRisePreviewFactory { constructor({ commands, docRegistry, fileTypes, translator }: { commands: CommandRegistry; docRegistry: DocumentRegistry; fileTypes?: string[]; translator?: ITranslator; }); /** * Add a new file type to the RISE preview factory. * * #### Notes * Useful to add file types for jupytext. * * @param ft File type */ addFileType(ft: string): void; /** * Signal emitted when a RISE preview is created. */ get widgetCreated(): ISignal; private _updateFactory; private _commands; private _disposeFactory; private _docRegistry; private _fileTypes; private _translator; private _widgetCreated; } } /** * RISE Preview widget factory */ export declare class RisePreviewFactory extends ABCWidgetFactory { private getRiseUrl; private commands; defaultRenderOnSave: boolean; constructor(getRiseUrl: (path: string) => string, commands: CommandRegistry, options: DocumentRegistry.IWidgetFactoryOptions); protected createNewWidget(context: DocumentRegistry.IContext): RisePreview; }