{"action":"closed","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1343","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1343/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1343/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1343/events","html_url":"https://github.com/lhorie/mithril.js/issues/1343","id":180017987,"number":1343,"title":"Mithril.Child does not include TrustedString in mithril.d.ts","user":{"login":"andraaspar","id":3512382,"avatar_url":"https://avatars.githubusercontent.com/u/3512382?v=3","gravatar_id":"","url":"https://api.github.com/users/andraaspar","html_url":"https://github.com/andraaspar","followers_url":"https://api.github.com/users/andraaspar/followers","following_url":"https://api.github.com/users/andraaspar/following{/other_user}","gists_url":"https://api.github.com/users/andraaspar/gists{/gist_id}","starred_url":"https://api.github.com/users/andraaspar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andraaspar/subscriptions","organizations_url":"https://api.github.com/users/andraaspar/orgs","repos_url":"https://api.github.com/users/andraaspar/repos","events_url":"https://api.github.com/users/andraaspar/events{/privacy}","received_events_url":"https://api.github.com/users/andraaspar/received_events","type":"User","site_admin":false},"labels":[{"id":86465857,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/bug","name":"bug","color":"fc2929","default":true},{"id":193884386,"url":"https://api.github.com/repos/lhorie/mithril.js/labels/contribution%20welcome","name":"contribution welcome","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-29T11:02:44Z","updated_at":"2016-11-03T16:28:00Z","closed_at":"2016-11-03T16:28:00Z","body":"### Description:\n\nThe following should be correct:\n\n``` ts\nimport * as m from 'mithril'\n\nexport default class Form implements Mithril.Component<any> {\n\n    view() {\n        return m('h3', this.extra())\n    }\n\n    extra(): Mithril.Children {\n        return (Math.random() < .5 ?\n            m.trust('Todos <small>53</small>')\n            :\n            ''\n        )\n    }\n}\n```\n\nYet it emits:\n\n```\n[ts] Type 'string | TrustedString' is not assignable to type 'Children'.\n  Type 'TrustedString' is not assignable to type 'Children'.\n    Type 'TrustedString' is not assignable to type 'ChildArray'.\n      Property 'push' is missing in type 'TrustedString'.\n```\n### Expected:\n\n``` ts\ntype Child = string | TrustedString | VirtualElement | Component<Controller>;\n```\n### Actual:\n\n``` ts\ntype Child = string | VirtualElement | Component<Controller>;\n```\n"}}
{"actor":{"display_login":"tivac"}}