@formdef/core 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -338,15 +338,16 @@ type ConfigParts = {
338
338
  formComponents: object;
339
339
  handle: unknown;
340
340
  };
341
- type NamesIn<TEntry> = TEntry extends string ? TEntry : TEntry extends {
341
+ type NamesInEntries<TEntries, TSeen> = [TEntries] extends [TSeen] ? never : NamesIn<TEntries, TSeen | TEntries>;
342
+ type NamesIn<TEntry, TSeen> = TEntry extends string ? TEntry : TEntry extends {
342
343
  layout: readonly (infer TNested)[];
343
- } ? NamesIn<TNested> : TEntry extends {
344
+ } ? NamesInEntries<TNested, TSeen> : TEntry extends {
344
345
  row: readonly (infer TNested)[];
345
- } ? NamesIn<TNested> : never;
346
+ } ? NamesInEntries<TNested, TSeen> : never;
346
347
  type UndescribedNames<TConfig> = TConfig extends {
347
348
  layout: readonly (infer TEntry)[];
348
349
  fields: infer TFields;
349
- } ? Exclude<NamesIn<TEntry>, keyof TFields> : never;
350
+ } ? Exclude<NamesInEntries<TEntry, never>, keyof TFields> : never;
350
351
  type UndescribedName<TName extends string> = `formdef: the layout names "${TName}", which fields does not describe`;
351
352
  /**
352
353
  * Checks the root `layout` of a config written as `TConfig`, sections and rows included: a name
@@ -636,7 +637,7 @@ type FieldsForm = {
636
637
  };
637
638
  type ValuesOf<TForm extends FieldsForm> = TForm["state"]["values"];
638
639
  type FieldsParts<TWidgets, TFormComponents, TStructure, TForm> = OwnParts<TWidgets, TFormComponents, TStructure> & {
639
- handle: TForm;
640
+ handle: NoInfer<TForm>;
640
641
  };
641
642
  /**
642
643
  * What {@link createRegistry} returns: TanStack's form hook for the registered widgets and form
package/dist/index.d.ts CHANGED
@@ -338,15 +338,16 @@ type ConfigParts = {
338
338
  formComponents: object;
339
339
  handle: unknown;
340
340
  };
341
- type NamesIn<TEntry> = TEntry extends string ? TEntry : TEntry extends {
341
+ type NamesInEntries<TEntries, TSeen> = [TEntries] extends [TSeen] ? never : NamesIn<TEntries, TSeen | TEntries>;
342
+ type NamesIn<TEntry, TSeen> = TEntry extends string ? TEntry : TEntry extends {
342
343
  layout: readonly (infer TNested)[];
343
- } ? NamesIn<TNested> : TEntry extends {
344
+ } ? NamesInEntries<TNested, TSeen> : TEntry extends {
344
345
  row: readonly (infer TNested)[];
345
- } ? NamesIn<TNested> : never;
346
+ } ? NamesInEntries<TNested, TSeen> : never;
346
347
  type UndescribedNames<TConfig> = TConfig extends {
347
348
  layout: readonly (infer TEntry)[];
348
349
  fields: infer TFields;
349
- } ? Exclude<NamesIn<TEntry>, keyof TFields> : never;
350
+ } ? Exclude<NamesInEntries<TEntry, never>, keyof TFields> : never;
350
351
  type UndescribedName<TName extends string> = `formdef: the layout names "${TName}", which fields does not describe`;
351
352
  /**
352
353
  * Checks the root `layout` of a config written as `TConfig`, sections and rows included: a name
@@ -636,7 +637,7 @@ type FieldsForm = {
636
637
  };
637
638
  type ValuesOf<TForm extends FieldsForm> = TForm["state"]["values"];
638
639
  type FieldsParts<TWidgets, TFormComponents, TStructure, TForm> = OwnParts<TWidgets, TFormComponents, TStructure> & {
639
- handle: TForm;
640
+ handle: NoInfer<TForm>;
640
641
  };
641
642
  /**
642
643
  * What {@link createRegistry} returns: TanStack's form hook for the registered widgets and form
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formdef/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Describe a form once as a typed object, render it as a React component, with the compiler checking that every widget fits its value. Built on TanStack Form.",
5
5
  "keywords": [
6
6
  "react",