Skip to content

Add enableReconnect to Options type definition - #180

Open
cpruijsen wants to merge 1 commit into
fluent:masterfrom
cpruijsen:fix/issue-159
Open

cpruijsen wants to merge 1 commit into
fluent:masterfrom
cpruijsen:fix/issue-159

Conversation

@cpruijsen

Copy link
Copy Markdown

Add enableReconnect?: boolean to the shared Options interface in lib/index.d.ts. The runtime flag has been a FluentSender option since #111, and the winston transport already passes constructor options through to that sender, but a config typed as Options could not include the flag (issue #159: "There is no such option, or types are outdated").

The README documents that the winston transport accepts the same options as createFluentSender, including enableReconnect, and lists the flag in the Options catalog next to reconnectInterval.

The other option is to restore a typed winston transport constructor that takes Options. winston support is typed as any on purpose so TypeScript users are not forced to depend on winston-transport (#163). Options is already the config type for createFluentSender / configure. Can switch to a typed constructor.

Test plan

  • npx mocha -t 10000 test/test.winston.js
  • Types assertion fails if enableReconnect is removed from Options, passes with it present
  • Winston transport with enableReconnect: false does not install the reconnect error handler

Winston transport already forwards sender options at runtime, but
Options omitted enableReconnect so TypeScript users could not pass it.

Fix fluent#159


Signed-off-by: Christopher Pruijsen <christopher.pruijsen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant