Skip to content

Commit

Permalink
add interface for form validator yielded hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Pafundi committed Jun 15, 2021
1 parent 6726a85 commit 52903da
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions types/@gavant/gavant-ember-validations/form-validator.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@ import { GenericChangeset } from '@gavant/ember-validations/utilities/create-cha
import FormValidatorChild from '@gavant/glint-template-types/types/@gavant/gavant-ember-validations/form-validator/child';
import InputValidator from '@gavant/glint-template-types/types/@gavant/gavant-ember-validations/input-validator';

export interface FormValidatorYield {
submit: FormValidatorComponent['submitForm'];
input: ComponentWithBoundArgs<typeof InputValidator, 'parent'>;
child: ComponentWithBoundArgs<typeof FormValidatorChild, 'parent'>;
}

export interface FormValidatorSignature<T> {
Element: HTMLFormElement;
Args: {
changeset: GenericChangeset<T>;
submit: (changeset?: GenericChangeset<T>, childChangesets?: GenericChangeset<unknown>[]) => any;
};
Yields: {
default: [
GenericChangeset<T>,
{
submit: FormValidatorComponent['submitForm'];
input: ComponentWithBoundArgs<typeof InputValidator, 'parent'>;
child: ComponentWithBoundArgs<typeof FormValidatorChild, 'parent'>;
}
];
default: [GenericChangeset<T>, FormValidatorYield];
};
}

Expand Down

0 comments on commit 52903da

Please sign in to comment.