Skip to content

Commit f7773e7

Browse files
authored
[@xmpp/client-core] Fix types for bind2 module (DefinitelyTyped#74321)
1 parent 7efea7e commit f7773e7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

types/xmpp__client-core/src/bind2/bind2.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { Entity } from "@xmpp/connection";
1+
import Connection from "@xmpp/connection";
22
import { SASL2 } from "@xmpp/sasl2";
33
import { Element } from "@xmpp/xml";
44

55
export default function bind2(
66
params: {
77
sasl2: SASL2;
8-
entity: Entity;
8+
entity: Connection;
99
},
10-
tag: string | (() => Promise<string>),
10+
tag: undefined | string | (() => Promise<string>),
1111
): Bind2;
1212

1313
export interface Bind2 {

types/xmpp__client-core/xmpp__client-core-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Client, jid, xml } from "@xmpp/client-core";
2+
import _bind2 from "@xmpp/client-core/src/bind2/bind2.js";
23
import Connection from "@xmpp/connection";
4+
import { SASL2 } from "@xmpp/sasl2";
35
import { Element } from "@xmpp/xml";
46

57
// test type exports
@@ -29,3 +31,5 @@ client.socketParameters("foo", "bar", 1); // $ExpectType unknown
2931

3032
xml("foo");
3133
jid("foo@bar.baz");
34+
35+
_bind2({} as { sasl2: SASL2; entity: Client }, {} as (string | undefined | (() => Promise<string>)));

0 commit comments

Comments
 (0)