ERROR in /component.tsx(6,10)
TS2740: Type '{ ref: RefObject<PerspectiveViewer>; }' is missing the following properties from type 'PerspectiveViewer': load, update, notifyResize, delete, and 249 more.
Last active
January 8, 2020 22:27
-
-
Save stevenvachon/92d8dac8032f1ca6b213ebb9549afd11 to your computer and use it in GitHub Desktop.
TypeScript issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module '@finos/perspective-viewer' { | |
export interface PerspectiveViewer extends PerspectiveViewerOptions, HTMLElement { | |
load(data: TableData | Table, options?: TableOptions): void; | |
load(schema: Schema, options?: TableOptions): void; | |
update(data: TableData): void; | |
notifyResize(): void; | |
delete(delete_table: boolean): Promise<void>; | |
clear() : void; | |
replace(data: TableData) : void; | |
flush(): Promise<void>; | |
toggleConfig(): void; | |
save(): PerspectiveViewerOptions; | |
reset(): void; | |
restore(x: any): Promise<void>; | |
restyleElement(): void; | |
readonly table?: Table; | |
} | |
} | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PerspectiveViewer } from 'types'; | |
import React, { createRef, PureComponent } from 'react'; | |
import '@finos/perspective-viewer'; | |
export class PerspectivePanel extends PureComponent { | |
perspectiveViewer = createRef<PerspectiveViewer>(); | |
render() { | |
return (<perspective-viewer ref={this.perspectiveViewer} />); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PerspectiveViewer as PerspectiveViewerOriginal } from '@finos/perspective-viewer'; | |
import { Ref } from 'react'; | |
// @todo https://github.com/Microsoft/TypeScript/issues/16936 | |
export interface PerspectiveViewer extends PerspectiveViewerOriginal { | |
ref: Ref<PerspectiveViewerOriginal>; | |
} | |
declare global { | |
namespace JSX { | |
interface IntrinsicElements { | |
'perspective-viewer': PerspectiveViewer; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment