mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-27 04:41:48 +00:00
* Add more files to strict compile. Update CONTRIBUTING.md to recommend FluentUI use * Remove eslint-disable and use non-null assertion
23 lines
606 B
TypeScript
23 lines
606 B
TypeScript
import { NotebookContentRecordProps, selectors } from "@nteract/core";
|
|
|
|
/**
|
|
* A bunch of utilities to interact with nteract
|
|
*/
|
|
export default class NTeractUtil {
|
|
public static getCurrentCellType(content: NotebookContentRecordProps): "markdown" | "code" | "raw" | undefined {
|
|
if (!content) {
|
|
return undefined;
|
|
}
|
|
|
|
const cellFocusedId = selectors.notebook.cellFocused(content.model);
|
|
if (cellFocusedId) {
|
|
const cell = selectors.notebook.cellById(content.model, { id: cellFocusedId });
|
|
if (cell) {
|
|
return cell.cell_type;
|
|
}
|
|
}
|
|
|
|
return undefined;
|
|
}
|
|
}
|