Satellite-im / warp-wasm

Web Assembly TypeScript library for interfacing with Warp.
0 stars 0 forks source link

chore: typed returns for MultiPassBox.get_identity(...) in typescript #9

Open ashneverdawn opened 4 months ago

ashneverdawn commented 4 months ago

When MultiPassBox.get_identity(...) is exported to typescript, the return type is Promise<any> We want any to be typed. (In rust it's a Vec<Identity>).

Furthermore, consider splitting .get_identity(...) into separate functions for it's variants (DID, DIDList, Username) so that DID and Username variants can return just an Identity instead of a Vec<Identity> with a single element.

dariusc93 commented 4 months ago

Given that MultiPass::get_identity is now returns a stream, we could probably convert the exported function to return an asynciter for the stream side (by default) and have a separate function for a single identity. See https://github.com/Satellite-im/Warp/pull/554