node-facebook / facebook-node-sdk

Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add flow types and consider TypeScript bindings

dantman opened this issue · comments

It would be nice to clean up the code a bit and add type bindings.

The plan is to use Flow types for the code itself. We will also export types for other flow users to use.

We will not write the code in TypeScript, but we may consider making TypeScript bindings available.

The question about TypeScript at the moment is primarily where to put them.

The official documentation recommends that packages not written in TypeScript publish types with DefinitelyTyped.

However I find that a lot of widely used libraries not written in .ts still distribute .flow and typescript definitions alongside their code.

However given that currently both @types/fb and @types/facebook-js-sdk both exist and both are for Facebook's client-side JavaScript SDK. It might be simpler to

Except types are going to get messy should we implement #152 and effectively wrap the types of the entire SDK that Facebook provides.

The goal is to use Flow internally support both Flow and TypeScript consumers. So #63 and #46 which only suggest TypeScript definitions and are out of date are obsolete discussions.