Open lgarron opened 5 years ago
In case it's of any consequence, we just published https://github.com/github/webauthn-json without Flow typings. I'm working on adding Flow types to it, but they will probably have stubs with a lot of any
unless we can reference correct credential management definitions built into Flow.
959a5292e8cee5f78f04d515f352ab176ddd37f0 added partial definitions for the credential management API at https://github.com/facebook/flow/blob/d294e2d82e44e2f306f282d1bbf43254ce8530ac/lib/bom.js#L1452-L1477
Unfortunately, these are hard to use for real-world
webauthn
code. I had been using the following local definitions, specifically tuned forPublicKeyCredential
use:However, it's difficult to cast from the Flow definitions to the ones needed for
webauthn
without going throughany
, which our project's linter doesn't accept.TypeScript has a fairly complete definition at https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webappsec-credential-management/index.d.ts (which is where I adapted my local defs from). I was considering contributing an adapted version to Flow, but 1) The TypeScript definition modifies
fetch
, which I didn't know how to adapt to Flow. 2) I was worried that a partial/partially battle-tested contribution would be missing details, and break someone else's use case.Unfortunately, it looks like I find myself in that "someone else" category.
Would there be any concerns about adapting the TypeScript definitions wholesale, and/or is there someone who would be willing to help out or answer questions for how to do it?