Closed kit-field-wk closed 2 weeks ago
Thanks for connecting, please refer to the release notes for 2.0 update https://github.com/amazon-connect/amazon-connect-chatjs/releases/tag/2.0.0
We are not generating index.d.ts
file instead of manually managing the typescript definitions.
You can refer to the ChatSessionObject using below code:
import "amazon-connect-streams";
import "amazon-connect-chatjs";
import { ChatSession } from "amazon-connect-chatjs";
....
const controller = await connection.getMediaController() as ReturnType<typeof ChatSession.create>;
controller.onConnectionEstablished((event) => {
console.log(
`chat websocket connection established (contactId: ${event.chatDetails.contactId})`
);
});
I have some software that depends on "amazon-connect-chatjs": "^1.5.1"
This is dependency is getting old and we intend to upgrade to use a later version such as 2.2.4
However when I try to upgrade I get build-time typescript errors, about 40 of them.
We see that the amazon-connect-chatjs project is written in js (not in ts) so the auto generated types do not include the ones we rely on. Could type definitions be provided again?
The following code typechecks correctly with 1.5.1 but not with 2.2.4 and , as far as I can see, 2.2.4 does not include these types or equivalent one for us to use.
The following amazon-connect-chatjs commit deleted the src/index.d.ts file. This 600 line file included the type definitions that we still use.
Commit: 747ce9f2b22960403abb9a87098d786654d6f9fd By: Spencer Lepine, 11 months ago (May 10th, 2023 7:52 PM) Message: typescript support: auto-generate index.d.ts file (#162)