webarkit / jsfeatNext

Typescript version of jsfeat with typescript definitions.
GNU Lesser General Public License v2.1
8 stars 2 forks source link

Typescript definitions inconsistencies #5

Closed kalwalt closed 2 years ago

kalwalt commented 2 years ago

I added a simple transpiler for the typescript definitions thanks to the tsc compiler but this approach has some disadvantages, look for example at definitions of the matrix_t constructor: https://github.com/kalwalt/jsfeatNext/blob/63ca6ce8aab4691d063db818b35d304edcc2e751/types/matrix_t/matrix_t.d.ts#L2 For example c and r ( width and height of the matrix_t) should be as number type but are definded as any type. This isn't safe because i could pass also a string as width. I think the only way to keep safe the arguments is to rewrite the project in Typescript, I don't know if there are other options.

kalwalt commented 2 years ago

I completely converted the code to Typescript. I think it will still require some improvements, above all some arguments definitions and need to create some tests, I have not decided with which system/framework, this will be the work for the future.