Furry / 2captcha

A wrapper around the 2captcha api
71 stars 23 forks source link

TS declaration for 2Captcha API is not correct #22

Closed sir-alex closed 2 years ago

sir-alex commented 2 years ago

min_len?: 0 | string; max_len?: 0 | string;

is not correct as those 2 params are integers according to https://2captcha.com/2captcha-api

also it would be good to mention in documentation original 2Captcha API settings such as regsense, numeric etc as they are crucial and without right settings service can not work properly

sir-alex commented 2 years ago

I can make a PR if you wish

Furry commented 2 years ago

min_len?: 0 | string; max_len?: 0 | string;

is not correct as those 2 params are integers according to https://2captcha.com/2captcha-api

also it would be good to mention in documentation original 2Captcha API settings such as regsense, numeric etc as they are crucial and without right settings service can not work properly

This was a conscious choice, all the structures that extend BaseSolve are serialized into a QueryString parameter, so they're treated as a string once the http request is sent.

that being said, when people use the 2captcha api in reference to my library and that causes confusion, I can understand. If you want to make a PR that makes min_len & max_len a union of string & number i'll accept it!

sir-alex commented 2 years ago

PR is ready

Furry commented 2 years ago

PR is ready

Merged it, thanks for the PR!