Skip to content

Commit

Permalink
Fix number type in typescript - fixes StackExchange#2213
Browse files Browse the repository at this point in the history
  • Loading branch information
systemcrash committed Mar 23, 2023
1 parent b01453e commit 8e4b06d
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 10 deletions.
69 changes: 64 additions & 5 deletions commands/types/dnscontrol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,24 @@ declare function IGNORE_TARGET(pattern: string, rType: string): DomainModifier;
declare function INCLUDE(domain: string): DomainModifier;

/**
* The parameter number types are as follows:
*
* ```
* parameter_types:
* name: string
* target: string
* deg1: uint32
* min1: uint32
* sec1: float32
* deg2: uint32
* min2: uint32
* sec2: float32
* altitude: uint32
* size: float32
* horizontal_precision: float32
* vertical_precision: float32
* ```
*
* ## Description ##
*
* Strictly follows [RFC 1876](https://datatracker.ietf.org/doc/html/rfc1876).
Expand Down Expand Up @@ -757,7 +775,7 @@ declare function INCLUDE(domain: string): DomainModifier;
*
* @see https://dnscontrol.org/js#LOC
*/
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;
declare function LOC(deg1: number, min1: number, sec1: number, deg2: number, min2: number, sec2: number, altitude: number, size: number, horizontal_precision: number, vertical_precision: number): DomainModifier;

/**
* MX adds an MX record to the domain.
Expand Down Expand Up @@ -2200,6 +2218,17 @@ declare function CAA_BUILDER(opts: { label?: string; iodef: string; iodef_critic
declare function DMARC_BUILDER(opts: { label?: string; version?: string; policy: 'none' | 'quarantine' | 'reject'; subdomainPolicy?: 'none' | 'quarantine' | 'reject'; alignmentSPF?: 'strict' | 's' | 'relaxed' | 'r'; alignmentDKIM?: 'strict' | 's' | 'relaxed' | 'r'; percent?: number; rua?: string[]; ruf?: string[]; failureOptions?: { SPF: boolean, DKIM: boolean } | string; failureFormat?: string; reportInterval?: Duration; ttl?: Duration }): RecordModifier;

/**
* The parameter number types are as follows:
*
* ```
* parameter_types:
* label: string
* x: float32
* y: float32
* alt: float32
* ttl: int
* ```
*
* `LOC_BUILDER_DD({})` actually takes an object with the following properties:
*
* - label (optional, defaults to `@`)
Expand Down Expand Up @@ -2256,9 +2285,19 @@ declare function DMARC_BUILDER(opts: { label?: string; version?: string; policy:
*
* @see https://dnscontrol.org/js#LOC_BUILDER_DD
*/
declare function LOC_BUILDER_DD(label: string, x: float32, y: float32, alt: float32, ttl: int): RecordModifier;
declare function LOC_BUILDER_DD(label: string, x: number, y: number, alt: number, ttl: number): RecordModifier;

/**
* The parameter number types are as follows:
*
* ```
* parameter_types:
* label: string
* str: string
* alt: float32
* ttl: int
* ```
*
* `LOC_BUILDER_DMM({})` actually takes an object with the following properties:
*
* - label (optional, defaults to `@`)
Expand Down Expand Up @@ -2298,9 +2337,19 @@ declare function LOC_BUILDER_DD(label: string, x: float32, y: float32, alt: floa
*
* @see https://dnscontrol.org/js#LOC_BUILDER_DMM_STR
*/
declare function LOC_BUILDER_DMM_STR(label: string, str: string, alt: float32, ttl: int): RecordModifier;
declare function LOC_BUILDER_DMM_STR(label: string, str: string, alt: number, ttl: number): RecordModifier;

/**
* The parameter number types are as follows:
*
* ```
* parameter_types:
* label: string
* str: string
* alt: float32
* ttl: int
* ```
*
* `LOC_BUILDER_DMS_STR({})` actually takes an object with the following properties:
*
* - label (optional, defaults to `@`)
Expand Down Expand Up @@ -2341,9 +2390,19 @@ declare function LOC_BUILDER_DMM_STR(label: string, str: string, alt: float32, t
*
* @see https://dnscontrol.org/js#LOC_BUILDER_DMS_STR
*/
declare function LOC_BUILDER_DMS_STR(label: string, str: string, alt: float32, ttl: int): RecordModifier;
declare function LOC_BUILDER_DMS_STR(label: string, str: string, alt: number, ttl: number): RecordModifier;

/**
* The parameter number types are as follows:
*
* ```
* parameter_types:
* label: string
* str: string
* alt: float32
* ttl: int
* ```
*
* `LOC_BUILDER_STR({})` actually takes an object with the following: properties.
*
* - label (optional, defaults to `@`)
Expand Down Expand Up @@ -2389,7 +2448,7 @@ declare function LOC_BUILDER_DMS_STR(label: string, str: string, alt: float32, t
*
* @see https://dnscontrol.org/js#LOC_BUILDER_STR
*/
declare function LOC_BUILDER_STR(label: string, str: string, alt: float32, ttl: int): RecordModifier;
declare function LOC_BUILDER_STR(label: string, str: string, alt: number, ttl: number): RecordModifier;

/**
* R53_ZONE lets you specify the AWS Zone ID for an entire domain (D()) or a specific R53_ALIAS() record.
Expand Down
21 changes: 20 additions & 1 deletion documentation/functions/domain/LOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ parameters:
- size
- horizontal_precision
- vertical_precision
parameter_types:
name: string
target: string
deg1: number
min1: number
sec1: number
deg2: number
min2: number
sec2: number
altitude: number
size: number
horizontal_precision: number
vertical_precision: number
---

The parameter number types are as follows:

```
parameter_types:
name: string
target: string
Expand All @@ -24,7 +42,8 @@ parameter_types:
size: float32
horizontal_precision: float32
vertical_precision: float32
---
```


## Description ##

Expand Down
14 changes: 13 additions & 1 deletion documentation/functions/record/LOC_BUILDER_DD.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,25 @@ parameters:
- y
- alt
- ttl
parameter_types:
label: string
x: number
y: number
alt: number
ttl: number
---

The parameter number types are as follows:

```
parameter_types:
label: string
x: float32
y: float32
alt: float32
ttl: int
---
```


`LOC_BUILDER_DD({})` actually takes an object with the following properties:

Expand Down
12 changes: 11 additions & 1 deletion documentation/functions/record/LOC_BUILDER_DMM_STR.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ parameters:
- str
- alt
- ttl
parameter_types:
label: string
str: string
alt: number
ttl: number
---

The parameter number types are as follows:

```
parameter_types:
label: string
str: string
alt: float32
ttl: int
---
```

`LOC_BUILDER_DMM({})` actually takes an object with the following properties:

Expand Down
12 changes: 11 additions & 1 deletion documentation/functions/record/LOC_BUILDER_DMS_STR.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ parameters:
- str
- alt
- ttl
parameter_types:
label: string
str: string
alt: number
ttl: number
---

The parameter number types are as follows:

```
parameter_types:
label: string
str: string
alt: float32
ttl: int
---
```

`LOC_BUILDER_DMS_STR({})` actually takes an object with the following properties:

Expand Down
12 changes: 11 additions & 1 deletion documentation/functions/record/LOC_BUILDER_STR.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ parameters:
- str
- alt
- ttl
parameter_types:
label: string
str: string
alt: number
ttl: number
---

The parameter number types are as follows:

```
parameter_types:
label: string
str: string
alt: float32
ttl: int
---
```

`LOC_BUILDER_STR({})` actually takes an object with the following: properties.

Expand Down

0 comments on commit 8e4b06d

Please sign in to comment.