{"action":"created","issue":{"url":"https://api.github.com/repos/typings/typings/issues/734","repository_url":"https://api.github.com/repos/typings/typings","labels_url":"https://api.github.com/repos/typings/typings/issues/734/labels{/name}","comments_url":"https://api.github.com/repos/typings/typings/issues/734/comments","events_url":"https://api.github.com/repos/typings/typings/issues/734/events","html_url":"https://github.com/typings/typings/issues/734","id":193245222,"number":734,"title":"Wildcarting object fields","user":{"login":"Spown","id":3817672,"avatar_url":"https://avatars.githubusercontent.com/u/3817672?v=3","gravatar_id":"","url":"https://api.github.com/users/Spown","html_url":"https://github.com/Spown","followers_url":"https://api.github.com/users/Spown/followers","following_url":"https://api.github.com/users/Spown/following{/other_user}","gists_url":"https://api.github.com/users/Spown/gists{/gist_id}","starred_url":"https://api.github.com/users/Spown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spown/subscriptions","organizations_url":"https://api.github.com/users/Spown/orgs","repos_url":"https://api.github.com/users/Spown/repos","events_url":"https://api.github.com/users/Spown/events{/privacy}","received_events_url":"https://api.github.com/users/Spown/received_events","type":"User","site_admin":false},"labels":[{"id":275591301,"url":"https://api.github.com/repos/typings/typings/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-12-02T23:43:53Z","updated_at":"2016-12-03T22:48:16Z","closed_at":"2016-12-03T20:05:57Z","body":"### Prerequisites\r\n\r\n* [x] Did you check the [FAQ](https://github.com/typings/typings/blob/master/docs/faq.md)?\r\n* [x] Did you search open **and closed** issues to see if your issue has already been reported?\r\n\r\nHowever I'm not well versed in TypeScript and this might be a stupid question for TS. \r\n\r\n### Description\r\nSo I have a kind of a factory object (``platform``) that represents an express cms I made for myself. It uses mongoose for DB interaction and it's models are stored in an subobject (``platform.models``). Like:\r\n```\r\nplatform: {\r\n  models: {\r\n    Cat: typeof mongoose.Model\r\n    Dog: typeof mongoose.Model\r\n}\r\n```\r\nThe models are defined on project-to-project basis via plugNplay logic so there is no way to tell what members are going to be in the models object. However it doesn't matter, since they are always going to be ``mongoose`` models. So when I type ``platform.models.foo.`` in VSCode I expect Intellisense to give me mongoose model's members, regardless of what I actually have typed instead of ``foo``.\r\n\r\nIs it even possible with Typings/TypeScript? If so how?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/typings/typings/issues/comments/264670902","html_url":"https://github.com/typings/typings/issues/734#issuecomment-264670902","issue_url":"https://api.github.com/repos/typings/typings/issues/734","id":264670902,"user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T22:48:16Z","updated_at":"2016-12-03T22:48:16Z","body":"> there ain't going to be anything else than a mongoose model\r\n\r\nSorry, I think you misunderstood the comment. I didn't say there were other types, but a key can be `undefined` in the index signature (e.g. intellisense would say it exists when it might not really - it just doesn't sound like it's a concern for you).\r\n\r\n> is there a name for this\r\n\r\nThey are called index signatures - see https://www.typescriptlang.org/docs/handbook/interfaces.html. Here's a recent discussion about what you just brought up, feel free to leave a comment there - https://github.com/Microsoft/TypeScript/issues/12596."}}
{"actor":{"display_login":"blakeembrey"}}