Skip to content

Commit

Permalink
TELESTION-450: Re-export NATS for convenience (#415)
Browse files Browse the repository at this point in the history
Exposes various NATS types directly from the `@wuespace/telestion` package itself for convenience.

Most things are exported under the `nats` namespace, while selected variables and/or types are even exposed in the global package's scope.
  • Loading branch information
pklaschka authored Jan 17, 2024
2 parents 26a60de + 6d6c844 commit df8dd49
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend-react/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export * as auth from './auth';
export * as userData from './user-data';
export * as widget from './widget';
export * as utils from './utils.ts';
export * as nats from './nats';

// application
export { initTelestion, useWidgetConfig } from './application';
Expand All @@ -41,3 +42,6 @@ export type { UserData } from './user-data';

// auth
export { useNats } from './auth';

// nats
export { JSONCodec } from './nats';
16 changes: 16 additions & 0 deletions frontend-react/src/lib/nats/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// re-export NATS utils (for convenience)
export { JSONCodec, StringCodec, headers } from 'nats.ws';
export type {
NatsError,
NatsConnection,
Codec,
Msg,
MsgHdrs,
Sub,
SubOpts,
Subscription,
SubscriptionOptions,
MsgRequest,
RequestOptions,
PublishOptions
} from 'nats.ws';

0 comments on commit df8dd49

Please sign in to comment.