Jump to content

referencing BJS from typescript


fenomas
 Share

Recommended Posts

Hi,

 

I tried to do something with BJS from typescript, but compiling gives me a raft of errors:

/usr/local/lib/node_modules/typescript/bin/lib.d.ts(5550,5): error TS2300: Duplicate identifier 'pointerLockElement'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(5584,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(11288,5): error TS2300: Duplicate identifier 'movementX'./usr/local/lib/node_modules/typescript/bin/lib.d.ts(11289,5): error TS2300: Duplicate identifier 'movementY'.typings/babylon.2.1.d.ts(314,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'.typings/babylon.2.1.d.ts(321,5): error TS2300: Duplicate identifier 'pointerLockElement'.typings/babylon.2.1.d.ts(362,5): error TS2300: Duplicate identifier 'movementX'.typings/babylon.2.1.d.ts(363,5): error TS2300: Duplicate identifier 'movementY'.

It looks like BJS declares things already declared in the built-in files. This is just from referencing the type definition, there isn't any code at all.

 

Does everyone else not get this? Or is there a way to make tsc ignore it?

Link to comment
Share on other sites

Hi,

to me it looks like you have somewhere another definition file that is being included. The first few errors come from the lib.d.ts, the main TypeScript definition file. How does your referencing definition look like? How do you compile TypeScript?

Link to comment
Share on other sites

Just an idea - What version of tsc are you using?

The pointerLockElement (for example) is at the updated lib.d.ts in row 5683. In Babylon, those variables are defined in the Mixins interfaces file. You might be using a version where it is either already defined and not needed in the mixins, or a version that doesn't support mixins.

Link to comment
Share on other sites

There's nothing in the folder but the definition and the typescript file.

Last login: Thu May 28 01:43:52 on ttys003andy:~> mkdir tempandy:~> cd temp/andy:temp> curl -sO https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/babylon.2.1.d.tsandy:temp> echo '/// <reference path="babylon.2.1.d.ts"/>' > index.tsandy:temp> npm install [email protected] node_modules/typescriptandy:temp> ls -latotal 488drwxr-xr-x   5 andy  staff     170 May 28 01:50 .drwxr-xr-x+ 43 andy  staff    1462 May 28 01:50 ..-rw-r--r--   1 andy  staff  245445 May 28 01:50 babylon.2.1.d.ts-rw-r--r--   1 andy  staff      41 May 28 01:50 index.tsdrwxr-xr-x   4 andy  staff     136 May 28 01:50 node_modulesandy:temp> ./node_modules/typescript/bin/tsc index.ts/Users/andy/temp/node_modules/typescript/bin/lib.d.ts(5550,5): error TS2300: Duplicate identifier 'pointerLockElement'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(5584,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(11288,5): error TS2300: Duplicate identifier 'movementX'./Users/andy/temp/node_modules/typescript/bin/lib.d.ts(11289,5): error TS2300: Duplicate identifier 'movementY'.babylon.2.1.d.ts(314,5): error TS2300: Duplicate identifier 'webkitIsFullScreen'.babylon.2.1.d.ts(321,5): error TS2300: Duplicate identifier 'pointerLockElement'.babylon.2.1.d.ts(362,5): error TS2300: Duplicate identifier 'movementX'.babylon.2.1.d.ts(363,5): error TS2300: Duplicate identifier 'movementY'.andy:temp>
Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...