Skip to content

Commit

Permalink
Merge branch 'main' into daily-js-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Daily Autobot committed Sep 11, 2024
2 parents f70bf96 + 27c4793 commit 42b725e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 11 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@daily-co/react-native-daily-js",
"private": true,
"//": "^ COMMENT OUT 'private: true' BEFORE RUNNING NPM PUBLISH",
"version": "0.67.0",
"version": "0.68.0",
"description": "React Native library for making video calls using Daily",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
"baseUrl": "https://github.com/daily-co/react-native-daily-js"
},
"dependencies": {
"@daily-co/daily-js": "^0.69.0",
"@daily-co/daily-js": "^0.70.0",
"@types/react-native-background-timer": "^2.0.0",
"base-64": "^1.0.0",
"react-native-url-polyfill": "^1.1.2"
Expand Down
80 changes: 80 additions & 0 deletions type-overrides/@daily-co/daily-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type DailyEvent =
| 'active-speaker-change'
| 'network-quality-change'
| 'network-connection'
| 'test-completed'
| 'cpu-load-change'
| 'error'
| 'nonfatal-error'
Expand Down Expand Up @@ -423,6 +424,56 @@ export interface DailyStartScreenShare {
| DailyScreenVideoSendSettingsPreset;
}

export type DailyQualityTestResult =
| 'good'
| 'bad'
| 'warning'
| 'aborted'
| 'failed';

export type DailyP2PCallQualityTestResults =
| DailyP2PCallQualityTestStats
| DailyCallQualityTestAborted
| DailyCallQualityTestFailure;

export interface DailyP2PCallQualityTestStats {
result: Extract<DailyQualityTestResult, 'good' | 'warning' | 'bad'>;
data: DailyP2PCallQualityTestData;
secondsElapsed: number;
}

export interface DailyP2PCallQualityTestData {
maxRoundTripTime: number | null;
avgRoundTripTime: number | null;
avgRecvPacketLoss: number | null;
avgAvailableOutgoingBitrate: number | null;
avgSendBitsPerSecond: number | null;
avgRecvBitsPerSecond: number | null;
}

export interface DailyCallQualityTestAborted {
result: Extract<DailyQualityTestResult, 'aborted'>;
secondsElapsed: number;
}

export interface DailyCallQualityTestFailure {
result: Extract<DailyQualityTestResult, 'failed'>;
errorMsg: string;
error?: DailyFatalErrorObject<DailyFatalErrorType>;
secondsElapsed: number;
}

export interface DailyWebsocketConnectivityTestResults {
result: 'passed' | 'failed' | 'warning' | 'aborted';
abortedRegions: string[];
failedRegions: string[];
passedRegions: string[];
}

export interface DailyNetworkConnectivityTestStats {
result: 'passed' | 'failed' | 'aborted';
}

export interface DailyNetworkStats {
quality: number;
stats: {
Expand Down Expand Up @@ -894,6 +945,15 @@ export interface DailyEventObjectNetworkConnectionEvent
sfu_id?: string;
}

export interface DailyEventObjectTestCompleted extends DailyEventObjectBase {
action: Extract<DailyEvent, 'test-completed'>;
test: 'p2p-call-quality' | 'network-connectivity' | 'websocket-connectivity';
results:
| DailyP2PCallQualityTestResults
| DailyNetworkConnectivityTestStats
| DailyWebsocketConnectivityTestResults;
}

export interface DailyEventObjectActiveSpeakerChange
extends DailyEventObjectBase {
action: Extract<DailyEvent, 'active-speaker-change'>;
Expand Down Expand Up @@ -1036,26 +1096,30 @@ export interface DailyEventObjectDialinWarning extends DailyEventObjectBase {
export interface DailyEventObjectDialOutConnected extends DailyEventObjectBase {
action: Extract<DailyEvent, 'dialout-connected'>;
sessionId?: string;
userId?: string;
actionTraceId?: string;
}

export interface DailyEventObjectDialOutError extends DailyEventObjectBase {
action: Extract<DailyEvent, 'dialout-error'>;
errorMsg: string;
sessionId?: string;
userId?: string;
actionTraceId?: string;
}

export interface DailyEventObjectDialOutStopped extends DailyEventObjectBase {
action: Extract<DailyEvent, 'dialout-stopped'>;
sessionId?: string;
userId?: string;
actionTraceId?: string;
}

export interface DailyEventObjectDialOutWarning extends DailyEventObjectBase {
action: Extract<DailyEvent, 'dialout-warning'>;
errorMsg: string;
sessionId?: string;
userId?: string;
actionTraceId?: string;
}

Expand Down Expand Up @@ -1120,6 +1184,8 @@ export type DailyEventObject<T extends DailyEvent = any> =
? DailyEventObjectCpuLoadEvent
: T extends DailyEventObjectNetworkConnectionEvent['action']
? DailyEventObjectNetworkConnectionEvent
: T extends DailyEventObjectTestCompleted['action']
? DailyEventObjectTestCompleted
: T extends DailyEventObjectActiveSpeakerChange['action']
? DailyEventObjectActiveSpeakerChange
: T extends DailyEventObjectReceiveSettingsUpdated['action']
Expand Down Expand Up @@ -1371,14 +1437,17 @@ export interface DailyDialOutSession {
export interface DailyStartDialoutSipOptions {
sipUri?: string;
displayName?: string;
userId?: string;
video?: boolean;
codecs?: DailyDialOutCodecs;
}

export interface DailyStartDialoutPhoneOptions {
phoneNumber?: string;
displayName?: string;
userId?: string;
codecs?: DailyDialOutCodecs;
callerId?: string;
}

export type DailyStartDialoutOptions =
Expand Down Expand Up @@ -1485,6 +1554,17 @@ export interface DailyCall {
load(properties?: DailyLoadOptions): Promise<void>;
startScreenShare(properties?: DailyStartScreenShare): void;
stopScreenShare(): void;
testPeerToPeerCallQuality(options: {
videoTrack: MediaStreamTrack;
duration?: number;
}): Promise<DailyP2PCallQualityTestResults>;
stopTestPeerToPeerCallQuality(): void;
testWebsocketConnectivity(): Promise<DailyWebsocketConnectivityTestResults>;
abortTestWebsocketConnectivity(): void;
testNetworkConnectivity(
videoTrack: MediaStreamTrack
): Promise<DailyNetworkConnectivityTestStats>;
abortTestNetworkConnectivity(): void;
getNetworkStats(): Promise<DailyNetworkStats>;
getCpuLoadStats(): Promise<DailyCpuLoadStats>;
updateSendSettings(settings: DailySendSettings): Promise<DailySendSettings>;
Expand Down

0 comments on commit 42b725e

Please sign in to comment.