Skip to content

LogService - fix typings #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions generatedTypes/services/LogService.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
declare function warn(message: string): void;
declare function deprecationWarn({ component, oldProp, newProp }?: ({
component?: string;
oldProp?: string;
newProp?: string;
declare function deprecationWarn({ component, oldProp, newProp }: ({
component: string;
oldProp: string;
newProp: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

'newProp' parameter should stay optional as we sometimes deprecate a prop with no replacement. Which means we also need to edit the massage accordingly...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added an option

})): void;
declare const _default: {
warn: typeof warn;
Expand Down
2 changes: 1 addition & 1 deletion src/services/LogService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function warn(message: string) {
}
}

function deprecationWarn({component, oldProp, newProp}: ({component?: string, oldProp?: string, newProp?: string}) = {}) {
function deprecationWarn({component, oldProp, newProp}: ({component: string, oldProp: string, newProp: string})) {
const message = `uilib's ${component} "${oldProp}" prop will be deprecated soon, please use the "${newProp}" prop instead`;
warn(message);
}
Expand Down