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

key: "'value'";

just key: 'value';

Dimava avatar Jun 13 '23 00:06 Dimava

@Dimava Good catch, to used to writing AT definitions 😅 Will fix!

ssalbdivad avatar Jun 13 '23 01:06 ssalbdivad