Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions packages/core/src/components/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ function isIgnorableChatMessage(msg: ReceivedChatMessage | LegacyReceivedChatMes

const decodeLegacyMsg = (message: Uint8Array) =>
JSON.parse(new TextDecoder().decode(message)) as
| LegacyReceivedChatMessage
| Exclude<ReceivedChatMessage, 'type'>;
LegacyReceivedChatMessage | Exclude<ReceivedChatMessage, 'type'>;

const encodeLegacyMsg = (message: LegacyChatMessage) =>
new TextEncoder().encode(JSON.stringify(message));
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/messages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,5 @@ export type ReceivedAgentTranscriptionMessage = ReceivedMessageWithType<

/** @beta */
export type ReceivedMessage =
| ReceivedUserTranscriptionMessage
| ReceivedAgentTranscriptionMessage
| ReceivedChatMessage;
ReceivedUserTranscriptionMessage | ReceivedAgentTranscriptionMessage | ReceivedChatMessage;
// TODO: images? attachments? rpc?
3 changes: 1 addition & 2 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export type ParticipantIdentifier = RequireAtLeastOne<
* @internal
*/
export type TrackIdentifier<T extends Track.Source = Track.Source> =
| TrackSource<T>
| TrackReference;
TrackSource<T> | TrackReference;

// ## Util Types
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
Expand Down
2 changes: 1 addition & 1 deletion packages/react/etc/components-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ export function useEnsureSession(session?: UseSessionReturn): UseSessionReturn;
export function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): TrackReferenceOrPlaceholder;

// @public (undocumented)
export function useEvents<Emitter extends default_2<EventMap>, EmitterEventMap extends Emitter extends default_2<infer EM> ? EM : never, Event extends Parameters<Emitter['on']>[0], Callback extends EmitterEventMap[Event]>(instance: Emitter | {
export function useEvents<Emitter extends default_2<EventMap>, EmitterEventMap extends (Emitter extends default_2<infer EM> ? EM : never), Event extends Parameters<Emitter['on']>[0], Callback extends EmitterEventMap[Event]>(instance: Emitter | {
internal: {
emitter: Emitter;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export function PaginationControl({
const [interactive, setInteractive] = React.useState(false);
React.useEffect(() => {
let subscription:
| ReturnType<ReturnType<typeof createInteractingObservable>['subscribe']>
| undefined;
ReturnType<ReturnType<typeof createInteractingObservable>['subscribe']> | undefined;
if (connectedElement) {
subscription = createInteractingObservable(connectedElement.current, 2000).subscribe(
setInteractive,
Expand Down
6 changes: 1 addition & 5 deletions packages/react/src/hooks/useAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ type AgentSdkStates = 'initializing' | 'idle' | 'listening' | 'thinking' | 'spea
* @beta
* */
export type AgentState =
| 'disconnected'
| 'connecting'
| 'pre-connect-buffering'
| 'failed'
| AgentSdkStates;
'disconnected' | 'connecting' | 'pre-connect-buffering' | 'failed' | AgentSdkStates;

/** @beta */
export enum AgentEvent {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TypedEventEmitter, { EventMap } from 'typed-emitter';
/** @public */
export function useEvents<
Emitter extends TypedEventEmitter<EventMap>,
EmitterEventMap extends Emitter extends TypedEventEmitter<infer EM> ? EM : never,
EmitterEventMap extends (Emitter extends TypedEventEmitter<infer EM> ? EM : never),
Event extends Parameters<Emitter['on']>[0],
Callback extends EmitterEventMap[Event],
>(
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/hooks/useParticipantTracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ type UseParticipantTracksOptions = {
export function useParticipantTracks<TrackSource extends Track.Source>(
sources: Array<TrackSource>,
optionsOrParticipantIdentity:
| UseParticipantTracksOptions
| UseParticipantTracksOptions['participantIdentity'] = {},
UseParticipantTracksOptions | UseParticipantTracksOptions['participantIdentity'] = {},
): Array<TrackReference> {
let participantIdentity: UseParticipantTracksOptions['participantIdentity'];
let room: UseParticipantTracksOptions['room'];
Expand Down
16 changes: 4 additions & 12 deletions packages/react/src/hooks/useSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ type SessionStateConnecting = SessionStateCommon & {

type SessionStateConnected = SessionStateCommon & {
connectionState:
| ConnectionState.Connected
| ConnectionState.Reconnecting
| ConnectionState.SignalReconnecting;
ConnectionState.Connected | ConnectionState.Reconnecting | ConnectionState.SignalReconnecting;
isConnected: true;

local: {
Expand Down Expand Up @@ -151,9 +149,7 @@ type SessionActions = {

/** @beta */
export type UseSessionReturn = (
| SessionStateConnecting
| SessionStateConnected
| SessionStateDisconnected
SessionStateConnecting | SessionStateConnected | SessionStateDisconnected
) &
SessionActions;

Expand Down Expand Up @@ -580,9 +576,7 @@ export function useSession(
);

const conversationState = React.useMemo(():
| SessionStateConnecting
| SessionStateConnected
| SessionStateDisconnected => {
SessionStateConnecting | SessionStateConnected | SessionStateDisconnected => {
const common: SessionStateCommon = {
room,
internal: sessionInternal,
Expand Down Expand Up @@ -775,9 +769,7 @@ export function useSession(
console.warn('WARNING: Room.prepareConnection failed:', err);
});
},
[
/* note: no prepareConnection here, this effect should only ever run once! */
],
[/* note: no prepareConnection here, this effect should only ever run once! */],
);

return React.useMemo(
Expand Down
3 changes: 1 addition & 2 deletions tooling/api-documenter/src/markdown/MarkdownEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ export class MarkdownEmitter {
case DocNodeKind.HtmlStartTag:
case DocNodeKind.HtmlEndTag: {
const docHtmlTag: DocHtmlStartTag | DocHtmlEndTag = docNode as
| DocHtmlStartTag
| DocHtmlEndTag;
DocHtmlStartTag | DocHtmlEndTag;
// write the HTML element verbatim into the output
writer.write(docHtmlTag.emitAsHtml());
break;
Expand Down
5 changes: 3 additions & 2 deletions tooling/api-documenter/src/plugin/PluginLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export class PluginLoader {

// Load the package
const entryPoint:
| { apiDocumenterPluginManifest?: IApiDocumenterPluginManifest }
| undefined = require(resolvedEntryPointPath);
{ apiDocumenterPluginManifest?: IApiDocumenterPluginManifest } | undefined = require(
resolvedEntryPointPath,
);

if (!entryPoint) {
throw new Error('Invalid entry point');
Expand Down
Loading