flickr / flickr-sdk

Almost certainly the best Flickr API client in the world for node and the browser
https://www.flickr.com/services/api
MIT License
131 stars 29 forks source link

Add generated typescript definitions as part of build #141

Closed seleb closed 1 year ago

seleb commented 3 years ago

Adds a new script build-types, which generates typescript definitions for the client class (using a similar pattern to build-rest).

Note: this is not comprehensive. Response types are only partially defined (they aren't in the existing json schema), and the plugins are not defined, but this still greatly improves the explorability and autocomplete of the API in a TS environment.

seleb commented 3 years ago

looks like the CI is failing, but only on node < 8, and it looks like master is red as well; is the legacy node support required?

ebisbe commented 2 years ago

The other day I was thinking that it would be a great improvement

ebisbe commented 1 year ago

@jeremyruppel is there any reason to having here doing nothing instead of shipping it?

After building it I see 2 missing parts:


// not comprehensive
type FlickrResponse = Promise<{
    body: any;
    ok: boolean;
}>;

and

// TODO: define static classes
    OAuth: any;
    Feeds: any;
    Upload: any;
    Replace: any;
jeremyruppel commented 1 year ago

@ebisbe thanks for the nudge, I'm ready to get this shipped. I'll fix those TODOs in main.

ebisbe commented 1 year ago

I did nothing. It's all thanks to @seleb !!

jeremyruppel commented 1 year ago

Yes of course! Amazing work @seleb!