Skip to content

Commit

Permalink
export models from signaling client (#18105)
Browse files Browse the repository at this point in the history
* export models from signaling client
* fix lint
  • Loading branch information
LuChen-Microsoft authored Oct 8, 2021
1 parent 33eccef commit 3e3c702
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/// <reference lib="esnext.asynciterable" />

import { ChatEventId } from '@azure/communication-signaling';
import { ChatMessageDeletedEvent } from '@azure/communication-signaling';
import { ChatMessageEditedEvent } from '@azure/communication-signaling';
import { ChatMessageReceivedEvent } from '@azure/communication-signaling';
Expand Down Expand Up @@ -81,6 +82,8 @@ export interface ChatError {
readonly target?: string;
}

export { ChatEventId }

// @public
export interface ChatMessage {
content?: ChatMessageContent;
Expand All @@ -104,13 +107,19 @@ export interface ChatMessageContent {
topic?: string;
}

export { ChatMessageDeletedEvent }

export { ChatMessageEditedEvent }

// @public
export interface ChatMessageReadReceipt {
chatMessageId: string;
readOn: Date;
sender: CommunicationIdentifierKind;
}

export { ChatMessageReceivedEvent }

// @public
export type ChatMessageType = "text" | "html" | "topicUpdated" | "participantAdded" | "participantRemoved";

Expand Down Expand Up @@ -144,6 +153,10 @@ export class ChatThreadClient {
export interface ChatThreadClientOptions extends ChatClientOptions {
}

export { ChatThreadCreatedEvent }

export { ChatThreadDeletedEvent }

// @public
export interface ChatThreadItem {
deletedOn?: Date;
Expand All @@ -161,6 +174,8 @@ export interface ChatThreadProperties {
topic: string;
}

export { ChatThreadPropertiesUpdatedEvent }

// @public
export interface CreateChatThreadOptions extends OperationOptions {
idempotencyToken?: string;
Expand Down Expand Up @@ -207,6 +222,12 @@ export type ListParticipantsOptions = RestListParticipantsOptions;
// @public
export type ListReadReceiptsOptions = RestListReadReceiptsOptions;

export { ParticipantsAddedEvent }

export { ParticipantsRemovedEvent }

export { ReadReceiptReceivedEvent }

// @public
export type RemoveParticipantOptions = OperationOptions;

Expand Down Expand Up @@ -264,6 +285,8 @@ export interface SendTypingNotificationOptions extends OperationOptions {
senderDisplayName?: string;
}

export { TypingIndicatorReceivedEvent }

// @public
export interface UpdateMessageOptions extends OperationOptions {
content?: string;
Expand Down
28 changes: 14 additions & 14 deletions sdk/communication/communication-chat/src/chatClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@
import { logger } from "./models/logger";
import { EventEmitter } from "events";
import { CommunicationTokenCredential } from "@azure/communication-common";
import {
SignalingClient,
ChatEventId,
ChatMessageReceivedEvent,
ChatMessageEditedEvent,
ChatMessageDeletedEvent,
ReadReceiptReceivedEvent,
TypingIndicatorReceivedEvent,
ChatThreadCreatedEvent,
ChatThreadDeletedEvent,
ChatThreadPropertiesUpdatedEvent,
ParticipantsAddedEvent,
ParticipantsRemovedEvent
} from "@azure/communication-signaling";
import { getSignalingClient } from "./signaling/signalingClient";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { SpanStatusCode } from "@azure/core-tracing";
Expand All @@ -41,6 +27,20 @@ import { ChatApiClient } from "./generated/src";
import { CreateChatThreadRequest } from "./models/requests";
import { createCommunicationTokenCredentialPolicy } from "./credential/communicationTokenCredentialPolicy";
import { generateUuid } from "./models/uuid";
import { SignalingClient } from "@azure/communication-signaling";
import {
ChatEventId,
ChatMessageReceivedEvent,
ChatMessageEditedEvent,
ChatMessageDeletedEvent,
ReadReceiptReceivedEvent,
TypingIndicatorReceivedEvent,
ChatThreadCreatedEvent,
ChatThreadDeletedEvent,
ChatThreadPropertiesUpdatedEvent,
ParticipantsAddedEvent,
ParticipantsRemovedEvent
} from "./models/events";

/**
* The client to do chat operations
Expand Down
1 change: 1 addition & 0 deletions sdk/communication/communication-chat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
export * from "./models/options";
export * from "./models/requests";
export * from "./models/models";
export * from "./models/events";
export * from "./chatClient";
export * from "./chatThreadClient";
30 changes: 30 additions & 0 deletions sdk/communication/communication-chat/src/models/events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import {
ChatEventId,
ChatMessageReceivedEvent,
ChatMessageEditedEvent,
ChatMessageDeletedEvent,
ReadReceiptReceivedEvent,
TypingIndicatorReceivedEvent,
ChatThreadCreatedEvent,
ChatThreadDeletedEvent,
ChatThreadPropertiesUpdatedEvent,
ParticipantsAddedEvent,
ParticipantsRemovedEvent
} from "@azure/communication-signaling";

export {
ChatEventId,
ChatMessageReceivedEvent,
ChatMessageEditedEvent,
ChatMessageDeletedEvent,
ReadReceiptReceivedEvent,
TypingIndicatorReceivedEvent,
ChatThreadCreatedEvent,
ChatThreadDeletedEvent,
ChatThreadPropertiesUpdatedEvent,
ParticipantsAddedEvent,
ParticipantsRemovedEvent
};

0 comments on commit 3e3c702

Please sign in to comment.