@inertiajs/core 3.0.0-beta.5 → 3.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/types.d.ts +4 -4
package/package.json
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -518,14 +518,14 @@ export type UseFormSubmitOptions = Omit<VisitOptions, 'data'>;
|
|
|
518
518
|
export type UseFormSubmitArguments = [Method, string, UseFormSubmitOptions?] | [UrlMethodPair, UseFormSubmitOptions?] | [UseFormSubmitOptions?];
|
|
519
519
|
export type UseHttpSubmitArguments<TResponse = unknown, TForm = unknown> = [Method, string, UseHttpSubmitOptions<TResponse, TForm>?] | [UrlMethodPair, UseHttpSubmitOptions<TResponse, TForm>?] | [UseHttpSubmitOptions<TResponse, TForm>?];
|
|
520
520
|
export type FormComponentOptions = Pick<VisitOptions, 'preserveScroll' | 'preserveState' | 'preserveUrl' | 'replace' | 'only' | 'except' | 'reset' | 'viewTransition'>;
|
|
521
|
-
export type FormComponentOptimisticCallback<TProps = Page<SharedPageProps>['props']
|
|
522
|
-
export type FormComponentProps = Partial<Pick<Visit, 'headers' | 'queryStringArrayFormat' | 'errorBag' | 'showProgress' | 'invalidateCacheTags'> & Omit<VisitCallbacks, 'onPrefetched' | 'onPrefetching'>> & {
|
|
521
|
+
export type FormComponentOptimisticCallback<TProps = Page<SharedPageProps>['props'], TForm = Record<string, FormDataConvertible>> = (props: TProps, formData: TForm) => Partial<TProps> | void;
|
|
522
|
+
export type FormComponentProps<TForm = Record<string, FormDataConvertible>> = Partial<Pick<Visit, 'headers' | 'queryStringArrayFormat' | 'errorBag' | 'showProgress' | 'invalidateCacheTags'> & Omit<VisitCallbacks, 'onPrefetched' | 'onPrefetching'>> & {
|
|
523
523
|
method?: Method | Uppercase<Method>;
|
|
524
524
|
action?: string | UrlMethodPair;
|
|
525
525
|
component?: string;
|
|
526
526
|
instant?: boolean;
|
|
527
|
-
transform?: (data:
|
|
528
|
-
optimistic?: FormComponentOptimisticCallback
|
|
527
|
+
transform?: (data: TForm) => Record<string, FormDataConvertible>;
|
|
528
|
+
optimistic?: FormComponentOptimisticCallback<Page<SharedPageProps>['props'], TForm>;
|
|
529
529
|
options?: FormComponentOptions;
|
|
530
530
|
onSubmitComplete?: (props: FormComponentOnSubmitCompleteArguments) => void;
|
|
531
531
|
disableWhileProcessing?: boolean;
|