mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 23:38:45 +01:00
Fix typescript strict issues for NotebookTerminalComponent and other files
This commit is contained in:
parent
8eeda41021
commit
85aa028cb4
@ -15,10 +15,13 @@ export interface NotebookTerminalComponentProps {
|
||||
}
|
||||
|
||||
export class NotebookTerminalComponent extends React.Component<NotebookTerminalComponentProps> {
|
||||
private terminalWindow: Window;
|
||||
// Need to declare as Window | null as contentWindow is typeof Window | null.
|
||||
// Only Window type declaration throws compilation typeScript error in compile strict mode
|
||||
private terminalWindow: Window | null;
|
||||
|
||||
constructor(props: NotebookTerminalComponentProps) {
|
||||
super(props);
|
||||
this.terminalWindow = window;
|
||||
}
|
||||
|
||||
componentDidMount(): void {
|
||||
|
@ -25,12 +25,12 @@ const notebookRecord = makeNotebookRecord({
|
||||
"0": makeMarkdownCell({
|
||||
cell_type: "markdown",
|
||||
source: "abc",
|
||||
metadata: undefined,
|
||||
metadata: Map(),
|
||||
} as MarkdownCellParams),
|
||||
"1": makeCodeCell({
|
||||
cell_type: "code",
|
||||
execution_count: undefined,
|
||||
metadata: undefined,
|
||||
execution_count: 0,
|
||||
metadata: Map(),
|
||||
source: "print(5)",
|
||||
outputs: List.of({
|
||||
name: "stdout",
|
||||
@ -40,8 +40,8 @@ const notebookRecord = makeNotebookRecord({
|
||||
} as CodeCellParams),
|
||||
"2": makeCodeCell({
|
||||
cell_type: "code",
|
||||
execution_count: undefined,
|
||||
metadata: undefined,
|
||||
execution_count: 0,
|
||||
metadata: Map(),
|
||||
source: 'display(HTML("<h1>Sample html</h1>"))',
|
||||
outputs: List.of({
|
||||
data: Object.freeze({
|
||||
@ -54,8 +54,8 @@ const notebookRecord = makeNotebookRecord({
|
||||
} as CodeCellParams),
|
||||
"3": makeCodeCell({
|
||||
cell_type: "code",
|
||||
execution_count: undefined,
|
||||
metadata: undefined,
|
||||
execution_count: 0,
|
||||
metadata: Map(),
|
||||
source: 'print("hello world")',
|
||||
outputs: List.of({
|
||||
name: "stdout",
|
||||
|
@ -5,9 +5,9 @@ import { ApiType } from "../UserContext";
|
||||
export interface TerminalProps {
|
||||
authToken: string;
|
||||
notebookServerEndpoint: string;
|
||||
terminalEndpoint: string;
|
||||
databaseAccount: DataModels.DatabaseAccount;
|
||||
authType: AuthType;
|
||||
terminalEndpoint: string | undefined;
|
||||
databaseAccount: DataModels.DatabaseAccount | undefined;
|
||||
authType: AuthType | undefined;
|
||||
apiType: ApiType;
|
||||
subscriptionId: string;
|
||||
subscriptionId: string | undefined;
|
||||
}
|
||||
|
@ -139,7 +139,9 @@
|
||||
"./src/userContext.test.ts",
|
||||
"src/Common/EntityValue.tsx",
|
||||
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx"
|
||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
|
||||
"./src/Explorer/Controls/Notebook/NotebookTerminalComponent.tsx",
|
||||
"./src/Explorer/Notebook/NotebookUtil.test.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/CellOutputViewer/transforms/**/*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user