import { RequestParams } from './requestParams'; import { ActiveVisit, ErrorBag, Errors, HttpResponse, Page, PageProps } from './types'; export declare class Response { protected requestParams: RequestParams; protected response: HttpResponse; protected originatingPage: Page; protected wasPrefetched: boolean; protected processed: boolean; constructor(requestParams: RequestParams, response: HttpResponse, originatingPage: Page); static create(params: RequestParams, response: HttpResponse, originatingPage: Page): Response; isProcessed(): boolean; handlePrefetch(): Promise; handle(): Promise; process(): Promise; mergeParams(params: ActiveVisit): void; getPageResponse(): Page; protected handleNonInertiaResponse(): Promise; protected isInertiaResponse(): boolean; protected isHttpException(): boolean; protected hasStatus(status: number): boolean; protected getHeader(header: string): string; protected hasHeader(header: string): boolean; protected isInertiaRedirect(): boolean; protected isLocationVisit(): boolean; /** * @link https://inertiajs.com/redirects#external-redirects */ protected locationVisit(url: URL): boolean | void; protected setPage(): Promise; protected getDataFromResponse(response: any): any; protected shouldSetPage(pageResponse: Page): boolean; protected pageUrl(pageResponse: Page): string; protected preserveOptimisticProps(pageResponse: Page): void; protected preserveEqualProps(pageResponse: Page): void; protected mergeProps(pageResponse: Page): void; /** * By default, the Laravel adapter shares validation errors via Inertia::always(), * so responses always include errors, even when empty. Components like * InfiniteScroll and WhenVisible, as well as loading deferred props, * perform async requests that should practically never reset errors. */ protected shouldPreserveErrors(pageResponse: Page): boolean; protected isObject(item: any): boolean; protected deepMergeObjects(target: PageProps, source: PageProps): PageProps; protected mergeOrMatchItems(existingItems: any[], newItems: any[], matchProp: string, matchPropsOn: string[], shouldAppend?: boolean): any[]; protected appendWithMatching(existingItems: any[], newItems: any[], newItemsMap: Map, uniqueProperty: string): any[]; protected prependWithMatching(existingItems: any[], newItems: any[], newItemsMap: Map, uniqueProperty: string): any[]; protected hasUniqueProperty(item: any, property: string): boolean; protected setRememberedState(pageResponse: Page): Promise; protected getScopedErrors(errors: Errors & ErrorBag): Errors; }