Skip to content

Commit 4fae407

Browse files
authored
🤖 Merge PR DefinitelyTyped#72025 Add types for @elliemae/em-ssf-guest by @dex2dot0
1 parent 3d2045c commit 4fae407

File tree

5 files changed

+452
-0
lines changed

5 files changed

+452
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!**/*.d.ts
3+
!**/*.d.cts
4+
!**/*.d.mts
5+
!**/*.d.*.ts
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import emssf from "@elliemae/em-ssf-guest";
2+
3+
// Basic usage
4+
// $ExpectType void
5+
emssf.connect();
6+
7+
// @ts-expect-error
8+
emssf.getObject(12345); // Should fail, because the objectId must be a string
9+
10+
// You can await or then() since methods return Promises
11+
(async function testGetObject() {
12+
const loanObj = await emssf.getObject("loan");
13+
loanObj.all().then(loanData => {
14+
loanData; // $ExpectType any
15+
});
16+
})();
17+
18+
// Checking typed parameters
19+
(async function testHttp() {
20+
const http = await emssf.getObject("http");
21+
const resp = await http.get("https://example.com"); // $ExpectType Promise<any>
22+
})();
23+
24+
// Check event usage
25+
const token = emssf.subscribe("loan", "open", eventData => {
26+
eventData; // $ExpectType any
27+
});
28+
emssf.unsubscribe("loan", "open", token); // $ExpectType void

0 commit comments

Comments
 (0)