You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2017/07/19 22:50:00 UTC

[jira] [Comment Edited] (THRIFT-4257) Typescript async callbacks do not provide the correct types

    [ https://issues.apache.org/jira/browse/THRIFT-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16093921#comment-16093921 ] 

Jens Geyer edited comment on THRIFT-4257 at 7/19/17 10:49 PM:
--------------------------------------------------------------

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-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/1310.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1310
    
----
commit 4d8fb6fe60feade7cbb37abd6ef3593515d9d69f
Author: Mike Morton <mi...@gmail.com>
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 your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---



was (Author: jensg):
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 <mi...@gmail.com>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 infrastructure@apache.org 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)