Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): module exports for TypeScript for ES6 compliance. #918

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions aedes.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import Aedes, { AedesOptions } from './types/instance'

export declare function createBroker (options?: AedesOptions): Aedes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you removed this?

export declare function createBroker(options?: AedesOptions): Aedes;

export * from './types/instance'
export * from './types/packet'
export * from './types/client'
export default Aedes
export * from './types/instance';

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, ubuntu-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, windows-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, macOS-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, windows-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, macOS-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, windows-latest)

Extra semicolon

Check failure on line 5 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, macOS-latest)

Extra semicolon
export * from './types/packet';

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, ubuntu-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, windows-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, macOS-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, windows-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, macOS-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, windows-latest)

Extra semicolon

Check failure on line 6 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, macOS-latest)

Extra semicolon
export * from './types/client';

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, ubuntu-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, windows-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, macOS-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, windows-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, macOS-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, windows-latest)

Extra semicolon

Check failure on line 7 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, macOS-latest)

Extra semicolon

declare module 'aedes' {
export = Aedes
}
export { default } from './types/instance';

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, ubuntu-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, windows-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (16, macOS-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, windows-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (18, macOS-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, windows-latest)

Extra semicolon

Check failure on line 9 in aedes.d.ts

View workflow job for this annotation

GitHub Actions / test (20, macOS-latest)

Extra semicolon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is correct

5 changes: 4 additions & 1 deletion test/types/aedes.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import type {
Client,
Connection
} from '../../aedes'
import Aedes, { createBroker } from '../../aedes'
import Aedes, { AedesOptions, createBroker } from '../../aedes'
import type { AedesPublishPacket, ConnackPacket, ConnectPacket, PingreqPacket, PublishPacket, PubrelPacket, Subscription, SubscribePacket, UnsubscribePacket } from '../../types/packet'
import { expectType } from 'tsd'

// Test for createBroker function
expectType<(options?: AedesOptions) => Aedes>(createBroker)

// Aedes server
let broker = createBroker()
expectType<Aedes>(broker)
Expand Down
Loading