Skip to content

Commit

Permalink
Merge pull request #37 from Gavant/add-form-validator-yield
Browse files Browse the repository at this point in the history
add interface for form validator yielded hash
  • Loading branch information
bakerac4 authored Jun 16, 2021
2 parents 6726a85 + 52903da commit 98aa8e4
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 98aa8e4

Please sign in to comment.