What is proper way to import exported Chai interface

Viewed 201

I believe this more like TypeScript related question, but since I'm stuck here working with Chai so...

I'm trying to import interface ExpectStatic from chai definition file.

in the definition file, I can clearly see that it has an exported interface

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/cdf26acde5da9f861f222e2a20a21e811684b857/types/chai/index.d.ts

 export interface ExpectStatic {
        (val: any, message?: string): Assertion;
        fail(message?: string): never;
        fail(actual: any, expected: any, message?: string, operator?: Operator): never;
    }

However when I try this

import { ExpectStatic } from "chai";

it says Module '"chai"' has no exported member 'ExpectStatic'.ts(2305)

Sure thing I can reference a chai type in my file with something like /// <reference types="chai" />.

But it's pretty ugly as to me.

Is there a way to import this interface with a more ...traditional approach?

0 Answers
Related