@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/types.d.ts +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inertiajs/core",
3
- "version": "3.0.0-beta.5",
3
+ "version": "3.0.0-beta.6",
4
4
  "license": "MIT",
5
5
  "description": "A framework for creating server-driven single page apps.",
6
6
  "contributors": [
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']> = (props: TProps, formData: Record<string, FormDataConvertible>) => Partial<TProps> | void;
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: Record<string, FormDataConvertible>) => Record<string, FormDataConvertible>;
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;