{"action":"closed","issue":{"url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/2605","labels_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/2605/labels{/name}","comments_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/2605/comments","events_url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/issues/2605/events","html_url":"https://github.com/borisyankov/DefinitelyTyped/issues/2605","id":39341030,"number":2605,"title":"Angular linking function can be either a function or an object","user":{"login":"pocesar","id":461084,"avatar_url":"https://avatars.githubusercontent.com/u/461084?v=3","gravatar_id":"","url":"https://api.github.com/users/pocesar","html_url":"https://github.com/pocesar","followers_url":"https://api.github.com/users/pocesar/followers","following_url":"https://api.github.com/users/pocesar/following{/other_user}","gists_url":"https://api.github.com/users/pocesar/gists{/gist_id}","starred_url":"https://api.github.com/users/pocesar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocesar/subscriptions","organizations_url":"https://api.github.com/users/pocesar/orgs","repos_url":"https://api.github.com/users/pocesar/repos","events_url":"https://api.github.com/users/pocesar/events{/privacy}","received_events_url":"https://api.github.com/users/pocesar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/borisyankov/DefinitelyTyped/labels/Definition:Enhancement","name":"Definition:Enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-08-02T03:16:34Z","updated_at":"2015-04-20T03:02:56Z","closed_at":"2015-04-20T03:02:56Z","body":"Angular directive link member can be either a function (the way it's defined right now) or an object comprising of pre / post. \r\n\r\n```js\r\n       link?: (scope: IScope,\r\n            instanceElement: IAugmentedJQuery,\r\n            instanceAttributes: IAttributes,\r\n            controller: any,\r\n            transclude: ITranscludeFunction\r\n        ) => void\r\n```\r\nI just have no idea how to overload this (if that's possible at all), should be something like:\r\n\r\n```js\r\n    interface IDirectiveLinkFunction {\r\n        (scope?: IScope,\r\n            instanceElement?: IAugmentedJQuery,\r\n            instanceAttributes?: IAttributes,\r\n            controller?: any,\r\n            transclude?: ITranscludeFunction\r\n        ): void;\r\n    }\r\n\r\n    interface IDirectiveLink {\r\n        (): IDirectiveLinkFunction;\r\n        pre?: IDirectiveLinkFunction;\r\n        post?: IDirectiveLinkFunction;\r\n    }\r\n\r\n    interface IDirective{\r\n        compile?:\r\n            (templateElement: IAugmentedJQuery,\r\n            templateAttributes: IAttributes,\r\n            transclude: ITranscludeFunction\r\n            ) => any;\r\n        controller?: any;\r\n        controllerAs?: string;\r\n        link?: IDirectiveLink;\r\n        name?: string;\r\n        priority?: number;\r\n        replace?: boolean;\r\n        require?: any;\r\n        restrict?: string;\r\n        scope?: any;\r\n        template?: any;\r\n        templateUrl?: any;\r\n        terminal?: boolean;\r\n        transclude?: any;\r\n    }\r\n```\r\n\r\nHaven't managed to make a working interface for this so far, I'm pretty sure it's because of my lack of understand of Typescript (newbie here)"}}