Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Typescript / Angular constructor errors #53

Closed
@N-Andronopoulos

Description

@N-Andronopoulos

Describe the bug
Import error/confusion.

Litepicker 1.0.34
Typescript 3.8
Angular 9

To Reproduce
If you import like this: import { Litepicker } from 'litepicker'; in typescript (angular)
and use it as const picker = new Litepicker(..). I get:

ERROR in ..../src/app/main-nav/service-overview/service-overview.component.ts:41:24 - error TS2351: This expression is not constructable. Type 'typeof import("...../node_modules/litepicker/dist/js/index")' has no construct signatures.

If I import it as import * as Litepicker from 'litepicker';

Then compiler errors with: TS2351: This expression is not constructable.   Type 'typeof import("/..../node_modules/litepicker/dist/js/index")' has no construct signatures.

(I also tried import Litepicker from 'litepicker'; which is not valid)

I think you have the types mixed up or something.

edit
I think you need a contructor defined in methods.ts
Litepicker.prototype = [...] something like that.

Expected behavior
To run without errors or warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions