JXA-userland / JXA

JavaScript for Automation(JXA) packages for TypeScript/Node.js.
MIT License
429 stars 22 forks source link

tsc v3.3.33 errors on dts @jxa/global-type #11

Closed bialikover closed 4 years ago

bialikover commented 5 years ago

Hi there!

This might be a dumb question but when importing @jxa/global-type on my .ts file and then compiling I get this error:

node_modules/@jxa/global-type/src/index.d.ts:8:11 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Application' must be of type 'typeof Application', but here has type 'typeof Application & object'.

8     const Application: typeof Application_ & object;
            ~~~~~~~~~~~
Found 1 error.

seems like its causing conflict with this two definition type..

https://github.com/JXA-userland/JXA/blob/92b61a55975f4c9801fe6d488550ec7a5bb9b682/packages/%40jxa/global-type/src/index.d.ts#L8

Is it necessary to check that Application is also an object?

m-thomson commented 4 years ago

FWIW removing & object from the type definition has worked for me. But I should add that (1) My testing has been very limited so far and (2) I'm pretty new-ish to TypeScript so don't fully understand the implications.

azu commented 4 years ago

https://github.com/JXA-userland/JXA/releases/tag/v1.3.1 I've release 1.3.1. Please try it