Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make local optional in typescript definitions #196

Open
wants to merge 1 commit into
base: daily-js-releases
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export type DailyNonFatalErrorType =
export type DailyNetworkTopology = 'sfu' | 'peer';

export interface DailyParticipantsObject {
local: DailyParticipant;
local?: DailyParticipant;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll let @kompfner weigh in here, but I think maybe the more accurate thing to do would be to change the return of participants()(line 1105) to return DailyParticipantsObject || {}. The only time local can be undefined is before preAuth/startCamera/join or after leave (basically.. not in a call) and in this case, participants() will return {}. The other uses of DailyParticipantsObject come at times when you are in a call and should be guaranteed to have a local participant. With the change I'm proposing, we can keep this guarantee.

[id: string]: DailyParticipant;
}

Expand Down