inferred type of '...' cannot be named without a reference to '...'
Type instantiation is excessively deep and possibly infinite
const A = type("bigint").narrow(() => true).pipe((v) => v.toString());
type A = typeof A.in.infer;
const A = type("bigint").narrow(() => true).pipe((v) => v.toString());
type A = typeof A.in.infer;
Extracting intent into runtime
string input, number output
Represent the File class
Any way to tell if a custom description has been provided?
Converting Zod to Arktype
Array
in runtime?
...Record with number as key?
const A = type("Record<number, string>");
const A = type("Record<number, string>");
Is there a way to rename the key in parse result
Can I add a default value to a type if everything other satisfies in a union type
How to type an expressjs-like route handler based on the path pattern.
get('/path/:id?q=:query', handler)
is it possible to look at the structure of the string and infer the type of the parameters that are passed to the handler
function as { id: string; query: string;}
. Given the prevalence of this pattern, I'd expect that someone has attempted it before, but I can't seem to find it in the docs and/or discord....Compiling to JavaScript results in `any` type
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;
Was `any` removed?
type("any");
. Now it's throwing error Argument of type '"any"' is not assignable to parameter of type '"'any' is unresolvableā"'
Type instantiation is excessively deep and possibly infinite
const m = <T, U>(type: Type<T, U>) => {
return type.describe("test");
}
const m = <T, U>(type: Type<T, U>) => {
return type.describe("test");
}
Best way to pass `Type` around
Default number
inferAmbient
:
```ts...Optional property with const string array
const x = ["a", "b", "c"] as const;
const myType = type({
"optional?": type("===", ...x),
});
const x = ["a", "b", "c"] as const;
const myType = type({
"optional?": type("===", ...x),
});
Extending types similar to an interface
Indexed Access Types
SizeValues
type below in arktype? ```ts
const sizes = [
{ label: "Big", value: "100kg" },
{ label: "Medium", value: "50kg" },
{ label: "Small", value: "10kg" },...vscode intellisense errors on the same type definition in some files, but not others