{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/722","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/722/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/722/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/722/events","html_url":"https://github.com/Microsoft/vscode/issues/722","id":119100205,"number":722,"title":"Extract reusable method","user":{"login":"SamVerschueren","id":1913805,"avatar_url":"https://avatars.githubusercontent.com/u/1913805?v=3","gravatar_id":"","url":"https://api.github.com/users/SamVerschueren","html_url":"https://github.com/SamVerschueren","followers_url":"https://api.github.com/users/SamVerschueren/followers","following_url":"https://api.github.com/users/SamVerschueren/following{/other_user}","gists_url":"https://api.github.com/users/SamVerschueren/gists{/gist_id}","starred_url":"https://api.github.com/users/SamVerschueren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamVerschueren/subscriptions","organizations_url":"https://api.github.com/users/SamVerschueren/orgs","repos_url":"https://api.github.com/users/SamVerschueren/repos","events_url":"https://api.github.com/users/SamVerschueren/events{/privacy}","received_events_url":"https://api.github.com/users/SamVerschueren/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T20:39:09Z","updated_at":"2015-11-27T07:58:12Z","closed_at":"2015-11-27T07:58:12Z","body":"I was developing an extension and had to replace the text in my editor with text that was changed. For this, I was thinking about a reusable function as you can see here: https://github.com/SamVerschueren/vscode-set-text/blob/master/index.ts\r\n\r\nIt works when I test it locally, so that's good. But I am struggling with publishing it to npm.\r\n\r\nFirst of all, the type definition is written by hand, is there an easy way to generate it automatically? If I do it with the `--definition` flag, the exported type definition seems incorrect.\r\n\r\nSecondly, when installing the module, the type definition shows errors which means I can't import the method correctly with `import setText from 'vscode-set-text'`.\r\n\r\nIs there anyone out there that can help me with it or link me to documentation that helps me get this out the door?"}}