Add voilab-pdf-table#54143
Add voilab-pdf-table#54143typescript-bot merged 7 commits intoDefinitelyTyped:masterfrom danielb7390:master
Conversation
|
@danielb7390 Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 54143,
"author": "danielb7390",
"headCommitOid": "bea8ac69fa929cd57f36f6bab6602b167f55e83b",
"lastPushDate": "2021-07-01T17:37:02.000Z",
"lastActivityDate": "2021-07-01T20:25:07.000Z",
"mergeOfferDate": "2021-07-01T20:19:56.000Z",
"mergeRequestDate": "2021-07-01T20:25:07.000Z",
"mergeRequestUser": "danielb7390",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "voilab-pdf-table",
"kind": "add",
"files": [
{
"path": "types/voilab-pdf-table/index.d.ts",
"kind": "definition"
},
{
"path": "types/voilab-pdf-table/plugins/fitcolumn.d.ts",
"kind": "definition"
},
{
"path": "types/voilab-pdf-table/plugins/rowshader.d.ts",
"kind": "definition"
},
{
"path": "types/voilab-pdf-table/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/voilab-pdf-table/tslint.json",
"kind": "package-meta-ok"
},
{
"path": "types/voilab-pdf-table/voilab-pdf-table-tests.ts",
"kind": "test"
}
],
"owners": [],
"addedOwners": [
"danielb7390"
],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2021-07-01T20:19:21.000Z",
"isMaintainer": true
},
{
"type": "stale",
"reviewer": "DanielRosenwasser",
"date": "2021-07-01T08:07:36.000Z",
"abbrOid": "51aa511"
}
],
"mainBotCommentID": 869934423,
"ciResult": "pass"
} |
|
🔔 @danielb7390 — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...) |
|
@danielb7390 The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
types/voilab-pdf-table/index.d.ts
Outdated
| export = VoilabPdfTable; | ||
| export as namespace VoilabPdfTable; | ||
|
|
||
| declare class VoilabPdfTable<T = any> { |
There was a problem hiding this comment.
Is the any the best choice here? It looks like non-base data type IMO
There was a problem hiding this comment.
Can you explain better?
There was a problem hiding this comment.
We would like to avoid people doing simple typo kind of thing with literals for e.g. number? this could be unknown (as per handbook) or something that reassemble the type used (note: I've not used this native package, but I understand it accepts structure objects, so Record<string, Type> where Typeare allowed types union). Instead of Record one could use interface Type { [key: string]: SupportedType };.
What I meant: would be nice to guide what's allowed, but that's ok to use unkown (as per handbook)
There was a problem hiding this comment.
| declare class VoilabPdfTable<T = any> { | |
| interface VoilabPdfTableDefaultType { [key: string]: string | number} | |
| declare class VoilabPdfTable<T = VoilabPdfTableDefaultType > { |
If i understand you correctly, you are suggesting something like this?
Should i also be checking that whatever type the user passes, the object values are always string|number like so:
| declare class VoilabPdfTable<T = any> { | |
| interface VoilabPdfTableDefaultType { [key: string]: string | number} | |
| declare class VoilabPdfTable<T extends VoilabPdfTableDefaultType = VoilabPdfTableDefaultType > { |
I apologize if my questions are a bit weird, but i'm still learning TS
There was a problem hiding this comment.
Yes, if it make sense, I'll approve anyway. You can modify this further
|
@peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
@peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
types/voilab-pdf-table/index.d.ts
Outdated
| // Definitions by: Daniel Sousa <https://github.com/danielb7390> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
|
||
| /// <reference types="pdfkit" /> |
There was a problem hiding this comment.
Instead of a /// <reference can you get away with a simple import?
|
@DanielRosenwasser, @peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
@danielb7390 Everything looks good here. Great job! I am ready to merge this PR (at bea8ac6) on your behalf. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ |
|
@DanielRosenwasser Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
Ready to merge |
|
I just published |
Please fill in this template.
npm test <package to test>.Adding a new definition:
.d.tsfiles generated via--declarationdts-gen --dt, not by basing it on an existing project.tslint.jsonshould contain{ "extends": "dtslint/dt.json" }, and no additional rules.tsconfig.jsonshould havenoImplicitAny,noImplicitThis,strictNullChecks, andstrictFunctionTypesset totrue.This one is quite more complex than my first package that i did.
I did my best, but I'm no typescript expert! I'm open to suggestions!
no-misused-new. the suggestion is to use a class but i don't think it makes sense in both situations?no-unnecessary-generics. I'm not sure about this one, i get itTis not used in the arguments, but i want to have a specific return type?