Skip to content

Commit b5c0b56

Browse files
authored
fix: use isolatedModules: true in tsconfig.json (#469)
* fix: use `isolatedModules: true` in tsconfig.json This setting ensures the module can be used in projects where the workflow includes type checking and transpilation as two separate steps. See: https://ncjamieson.com/dont-export-const-enums/ Fixes: #456 Signed-off-by: Lance Ball <lball@redhat.com>
1 parent f36a1f0 commit b5c0b56

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

src/index.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,33 @@ import CONSTANTS from "./constants";
1717
export {
1818
// From event
1919
CloudEvent,
20-
CloudEventV1,
21-
CloudEventV1Attributes,
2220
Version,
2321
ValidationError,
22+
Mode,
23+
HTTP,
24+
Kafka,
25+
MQTT,
26+
MQTTMessageFactory,
27+
emitterFor,
28+
Emitter,
29+
// From Constants
30+
CONSTANTS
31+
};
32+
33+
export type {
34+
CloudEventV1,
35+
CloudEventV1Attributes,
2436
// From message
2537
Headers,
26-
Mode,
2738
Binding,
2839
Message,
2940
Deserializer,
3041
Serializer,
31-
HTTP,
32-
Kafka,
3342
KafkaEvent,
3443
KafkaMessage,
35-
MQTT,
3644
MQTTMessage,
37-
MQTTMessageFactory,
3845
// From transport
3946
TransportFunction,
4047
EmitterFunction,
41-
emitterFor,
42-
Emitter,
43-
Options,
44-
// From Constants
45-
CONSTANTS,
48+
Options
4649
};

src/message/kafka/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import { sanitize } from "../http/headers";
1010

1111
// Export the binding implementation and message interface
1212
export {
13-
Kafka,
13+
Kafka
14+
};
15+
16+
export type {
1417
KafkaMessage,
1518
KafkaEvent
1619
};

src/message/mqtt/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
import { Binding, Deserializer, CloudEvent, CloudEventV1, CONSTANTS, Message, ValidationError, Headers } from "../..";
77

88
export {
9-
MQTT,
10-
MQTTMessage,
11-
MQTTMessageFactory
9+
MQTT, MQTTMessageFactory
1210
};
11+
export type { MQTTMessage };
1312

1413
/**
1514
* Extends the base {@linkcode Message} interface to include MQTT attributes, some of which

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
1212
"outDir": "./dist",
1313
"declaration": true,
14-
"experimentalDecorators": true
14+
"experimentalDecorators": true,
15+
"isolatedModules": true,
1516
},
1617
"compileOnSave": true,
1718
"include": [

0 commit comments

Comments
 (0)