{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7788","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7788/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7788/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7788/events","html_url":"https://github.com/Microsoft/TypeScript/issues/7788","id":145398572,"number":7788,"title":"Cannot find name 'Promise' & Cannot find name 'require'","user":{"login":"MarkPieszak","id":2574412,"avatar_url":"https://avatars.githubusercontent.com/u/2574412?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkPieszak","html_url":"https://github.com/MarkPieszak","followers_url":"https://api.github.com/users/MarkPieszak/followers","following_url":"https://api.github.com/users/MarkPieszak/following{/other_user}","gists_url":"https://api.github.com/users/MarkPieszak/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkPieszak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkPieszak/subscriptions","organizations_url":"https://api.github.com/users/MarkPieszak/orgs","repos_url":"https://api.github.com/users/MarkPieszak/repos","events_url":"https://api.github.com/users/MarkPieszak/events{/privacy}","received_events_url":"https://api.github.com/users/MarkPieszak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-02T17:55:56Z","updated_at":"2016-04-02T18:10:01Z","closed_at":"2016-04-02T18:10:01Z","body":"**TypeScript Version:** 1.8.9\r\n\r\n**Expected behavior:**\r\nTS should be aware of `require` & `Promise`\r\n\r\n**Actual behavior:** \r\nTS errors appear for require & Promise.\r\n\r\n    var something = require('something'); // <--  Cannot find name 'require'\r\n\r\n    Promise<any> { // <-- Cannot find name 'Promise'\r\n   \r\nI'm able to work around the `require` issue by simply declaring a custom typing for it, but not with Promise. I'm wondering if these should be more of a default part of TypeScript?\r\n\r\n    declare var require:any;"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/204767779","html_url":"https://github.com/Microsoft/TypeScript/issues/7788#issuecomment-204767779","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/7788","id":204767779,"user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T18:10:01Z","updated_at":"2016-04-02T18:10:01Z","body":"For `require`, we have a module-agnostic way to import (i.e. it works in Node and with RequireJS).\r\n\r\n```ts\r\nimport something = require('something');\r\n```\r\n\r\nNotice the only change is that we used the `import` keyword instead of `var`.\r\n\r\nTo use `Promise`, you'll either need to set the compiler option `target` to `es2015` (which means that you won't get any down-level transformations to ES5, so watch out!), or use [es6-shim.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/es6-shim/es6-shim.d.ts) (which is the safer option).\r\n\r\nThe good news is that with 2.0 we're going to support scenarios where your standard library has ES2015 features like `Promise`, but TypeScript will still compiler down to ES5. See #6974."}}