BUG: join
return type is Promise<DailyParticipantsObject | void>
#164
Labels
bug
Something isn't working
join
return type is Promise<DailyParticipantsObject | void>
#164
Expected behavior
The Daily.co API docs state that
callObj.join
resolves with a participants (typeDailyParticipantsObject
). This appears to be consistent with the daily.js source code. That means that the return type ofjoin
should beDescribe the bug (unexpected behavior)
The actual type specified in
index.d.ts
isPromise<DailyParticipantsObject | void>
, which doesn't make sense:module.js
source doesn't ever callresolve
on any object other thanparticipants
, soDailyParticipantsObject
should be the only response type;void
is extraneous. So I believe this type is actually inconsistent with the actual behavior of the code.join
should return a participants object that is meant to be used for initializing some UI upon meeting join.void
indicates the absence of a return value, i.e. nothing is supposed to be done with the return value. To returnPromise<DailyParticipantsObject | void>
means "when this function succeeds, it will either respond with aDailyParticipantsObject
... or not, who knows?". That's not really consistent with either the behavior or the stated API design.join
function fails, it does not _resolve with avoid
value, it _rejects_, i.e. throws an exception that needs to be caught. The
Promise` type should only indicate the type returned by the success branch.The text was updated successfully, but these errors were encountered: