Skip to content

Need to use renamed import #5

@michal-minich

Description

@michal-minich

I want to use "SArray" for data constructor and type in the same file. I have to use following import construct.

import SArray, { SArray as SArrayType } from "s-array";
function fill() : SArrayType<string> {
    const items = SArray(["a", "b", "c"]);
    return items;
}

this is import that work or SArray as a funciton

import SArray from "s-array";

function fill() {
    const items = SArray(["a", "b", "c"]);
    return items;
}

and this type of import make SArray a type

import { SArray } from "s-array";

function fill() : SArray<string> {
    return null;
}

I suppose the error can be in way how type definition file is written?
I'm using TypeScript 3 and node/npm

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions