-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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
Labels
No labels