Skip to content

Commit

Permalink
Merge pull request #72 from lucduong/patch-types-update-middleware-op…
Browse files Browse the repository at this point in the history
…tions

chore(types): update MiddlewareOptions
  • Loading branch information
icebob authored Aug 6, 2023
2 parents bef6573 + 3f98d6f commit 8f74929
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ const C = require("./constants");
/**
* @typedef {Object} MiddlewareOptions Middleware options
* @property {String|AdapterConfig} adapter Adapter name or connection string or configuration object.
* @property {String} schemaProperty Property name of channels definition in service schema.
* @property {String} sendMethodName Method name to send messages.
* @property {String} adapterPropertyName Property name of the adapter instance in broker instance.
* @property {String} channelHandlerTrigger Method name to add to service in order to trigger channel handlers.
* @property {boolean} context Using Moleculer context in channel handlers by default.
* @property {String?} schemaProperty Property name of channels definition in service schema.
* @property {String?} sendMethodName Method name to send messages.
* @property {String?} adapterPropertyName Property name of the adapter instance in broker instance.
* @property {String?} channelHandlerTrigger Method name to add to service in order to trigger channel handlers.
* @property {boolean?} context Using Moleculer context in channel handlers by default.
*/

/**
Expand Down
24 changes: 17 additions & 7 deletions types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,33 @@ export type MiddlewareOptions = {
*/
adapter: string | AdapterConfig;
/**
* Property name of channels definition in service schema.
* Property name of channels definition in service schema
*
* @default "channels"
*/
schemaProperty: string;
schemaProperty?: string;
/**
* Method name to send messages.
* Method name to send messages. Default is "sendToChannel"
*
* @default "sendToChannel"
*/
sendMethodName: string;
sendMethodName?: string;
/**
* Property name of the adapter instance in broker instance.
*
* @default "channelAdapter"
*/
adapterPropertyName: string;
adapterPropertyName?: string;
/**
* Method name to add to service in order to trigger channel handlers.
*
* @default "emitLocalChannelHandler"
*/
channelHandlerTrigger: string;
channelHandlerTrigger?: string;
/**
* Using Moleculer context in channel handlers by default.
*
* @default false
*/
context: boolean;
context?: boolean;
};

0 comments on commit 8f74929

Please sign in to comment.