Skip to content

fix(typing): Fix typing API in CaptureConsle - #4879

Merged
lforst merged 1 commit into
masterfrom
lforst-fix-typing-api-captureconsole
Apr 7, 2022
Merged

fix(typing): Fix typing API in CaptureConsle#4879
lforst merged 1 commit into
masterfrom
lforst-fix-typing-api-captureconsole

Conversation

@lforst

Copy link
Copy Markdown
Contributor

Fixes#4878 which got introduced in #4863

@kamilogorekkamilogorek left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
privatereadonly _levels: readonlystring[]=CONSOLE_LEVELS;
privatereadonly _levels: typeofCONSOLE_LEVELS[number]=CONSOLE_LEVELS;

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
publicconstructor(options: {levels?: string[]}={}){
publicconstructor(options: {levels?: typeofCONSOLE_LEVELS[number]}={}){

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

2 participants

@lforst@kamilogorek