Fix cell attachment types (#14485)

This commit is contained in:
Chris LaFreniere
2021-03-01 15:06:12 -08:00
committed by GitHub
parent ff508b1bf4
commit 9273572d5a
5 changed files with 9 additions and 7 deletions

View File

@@ -34,9 +34,9 @@ export abstract class CellView extends AngularDisposable implements OnDestroy, I
}
export interface IMarkdownStringWithCellAttachments extends IMarkdownString {
readonly cellAttachments?: nb.ICellAttachment
readonly cellAttachments?: nb.ICellAttachments
}
export interface MarkdownRenderOptionsWithCellAttachments extends MarkdownRenderOptions {
readonly cellAttachments?: nb.ICellAttachment
readonly cellAttachments?: nb.ICellAttachments
}

View File

@@ -264,7 +264,7 @@ export class NotebookMarkdownRenderer {
* In a cell, the above attachment would be referenced in markdown like this:
* ![altText](attachment:test.png)
*/
function findAttachmentIfExists(href: string, cellAttachments: nb.ICellAttachment): string {
function findAttachmentIfExists(href: string, cellAttachments: nb.ICellAttachments): string {
if (href.startsWith('attachment:') && cellAttachments) {
const imageName = href.replace('attachment:', '');
const imageDefinition = cellAttachments[imageName];

View File

@@ -80,7 +80,7 @@ export class CellModel extends Disposable implements ICellModel {
private _isParameter: boolean;
private _onParameterStateChanged = new Emitter<boolean>();
private _isInjectedParameter: boolean;
private _attachments: nb.ICellAttachment;
private _attachments: nb.ICellAttachments;
constructor(cellData: nb.ICellContents,
private _options: ICellModelOptions,

View File

@@ -530,7 +530,7 @@ export interface ICellModel {
sendChangeToNotebook(change: NotebookChangeType): void;
cellSourceChanged: boolean;
readonly savedConnectionName: string | undefined;
readonly attachments: nb.ICellAttachment;
readonly attachments: nb.ICellAttachments;
readonly currentMode: CellEditModes;
}