arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Declared scopes

Open ssalbdivad opened this issue 1 year ago • 2 comments

Would add support for declaring the inferred types of an entire scope, with autocomplete for alias names.

Similar to existing API for declared types (in beta).

Maybe something like:

declare<{
  a: string;
  b: {
    key: "value";
  };
}>().scope({
  a: "string",
  b: {
    key: "'value'",
  },
});

Thanks @Dimava for the API suggestion!

ssalbdivad avatar Jun 12 '23 20:06 ssalbdivad