{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23735","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23735/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23735/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23735/events","html_url":"https://github.com/Microsoft/TypeScript/issues/23735","id":318332359,"number":23735,"title":"Syntatic sugar for callable namespaces (functions as namespace)","user":{"login":"KSXGitHub","id":11488886,"avatar_url":"https://avatars2.githubusercontent.com/u/11488886?v=4","gravatar_id":"","url":"https://api.github.com/users/KSXGitHub","html_url":"https://github.com/KSXGitHub","followers_url":"https://api.github.com/users/KSXGitHub/followers","following_url":"https://api.github.com/users/KSXGitHub/following{/other_user}","gists_url":"https://api.github.com/users/KSXGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/KSXGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KSXGitHub/subscriptions","organizations_url":"https://api.github.com/users/KSXGitHub/orgs","repos_url":"https://api.github.com/users/KSXGitHub/repos","events_url":"https://api.github.com/users/KSXGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/KSXGitHub/received_events","type":"User","site_admin":false},"labels":[{"id":113971226,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-27T09:06:43Z","updated_at":"2018-05-14T16:09:53Z","closed_at":"2018-05-14T16:09:53Z","author_association":"NONE","body":"\r\n<!-- If you have a SUGGESTION:\r\n  Most suggestion reports are duplicates, please search extra hard before logging a new suggestion.\r\n  See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md\r\n-->\r\n\r\nI have a **suggestion**: I love to write callable namespaces but I don't want to write its name twice (one for function, one for namespace), so I propose a syntax sugar for this:\r\n\r\n```typescript\r\nexport namespace myFunc {\r\n  (x: number) => square(2 * x)\r\n  export const square = (x: number) => x * x\r\n}\r\n```\r\n\r\nThis should be equivalent to:\r\n\r\n```typescript\r\nexport function myFunc (x: number) {\r\n  return myFunc.square(2 * x)\r\n}\r\n\r\nexport namespace myFunc {\r\n  export const square = (x: number) => x * x\r\n} \r\n```\r\n\r\n---\r\n\r\n**Search Terms:** \r\ncallable namespace syntax sugar\r\n"}}
{"actor":{"display_login":"typescript-bot"}}