Skip to content

Commit

Permalink
regenerate types
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Aug 6, 2023
1 parent ca744f6 commit 1de0ad6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
5 changes: 5 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export function Middleware(mwOpts: import("./src").MiddlewareOptions): {
started(): Promise<void>;
stopped(): Promise<void>;
};
export const Tracing: () => {
name: string;
created(_broker: any): void;
localChannel: (handler: any, chan: any) => any;
};
export const Adapters: {
Base: typeof import("./src/adapters/base");
AMQP: typeof import("./src/adapters/amqp");
Expand Down
23 changes: 22 additions & 1 deletion types/src/adapters/amqp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export = AmqpAdapter;
* @property {Object} amqp.exchangeOptions AMQP lib exchange configuration
* @property {Object} amqp.messageOptions AMQP lib message configuration
* @property {Object} amqp.consumerOptions AMQP lib consume configuration
* @property {publishAssertExchange} amqp.publishAssertExchange AMQP lib exchange configuration for one-time calling assertExchange() before publishing in new exchange by sendToChannel
*/
/**
* @typedef {Object} publishAssertExchange
* @property {Boolean} enabled Enable/disable one-time calling channel.assertExchange() before publishing in new exchange by sendToChannel
* @property {Object} exchangeOptions AMQP lib exchange configuration https://amqp-node.github.io/amqplib/channel_api.html#channel_assertExchange
*/
/**
* @typedef {Object} SubscriptionEntry
Expand Down Expand Up @@ -47,6 +53,10 @@ declare class AmqpAdapter extends BaseAdapter {
stopping: boolean;
connectAttempt: number;
connectionCount: number;
/**
* @type {Set<string>}
*/
assertedExchanges: Set<string>;
/**
* Connect to the adapter with reconnecting logic
*/
Expand Down Expand Up @@ -96,7 +106,7 @@ declare class AmqpAdapter extends BaseAdapter {
publish(channelName: string, payload: any, opts?: any | null): Promise<void>;
}
declare namespace AmqpAdapter {
export { AMQPLibConnection, AMQPLibChannel, ServiceBroker, Logger, Channel, BaseDefaultOptions, AmqpDefaultOptions, SubscriptionEntry };
export { AMQPLibConnection, AMQPLibChannel, ServiceBroker, Logger, Channel, BaseDefaultOptions, AmqpDefaultOptions, publishAssertExchange, SubscriptionEntry };
}
import BaseAdapter = require("./base");
/**
Expand All @@ -117,6 +127,7 @@ type AmqpDefaultOptions = {
exchangeOptions: any;
messageOptions: any;
consumerOptions: any;
publishAssertExchange: publishAssertExchange;
};
};
/**
Expand Down Expand Up @@ -153,3 +164,13 @@ type ServiceBroker = import("moleculer").ServiceBroker;
* Logger instance
*/
type Logger = import("moleculer").LoggerInstance;
type publishAssertExchange = {
/**
* Enable/disable one-time calling channel.assertExchange() before publishing in new exchange by sendToChannel
*/
enabled: boolean;
/**
* AMQP lib exchange configuration https://amqp-node.github.io/amqplib/channel_api.html#channel_assertExchange
*/
exchangeOptions: any;
};
32 changes: 15 additions & 17 deletions types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export type DeadLetteringOptions = {
* Name of the dead-letter exchange (only for AMQP adapter)
*/
exchangeName: string;
/**
* Options for the dead-letter exchange (only for AMQP adapter)
*/
exchangeOptions: any;
/**
* Options for the dead-letter queue (only for AMQP adapter)
*/
queueOptions: any;
};
/**
* Base consumer configuration
Expand Down Expand Up @@ -142,33 +150,23 @@ export type MiddlewareOptions = {
*/
adapter: string | AdapterConfig;
/**
* Property name of channels definition in service schema
*
* @default "channels"
* Property name of channels definition in service schema.
*/
schemaProperty?: string;
schemaProperty: string | null;
/**
* Method name to send messages. Default is "sendToChannel"
*
* @default "sendToChannel"
* Method name to send messages.
*/
sendMethodName?: string;
sendMethodName: string | null;
/**
* Property name of the adapter instance in broker instance.
*
* @default "channelAdapter"
*/
adapterPropertyName?: string;
adapterPropertyName: string | null;
/**
* Method name to add to service in order to trigger channel handlers.
*
* @default "emitLocalChannelHandler"
*/
channelHandlerTrigger?: string;
channelHandlerTrigger: string | null;
/**
* Using Moleculer context in channel handlers by default.
*
* @default false
*/
context?: boolean;
context: boolean | null;
};
6 changes: 6 additions & 0 deletions types/src/tracing.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare function _exports(): {
name: string;
created(_broker: any): void;
localChannel: (handler: any, chan: any) => any;
};
export = _exports;

0 comments on commit 1de0ad6

Please sign in to comment.