Skip to content

Commit

Permalink
Merge pull request #8074 from daily-co/csdk-943-fix-new-dailyeventobj…
Browse files Browse the repository at this point in the history
…ectfatalerror-types

Csdk 943 fix new dailyeventobjectfatalerror types
  • Loading branch information
mattieruth authored Apr 7, 2023
2 parents 0231f0f + d07460e commit 007997b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions type-overrides/@daily-co/daily-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,17 +494,17 @@ export type DailyCameraError = {
export interface DailyCamPermissionsError extends DailyCameraError {
type: Extract<DailyCameraErrorType, 'permissions'>;
blockedBy: 'user' | 'browser';
blockedMedia: Set<'video' | 'audio'>;
blockedMedia: Array<'video' | 'audio'>;
}

export interface DailyCamDeviceNotFoundError extends DailyCameraError {
type: Extract<DailyCameraErrorType, 'not-found'>;
missingMedia: Set<'video' | 'audio'>;
missingMedia: Array<'video' | 'audio'>;
}

export interface DailyCamConstraintsError extends DailyCameraError {
type: Extract<DailyCameraErrorType, 'constraints'>;
reason: Set<'invalid' | 'none-specified'>;
reason: 'invalid' | 'none-specified';
}

export interface DailyCamInUseError extends DailyCameraError {
Expand All @@ -522,7 +522,7 @@ export interface DailyCamUnknownError extends DailyCameraError {
type: Extract<DailyCameraErrorType, 'unknown'>;
}

export type DailyCameraErrorObject<T extends DailyCameraError = any> =
export type DailyCameraErrorObject<T extends DailyCameraErrorType> =
T extends DailyCamPermissionsError['type']
? DailyCamPermissionsError
: T extends DailyCamDeviceNotFoundError['type']
Expand All @@ -544,7 +544,7 @@ export interface DailyEventObjectCameraError {
audioOk?: boolean;
videoOk?: boolean;
};
error: DailyCameraErrorObject;
error: DailyCameraErrorObject<DailyCameraErrorType>;
}

export type DailyFatalError = {
Expand All @@ -553,21 +553,21 @@ export type DailyFatalError = {
};

export interface DailyFatalConnectionError extends DailyFatalError {
type: Extract<DailyFatalConnectionError, 'connection-error'>;
type: Extract<DailyFatalErrorType, 'connection-error'>;
details: {
on: 'join' | 'reconnect';
sourceError: Error;
uri?: string;
};
}

export type DailyFatalErrorObject<T extends DailyFatalError = any> =
export type DailyFatalErrorObject<T extends DailyFatalErrorType> =
T extends DailyFatalConnectionError['type'] ? DailyFatalConnectionError : any;

export interface DailyEventObjectFatalError {
action: Extract<DailyEvent, 'error'>;
errorMsg: string;
error?: DailyFatalErrorObject;
error?: DailyFatalErrorObject<DailyFatalErrorType>;
}

export interface DailyEventObjectNonFatalError {
Expand Down

0 comments on commit 007997b

Please sign in to comment.