Closed MeroVinggen closed 1 year ago
hello @Mero-Plaform and thanks for opening an issue
did you see https://github.com/Prozi/detect-collisions#3-create-and-insert-body or https://prozi.github.io/detect-collisions/classes/System.html#createBox ?
the type you're looking for is BodyOptions https://prozi.github.io/detect-collisions/interfaces/BodyOptions.html
BodyOption contains only: angle, isCentered, isStatic, isTrigger, padding
but not the main props, such as vectors, height and so on
like:
BodyOption contains only: angle, isCentered, isStatic, isTrigger, padding
but not the main props, such as vectors, height and so on
like:
- position, width, height for createBox
- position, radius for createCircle etc...
createBox(position: PotentialVector, width: number, height: number, options?: BodyOptions): Box
createCircle(position: PotentialVector, radius: number, options?: BodyOptions): Circle
the exact types for create* functions are there and are also documented
what is missing here?
I am missing the issue here
once again I point to https://prozi.github.io/detect-collisions/classes/System.html documentation of API
also note that
const box = new Box(position, width, height, options)
Box takes 4 parameters for constructor, from which last is optional
it is also noted here https://prozi.github.io/detect-collisions/classes/Box.html#constructor
it doesn't take one argument like you wrote:
addBox({ ... }: BoxParams) {
same goes with createBox, which also takes the same arguments, and is also documented like pointed above
I thought it over, it can't be solve the way I mean it, so I'm closing the issue
Add explicit params types for **system.create*** functions
otherways, user will need to make unnessecary types declarations, to setup types
such as:
or getting them by hard manipulations, using other TS Utilities