Skip to content

Some methods lack return types #468

@StefanNedelchev

Description

@StefanNedelchev

I tried importing the plugin into a typescript project but I get these errors during compilation:

Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:16:5 - error TS7010: 'pan', which lacks return-type annotation, implicitly has an 'any' return type.
[ng] 16     pan(pan: PanAmount, options?: Partial<PanOptions>, scales?: Scale[]);
[ng]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:17:5 - error TS7010: 'zoom', which lacks return-type annotation, implicitly has an 'any' return type.
[ng] 17     zoom(zoom: ZoomAmount, options?: Partial<ZoomOptions>, useTransition?: boolean);
[ng]        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:25:17 - error TS7010: 'doPan', which lacks return-type annotation, implicitly has an 'any' return type.
[ng] 25 export function doPan(chart: Chart, pan: PanAmount, options?: Partial<PanOptions>, scales?: Scale[]);
[ng]                    ~~~~~
[ng] Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:26:17 - error TS7010: 'doZoom', which lacks return-type annotation, implicitly has an 'any' return type.
[ng] 26 export function doZoom(chart: Chart, zoom: ZoomAmount, options?: Partial<ZoomOptions>, useTransition?: boolean);
[ng]                    ~~~~~~
[ng] Error: node_modules/chartjs-plugin-zoom/types/index.d.ts:27:17 - error TS7010: 'resetZoom', which lacks return-type annotation, implicitly has an 'any' return type.
[ng] 27 export function resetZoom(chart: Chart);

I tried editting the index.d.ts file eand added void return types to these methods and the errors were gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions