-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Add DefaultUtils types #1078
Add DefaultUtils types #1078
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5ddbf99:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add DefaultUtils
after line 640 to be exported
export interface Utils extends ...
{
Import: Import;
...
OtherUtils: OtherUtils;
...
packages/core/modules/index.d.ts
Outdated
@@ -547,6 +547,24 @@ interface ConfigUtils { | |||
cleanJSX(jsx: any): Object; | |||
applyJsonLogic(logic: any, data?: any): any; | |||
} | |||
interface DefaultUtils { | |||
getDefaultField(config: Config, canGetFirst: boolean, parentRuleGroupPath: IdPath | null): Field; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canGetFirst
and parentRuleGroupPath
are optional patams. Please use ?
(like canGetFirst?: boolean
)
Same for other utils
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1078 +/- ##
=======================================
Coverage 82.18% 82.18%
=======================================
Files 211 211
Lines 11096 11097 +1
Branches 1328 1328
=======================================
+ Hits 9119 9120 +1
Misses 1367 1367
Partials 610 610 ☔ View full report in Codecov by Sentry. |
@ukrbublik Done 🙂 Thanks for the review! 🤟 |
I need to use
getDefaultOperator
from DefaultUtils, but the types are not defined inindex.d.ts
As a workaround waiting this pull request to be merged I add this in my codebase:
Feel free to edit the types as you wish 😉
Closes #1079