[
https://issues.apache.org/jira/browse/THRIFT-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093921#comment-16093921
]
Jens Geyer commented on THRIFT-4257:
------------------------------------
GitHub user mikemorton opened a pull request:
https://github.com/apache/thrift/pull/1310
Better types for callbacks when using typescript This adds more
specific types to the async callback for client-side calls in the thrift
generated .d.ts files.You can merge this pull request into a Git
repository by running: $ git pull https://github.com/mikemorton/thrift
patch-1Alternatively you can review and apply these changes as the patch
at: https://github.com/apache/thrift/pull/1310.patchTo
close this pull request, make a commit to your master/trunk branchwith (at
least) the following in the commit message: This closes #1310
----commit 4d8fb6fe60feade7cbb37abd6ef3593515d9d69fAuthor: Mike
Morton <[email protected]>Date:
2017-07-19T13:23:43Z Better types for callbacks when using
typescript This adds more specific types to the async callback
for client-side calls in the thrift generated .d.ts
files.-------If your project is set up for it, you can
reply to this email and have yourreply appear on GitHub as well. If your
project does not have this featureenabled and wishes so, or if the feature
is enabled but not working, pleasecontact infrastructure at
[email protected] or file a
JIRA ticketwith INFRA.---
> Typescript async callbacks do not provide the correct types
> -----------------------------------------------------------
>
> Key: THRIFT-4257
> URL: https://issues.apache.org/jira/browse/THRIFT-4257
> Project: Thrift
> Issue Type: Bug
> Components: JavaScript - Compiler, TypeScript - Library
> Reporter: Mike Morton
>
> The aysnc callbacks provided for typescript do not provide complete
> information for the objects being returned. Example:
> {code}
> GetOwnInfo(): UserInfo;
> GetOwnInfo(callback: Function): JQueryXHR;
> {code}
> Both the Function and JQueryXHR do not provide type information about
> UserInfo.
> The proposed fix is to have it generate the following:
> {code}
> GetOwnInfo(): UserInfo;
> GetOwnInfo(callback: (data: UserInfo)=>void): JQueryPromise<UserInfo>;
> {code}
> I have submitted a pull request here:
> https://github.com/apache/thrift/pull/1310
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)