ember-box icon indicating copy to clipboard operation
ember-box copied to clipboard

TypeScript errors

Open boris-petrov opened this issue 5 years ago • 5 comments

Using the latest TypeScript, ember-box, Ember, everything, I get a bunch of those:

node_modules/ember-box/index.d.ts:50:58 - error TS2694: Namespace '"/home/boris/project/node_modules/@types/ember__object/core"' has no exported member 'default'.

50     readonly create: typeof import("@ember/object/core").default.create;

boris-petrov avatar Jan 09 '20 11:01 boris-petrov

Is there anything we can do to resolve this issue?

mfeckie avatar Mar 22 '21 00:03 mfeckie

@mfeckie - well, I have:

declare module 'ember-box';

export function unwrap<T>(argument: T): T;
export function update<T>(argument: T, value: T): void;

In a types/ember-box/index.d.ts file.

boris-petrov avatar Mar 22 '21 08:03 boris-petrov

@boris-petrov Does that just override the definitions from the ones provided by the addon?

mfeckie avatar Mar 22 '21 09:03 mfeckie

Yep.

boris-petrov avatar Mar 22 '21 09:03 boris-petrov

Super helpful! Thanks

mfeckie avatar Mar 23 '21 04:03 mfeckie