Skip to content

Commit c701f4b

Browse files
committed
make issues and input partial
1 parent 44264eb commit c701f4b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.changeset/mighty-walls-retire.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@sveltejs/kit': patch
33
---
44

5-
fix: add type for form.issues.$
5+
fix: add type for `form.issues.$`, make `form.issues` and `form.input` partial

packages/kit/src/exports/public.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,9 +1943,11 @@ export type RemoteForm<Input extends RemoteFormInput | void, Output> = {
19431943
/** The number of pending submissions */
19441944
get pending(): number;
19451945
/** The submitted values */
1946-
input: null | UnionToIntersection<FlattenInput<Input, ''>>;
1946+
input: null | Partial<UnionToIntersection<FlattenInput<Input, ''>>>;
19471947
/** Validation issues */
1948-
issues: null | (UnionToIntersection<FlattenIssues<Input, ''>> & { $?: RemoteFormIssue[] });
1948+
issues:
1949+
| null
1950+
| (Partial<UnionToIntersection<FlattenIssues<Input, ''>>> & { $?: RemoteFormIssue[] });
19491951
/** Spread this onto a `<button>` or `<input type="submit">` */
19501952
buttonProps: {
19511953
type: 'submit';

packages/kit/types/index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,9 +1919,11 @@ declare module '@sveltejs/kit' {
19191919
/** The number of pending submissions */
19201920
get pending(): number;
19211921
/** The submitted values */
1922-
input: null | UnionToIntersection<FlattenInput<Input, ''>>;
1922+
input: null | Partial<UnionToIntersection<FlattenInput<Input, ''>>>;
19231923
/** Validation issues */
1924-
issues: null | (UnionToIntersection<FlattenIssues<Input, ''>> & { $?: RemoteFormIssue[] });
1924+
issues:
1925+
| null
1926+
| (Partial<UnionToIntersection<FlattenIssues<Input, ''>>> & { $?: RemoteFormIssue[] });
19251927
/** Spread this onto a `<button>` or `<input type="submit">` */
19261928
buttonProps: {
19271929
type: 'submit';

0 commit comments

Comments
 (0)