{"action":"created","issue":{"url":"https://api.github.com/repos/moment/moment/issues/3371","repository_url":"https://api.github.com/repos/moment/moment","labels_url":"https://api.github.com/repos/moment/moment/issues/3371/labels{/name}","comments_url":"https://api.github.com/repos/moment/moment/issues/3371/comments","events_url":"https://api.github.com/repos/moment/moment/issues/3371/events","html_url":"https://github.com/moment/moment/pull/3371","id":171153089,"number":3371,"title":"fix bug when used in typescript and browser-side","user":{"login":"plantain-00","id":7639395,"avatar_url":"https://avatars.githubusercontent.com/u/7639395?v=3","gravatar_id":"","url":"https://api.github.com/users/plantain-00","html_url":"https://github.com/plantain-00","followers_url":"https://api.github.com/users/plantain-00/followers","following_url":"https://api.github.com/users/plantain-00/following{/other_user}","gists_url":"https://api.github.com/users/plantain-00/gists{/gist_id}","starred_url":"https://api.github.com/users/plantain-00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plantain-00/subscriptions","organizations_url":"https://api.github.com/users/plantain-00/orgs","repos_url":"https://api.github.com/users/plantain-00/repos","events_url":"https://api.github.com/users/plantain-00/events{/privacy}","received_events_url":"https://api.github.com/users/plantain-00/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/moment/moment/labels/TypeScript","name":"TypeScript","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-08-15T11:25:47Z","updated_at":"2016-09-19T00:25:25Z","closed_at":"2016-08-30T00:34:34Z","pull_request":{"url":"https://api.github.com/repos/moment/moment/pulls/3371","html_url":"https://github.com/moment/moment/pull/3371","diff_url":"https://github.com/moment/moment/pull/3371.diff","patch_url":"https://github.com/moment/moment/pull/3371.patch"},"body":"code example:\r\n```ts\r\n/// <reference types=\"moment\"/>\r\nmoment();\r\n```\r\nthe error message is `can not find moment`\r\nso I compare it with some similar library's typings, eg, socket.io-client(https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/socket.io-client/socket.io-client.d.ts) it declares a module('socket.io-client'), so I tried to do something similar, it did fix the error.\r\n\r\nand it doesn't affect:(nodejs-side)\r\n```ts\r\nimport * as moment from \"moment\";\r\nmoment();\r\n``` "},"comment":{"url":"https://api.github.com/repos/moment/moment/issues/comments/247893798","html_url":"https://github.com/moment/moment/pull/3371#issuecomment-247893798","issue_url":"https://api.github.com/repos/moment/moment/issues/3371","id":247893798,"user":{"login":"plantain-00","id":7639395,"avatar_url":"https://avatars.githubusercontent.com/u/7639395?v=3","gravatar_id":"","url":"https://api.github.com/users/plantain-00","html_url":"https://github.com/plantain-00","followers_url":"https://api.github.com/users/plantain-00/followers","following_url":"https://api.github.com/users/plantain-00/following{/other_user}","gists_url":"https://api.github.com/users/plantain-00/gists{/gist_id}","starred_url":"https://api.github.com/users/plantain-00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plantain-00/subscriptions","organizations_url":"https://api.github.com/users/plantain-00/orgs","repos_url":"https://api.github.com/users/plantain-00/repos","events_url":"https://api.github.com/users/plantain-00/events{/privacy}","received_events_url":"https://api.github.com/users/plantain-00/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T00:25:25Z","updated_at":"2016-09-19T00:25:25Z","body":"well, a custom `.d.ts` with this code works:\r\n```ts\r\nimport * as Moment from \"moment\";\r\n\r\ndeclare global {\r\n    var moment: typeof Moment\r\n}\r\n```"}}
{"actor":{"display_login":"plantain-00"}}