Skip to content

dnscontrol write-types generates incorrect type for contents in TXT #4198

@dasyad00

Description

@dasyad00

NOTE: Have a general question? You'll get a better response on the dnscontrol-discuss email list!

Describe the bug
The documentation for TXT states that "The contents is either a single or multiple strings. To specify multiple strings, specify them as an array." The example also already includes the example: TXT("multiple", ["one", "two", "three"]), // Multiple strings.

However, the generated TypeScript file declares the function TXT to only accept a string type.

declare function TXT(name: string, contents: string, ...modifiers: RecordModifier[]): DomainModifier;

To Reproduce
Steps to reproduce the behavior:

  1. Run dnscontrol write-types.
  2. See contents parameter to be only of type string.

Expected behavior
contents parameter for TXT should also accept string[], similar to LUA.

DNS Provider

  • FILL IN

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions