{"action":"closed","issue":{"url":"https://api.github.com/repos/NativeScript/docs/issues/558","repository_url":"https://api.github.com/repos/NativeScript/docs","labels_url":"https://api.github.com/repos/NativeScript/docs/issues/558/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/docs/issues/558/comments","events_url":"https://api.github.com/repos/NativeScript/docs/issues/558/events","html_url":"https://github.com/NativeScript/docs/issues/558","id":188234124,"number":558,"title":"Documentation needed for tns-platform-declarations","user":{"login":"NickIliev","id":18008302,"avatar_url":"https://avatars1.githubusercontent.com/u/18008302?v=3","gravatar_id":"","url":"https://api.github.com/users/NickIliev","html_url":"https://github.com/NickIliev","followers_url":"https://api.github.com/users/NickIliev/followers","following_url":"https://api.github.com/users/NickIliev/following{/other_user}","gists_url":"https://api.github.com/users/NickIliev/gists{/gist_id}","starred_url":"https://api.github.com/users/NickIliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickIliev/subscriptions","organizations_url":"https://api.github.com/users/NickIliev/orgs","repos_url":"https://api.github.com/users/NickIliev/repos","events_url":"https://api.github.com/users/NickIliev/events{/privacy}","received_events_url":"https://api.github.com/users/NickIliev/received_events","type":"User","site_admin":false},"labels":[{"id":155343085,"url":"https://api.github.com/repos/NativeScript/docs/labels/3%20-%20Done","name":"3 - Done","color":"CCCCCC","default":false},{"id":243515065,"url":"https://api.github.com/repos/NativeScript/docs/labels/T:Docs","name":"T:Docs","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-09T12:17:35Z","updated_at":"2017-05-17T08:31:21Z","closed_at":"2017-05-17T08:31:21Z","body":"_From @NathanWalker on November 6, 2016 23:15_\n\nI personally have struggled getting a tsconfig to work with `tns-platform-declarations` since day 1. I just tried using the `next` tag of these declarations to see if things have improved, but same issues. Sometimes I can get it to work, othertimes it's purely a guessing game of type definitions and it's just highly frustrating.\r\n\r\nHere's a tsconfig that I hope would work:\r\n```\r\n{\r\n    \"compilerOptions\": {\r\n        \"target\": \"es5\",\r\n        \"module\": \"commonjs\",\r\n        \"declaration\": true,\r\n        \"removeComments\": true,\r\n        \"noLib\": false,\r\n        \"emitDecoratorMetadata\": true,\r\n        \"experimentalDecorators\": true,\r\n        \"lib\": [\r\n            \"es2016\"\r\n        ],\r\n        \"sourceMap\": true,\r\n        \"pretty\": true,\r\n        \"allowUnreachableCode\": false,\r\n        \"allowUnusedLabels\": false,\r\n        \"noEmitHelpers\": true,\r\n        \"noEmitOnError\": false,\r\n        \"noImplicitAny\": false,\r\n        \"noImplicitReturns\": true,\r\n        \"noImplicitUseStrict\": false,\r\n        \"noFallthroughCasesInSwitch\": true,\r\n        \"typeRoots\": [\r\n            \"./node_modules/@types\",\r\n            \"./node_modules\"\r\n        ]\r\n    },\r\n    \"exclude\": [\r\n        \"demo\",\r\n        \"node_modules\"\r\n    ],\r\n    \"compileOnSave\": false\r\n}\r\n```\r\n\r\nHowever this sadly results in these annoying errors:\r\n```\r\n declare var AudioBuffer: interop.StructType<AudioBuffer>;\r\n              ~~~~~~~~~~~\r\n\r\nnode_modules/tns-platform-declarations/ios/objc-i386/objc!CoreAudio.d.ts(7,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'AudioBuffer' must be of type '{ new (): AudioBuffer; prototype: AudioBuffer; }', but here has type 'StructType<AudioBuffer>'.\r\n\r\n\r\n4954 declare class UIEvent extends NSObject {\r\n                   ~~~~~~~\r\n\r\nnode_modules/tns-platform-declarations/ios/objc-i386/objc!UIKit.d.ts(4954,15): error TS2300: Duplicate identifier 'UIEvent'.\r\n\r\n\r\n4954 declare class UIEvent extends NSObject {\r\n                   ~~~~~~~\r\n\r\nnode_modules/tns-platform-declarations/ios/objc-i386/objc!UIKit.d.ts(4954,15): error TS2417: Class static side 'typeof UIEvent' incorrectly extends base class static side 'typeof NSObject'.\r\n  Types of property 'alloc' are incompatible.\r\n    Type '() => UIEvent' is not assignable to type '() => NSObject'.\r\n      Type 'UIEvent' is not assignable to type 'NSObject'.\r\n        Property 'accessibilityActivationPoint' is missing in type 'UIEvent'.\r\n\r\n\r\n15879 interface UIEvent extends Event {\r\n                ~~~~~~~\r\n\r\nnode_modules/typescript/lib/lib.d.ts(15879,11): error TS2300: Duplicate identifier 'UIEvent'.\r\n\r\n\r\n15885 declare var UIEvent: {\r\n                  ~~~~~~~\r\n\r\nnode_modules/typescript/lib/lib.d.ts(15885,13): error TS2300: Duplicate identifier 'UIEvent'.\r\n```\r\n\r\nUsing a `references.d.ts` file like this:\r\n```\r\n/// <reference path=\"./node_modules/tns-core-modules/tns-core-modules.d.ts\" />\r\n/// <reference path=\"./node_modules/typescript/lib/lib.d.ts\" />\r\n/// <reference path=\"./node_modules/tns-platform-declarations/android.d.ts\" />\r\n/// <reference path=\"./node_modules/tns-platform-declarations/ios.d.ts\" />\r\n```\r\n\r\nWhat is the suggested setup to use them and could this be blatantly obvious in the docs somewhere? Please help. Can bleed no longer. \n\n_Copied from original issue: NativeScript/NativeScript#3033_"}}
{"actor":{"display_login":"NickIliev"}}