mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 18:32:00 +00:00
Upgrade typescript to 4.9.5
This commit is contained in:
@@ -737,17 +737,17 @@ export class D3ForceGraph implements GraphRenderer {
|
||||
.on("dblclick", function (this: Element, _: MouseEvent, d: D3Node) {
|
||||
// https://stackoverflow.com/a/41945742 ('this' implicitly has type 'any' because it does not have a type annotation)
|
||||
// this is the <g> element
|
||||
self.onNodeClicked(this.parentNode, d);
|
||||
self.onNodeClicked(this.parentNode as BaseType, d);
|
||||
})
|
||||
.on("click", function (this: Element, _: MouseEvent, d: D3Node) {
|
||||
// this is the <g> element
|
||||
self.onNodeClicked(this.parentNode, d);
|
||||
self.onNodeClicked(this.parentNode as BaseType, d);
|
||||
})
|
||||
.on("keypress", function (this: Element, event: KeyboardEvent, d: D3Node) {
|
||||
if (event.charCode === Constants.KeyCodes.Space || event.charCode === Constants.KeyCodes.Enter) {
|
||||
event.stopPropagation();
|
||||
// this is the <g> element
|
||||
self.onNodeClicked(this.parentNode, d);
|
||||
self.onNodeClicked(this.parentNode as BaseType, d);
|
||||
}
|
||||
});
|
||||
var nodeSize = this.igraphConfig.nodeSize;
|
||||
|
||||
@@ -2,22 +2,13 @@
|
||||
import { Link } from "@fluentui/react";
|
||||
import { CellId, CellType, ImmutableNotebook } from "@nteract/commutable";
|
||||
// Vendor modules
|
||||
import {
|
||||
actions,
|
||||
AppState,
|
||||
ContentRef,
|
||||
DocumentRecordProps,
|
||||
KernelRef,
|
||||
NotebookContentRecord,
|
||||
selectors,
|
||||
} from "@nteract/core";
|
||||
import { actions, AppState, ContentRef, KernelRef, NotebookContentRecord, selectors } from "@nteract/core";
|
||||
import "@nteract/styles/editor-overrides.css";
|
||||
import "@nteract/styles/global-variables.css";
|
||||
import "codemirror/addon/hint/show-hint.css";
|
||||
import "codemirror/lib/codemirror.css";
|
||||
import { Notebook } from "Common/Constants";
|
||||
import { useDialog } from "Explorer/Controls/Dialog";
|
||||
import * as Immutable from "immutable";
|
||||
import * as React from "react";
|
||||
import { Provider } from "react-redux";
|
||||
import "react-table/react-table.css";
|
||||
@@ -315,7 +306,8 @@ export class NotebookComponentBootstrapper {
|
||||
return false;
|
||||
}
|
||||
|
||||
return selectors.notebook.isDirty(content.model as Immutable.RecordOf<DocumentRecordProps>);
|
||||
// TODO Fix this typing here
|
||||
return selectors.notebook.isDirty(content.model as never);
|
||||
}
|
||||
|
||||
public isNotebookUntrusted(): boolean {
|
||||
|
||||
@@ -111,7 +111,8 @@ const makeMapStateToProps = (_initialState: AppState, initialProps: InitialProps
|
||||
} else if (kernel?.kernelSpecName) {
|
||||
kernelSpecDisplayName = kernel.kernelSpecName;
|
||||
} else if (content && content.type === "notebook") {
|
||||
kernelSpecDisplayName = selectors.notebook.displayName(content.model) || " ";
|
||||
// TODO Fix typing here
|
||||
kernelSpecDisplayName = selectors.notebook.displayName(content.model as never) || " ";
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
5
src/global.d.ts
vendored
5
src/global.d.ts
vendored
@@ -15,4 +15,9 @@ declare global {
|
||||
$: any;
|
||||
gitSha: string;
|
||||
}
|
||||
|
||||
// msSaveBlob has been removed from typescript 4.4, but not completely deprecated from browsers
|
||||
interface Navigator {
|
||||
msSaveBlob?: (blob: any, defaultName?: string) => boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { configContext } from "../ConfigContext";
|
||||
|
||||
export async function fetchPhoto(accessToken: string): Promise<Blob | void> {
|
||||
export async function fetchPhoto(accessToken: string): Promise<Blob> {
|
||||
const headers = new Headers();
|
||||
const bearer = `Bearer ${accessToken}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user