Skip to content

Conversation

@lforst
Copy link
Contributor

@lforst lforst commented Apr 7, 2022

Fixes #4878 which got introduced in #4863

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @inheritDoc
*/
private readonly _levels: typeof CONSOLE_LEVELS = CONSOLE_LEVELS;
private readonly _levels: readonly string[] = CONSOLE_LEVELS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private readonly _levels: readonly string[] = CONSOLE_LEVELS;
private readonly _levels: typeof CONSOLE_LEVELS[number] = CONSOLE_LEVELS;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about that one too but that would still break the API. It was string[] before and doing typeof CONSOLE_LEVELS[number] is stricter than that. We could do that in the major bump however.

* @inheritDoc
*/
public constructor(options: { levels?: typeof CONSOLE_LEVELS } = {}) {
public constructor(options: { levels?: string[] } = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public constructor(options: { levels?: string[] } = {}) {
public constructor(options: { levels?: typeof CONSOLE_LEVELS[number] } = {}) {

@lforst lforst enabled auto-merge (squash) April 7, 2022 10:42
@lforst lforst merged commit 5431937 into master Apr 7, 2022
@lforst lforst deleted the lforst-fix-typing-api-captureconsole branch April 7, 2022 10:49
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.

Broken types on Console integration levels option

3 participants