Skip to content

Commit

Permalink
fixup! Update submission.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundhung committed May 11, 2024
1 parent 676c505 commit e8c32f3
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/conform-dom/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,21 +321,24 @@ export type ResetIntent<Schema = any> = {
};

export type UpdateIntent<Schema = any> = {
type: 'update';
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;
};
type: 'update';
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 e8c32f3

Please # to comment.