Skip to content
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

The latest version writes types that contain non standard numbers #2213

Closed
DavidZidar opened this issue Mar 22, 2023 · 5 comments · Fixed by #2219
Closed

The latest version writes types that contain non standard numbers #2213

DavidZidar opened this issue Mar 22, 2023 · 5 comments · Fixed by #2219

Comments

@DavidZidar
Copy link

DavidZidar commented Mar 22, 2023

I just tried the v3.29.0 preview in my other issue and discovered that when I write the updated types they now contain native number types that do not exist in standard TypeScript, like float32 and int.

This means that TypeScript can't validate the types properly and I get warnings such as these when I try:

types-dnscontrol.d.ts:764:28 - error TS2304: Cannot find name 'uint32'.

764 declare function LOC(deg1: uint32, min1: uint32, sec1: float32, deg2: uint32, min2: uint32, sec2: float32, altitude: uint32, size: float32, horizontal_precision: float32, vertical_precision: float32): DomainModifier;

The only number type that should be used is number.

@tlimoncelli
Copy link
Contributor

CC @j-f1

@DavidZidar
Copy link
Author

I did a quick look in the repository and found the dnscontrol.d.ts-file and it seems these changes were made in PR #2174.

@j-f1
Copy link
Contributor

j-f1 commented Mar 22, 2023

Yep, JS/TS only has number types, cc @systemcrash

@systemcrash
Copy link
Contributor

OK - I'm fine with 'number' types only - if that fixes problems. Those are generated from the docs, during the go generate step. How does one handle this?

Write 'number' in the preamble --- blah --- and then write what they actually are further in the doc?

systemcrash added a commit to systemcrash/dnscontrol that referenced this issue Mar 23, 2023
systemcrash added a commit to systemcrash/dnscontrol that referenced this issue Mar 23, 2023
systemcrash added a commit to systemcrash/dnscontrol that referenced this issue Mar 23, 2023
systemcrash added a commit to systemcrash/dnscontrol that referenced this issue Mar 23, 2023
systemcrash added a commit to systemcrash/dnscontrol that referenced this issue Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants