Compiling to JavaScript results in `any` type

I have a TypeScript library that compiles down into JavaScript, and one of the d.ts files looks like this:
declare const Address: import("arktype/out/subtypes/string").StringType<import("arktype/out/keywords/ast").string.narrowed, {}>;
type Address = typeof Address.in.infer;
declare const Address: import("arktype/out/subtypes/string").StringType<import("arktype/out/keywords/ast").string.narrowed, {}>;
type Address = typeof Address.in.infer;
In this example, Address is of type any, whereas when I'm in TypeScript it's of type string
2 Replies
SynthLuvr
SynthLuvr3w ago
To reproduce:
import { type } from "arktype";

const Address = type("string").narrow(() => true);
type Address = typeof Address.in.infer;

export { Address }
import { type } from "arktype";

const Address = type("string").narrow(() => true);
type Address = typeof Address.in.infer;

export { Address }
ssalbdivad
ssalbdivad3w ago
Can you log an issue for this? It's something I'm interested in investigating and supporting but it's not trivial to ensure this never happens transitively and there are not tests for it yet
Want results from more Discord servers?
Add your server