Fix bugs discovered by TS 4.1 (#47683)

1. TS 4.1 no longer has a built-in type named 'Position'.
2. TS 4.1 intentionally sets the global `name: void` to make it less
usable.

This flushed out a few bugs.
This commit is contained in:
Nathan Shively-Sanders 2020-09-16 16:20:41 -07:00 committed by GitHub
parent 1cb79ff5d9
commit 7aae63bc29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -256,7 +256,7 @@ declare class BScroll {
'scroll' |
'scrollEnd' |
'touchEnd',
fn: (pos: Position) => any
fn: (pos: BScroll.Position) => any
): void;
off(

View File

@ -2,7 +2,6 @@
// Project: https://github.com/plotly/react-cytoscapejs
// Definitions by: Emmanuel COunasse <https://github.com/manuc66/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import cytoscape = require('cytoscape');
import { Component, CSSProperties } from 'react';
@ -16,7 +15,7 @@ interface CytoscapeComponentProps {
stylesheet?: cytoscape.Stylesheet | cytoscape.Stylesheet[] | string;
className?: string;
zoom?: number;
pan?: Position;
pan?: cytoscape.Position;
minZoom?: number;
maxZoom?: number;
zoomingEnabled?: boolean;

View File

@ -19,4 +19,5 @@ class MyCustomElement extends HTMLElement {
}
}
const name = "name";
customElements.define(name, MyCustomElement);