Skip to content

Commit

Permalink
Update submission.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeiscontent authored May 10, 2024
1 parent 6ad463f commit 676c505
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/conform-dom/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,20 @@ export type ResetIntent<Schema = any> = {

export type UpdateIntent<Schema = any> = {
type: 'update';
payload: Schema extends Array<infer Item> ? {
name: FieldName<Schema>;
index: number;
value?: NonNullable<DefaultValue<Item>>;
validated?: boolean;
} : {
payload: {
name?: FieldName<Schema>;
index?: never;
value?: NonNullable<DefaultValue<Schema>>;
validated?: boolean;
} | {
name: FieldName<Schema>;
index: Schema extends Array<unknown> ? number : never;
value?: Schema extends Array<infer Item> ? NonNullable<DefaultValue<Item>> : never;
validated?: boolean;
};
};


export type RemoveIntent<Schema = any> = {
type: 'remove';
payload: {
Expand Down

0 comments on commit 676c505

Please # to comment.