Skip to content

Commit 1a510a4

Browse files
committed
fix(types): export default
This is needed for backwards compatibility with the JS module.
1 parent d4f0fe6 commit 1a510a4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ milkbot.start()
3131
### TypeScript
3232

3333
```typescript
34-
import { WickrBot, WickrMessage } from 'wickrbot';
34+
import WickrBot, { WickrAPI, WickrMessage } from 'wickrbot';
3535
// You'll need to import the wickrio_addon separately
3636
import * as wickr from 'wickrio_addon';
3737

3838
class MilkBot extends WickrBot {
39-
constructor(wickr: any, username?: string) {
39+
constructor(wickr: WickrAPI, username?: string) {
4040
super(wickr, username);
4141
// This will create a new command for /order
4242
this.listen('order', (msg: WickrMessage, args?: string[]) => {

types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { WickrAPI } from './api';
88
import { MESSAGE_TYPE } from './constants';
99
import { Message } from './message';
1010

11+
// Export WickrBot as the default export
12+
export default WickrBot;
13+
14+
// Keep named exports for backward compatibility and additional types
1115
export {
1216
// Bot exports
1317
WickrBot,

0 commit comments

Comments
 (0)