@inertiajs/core 2.2.5 → 2.2.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inertiajs/core",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "license": "MIT",
5
5
  "description": "A framework for creating server-driven single page apps.",
6
6
  "contributors": [
@@ -21,12 +21,12 @@ declare class History {
21
21
  page: Page | ArrayBuffer;
22
22
  scrollRegions?: ScrollRegion[];
23
23
  documentScrollPosition?: ScrollRegion;
24
- }, url?: string): void;
24
+ }, url?: string): Promise<void>;
25
25
  protected doPushState(data: {
26
26
  page: Page | ArrayBuffer;
27
27
  scrollRegions?: ScrollRegion[];
28
28
  documentScrollPosition?: ScrollRegion;
29
- }, url: string): void;
29
+ }, url: string): Promise<void>;
30
30
  getState<T>(key: keyof Page, defaultValue?: T): any;
31
31
  deleteState(key: keyof Page): void;
32
32
  clearInitialState(key: keyof Page): void;
package/types/index.d.ts CHANGED
@@ -8,6 +8,6 @@ export { shouldIntercept, shouldNavigate } from './navigationEvents';
8
8
  export { hide as hideProgress, progress, reveal as revealProgress, default as setupProgress } from './progress';
9
9
  export { resetFormFields } from './resetFormFields';
10
10
  export * from './types';
11
- export { hrefToUrl, isUrlMethodPair, mergeDataIntoQueryString, urlWithoutHash } from './url';
11
+ export { hrefToUrl, isUrlMethodPair, mergeDataIntoQueryString, urlHasProtocol, urlToString, urlWithoutHash, } from './url';
12
12
  export { type Router };
13
13
  export declare const router: Router;
@@ -4,6 +4,6 @@ export declare const useInfiniteScrollData: (options: {
4
4
  onBeforeUpdate: () => void;
5
5
  onBeforePreviousRequest: () => void;
6
6
  onBeforeNextRequest: () => void;
7
- onCompletePreviousRequest: (loadedPage?: string | number) => void;
8
- onCompleteNextRequest: (loadedPage?: string | number) => void;
7
+ onCompletePreviousRequest: (loadedPage: string | number | null) => void;
8
+ onCompleteNextRequest: (loadedPage: string | number | null) => void;
9
9
  }) => UseInfiniteScrollDataManager;
package/types/types.d.ts CHANGED
@@ -55,9 +55,9 @@ export interface PageProps {
55
55
  }
56
56
  export type ScrollProp = {
57
57
  pageName: string;
58
- previousPage?: number | string;
59
- nextPage?: number | string;
60
- currentPage?: number | string;
58
+ previousPage: number | string | null;
59
+ nextPage: number | string | null;
60
+ currentPage: number | string | null;
61
61
  reset: boolean;
62
62
  };
63
63
  export interface Page<SharedProps extends PageProps = PageProps> {
@@ -382,7 +382,7 @@ export interface UseInfiniteScrollOptions {
382
382
  onCompleteNextRequest: () => void;
383
383
  }
384
384
  export interface UseInfiniteScrollDataManager {
385
- getLastLoadedPage: () => number | string | undefined;
385
+ getLastLoadedPage: () => number | string | null;
386
386
  getPageName: () => string;
387
387
  getRequestCount: () => number;
388
388
  hasPrevious: () => boolean;
@@ -398,7 +398,7 @@ export interface UseInfiniteScrollElementManager {
398
398
  refreshTriggers: () => void;
399
399
  flushAll: () => void;
400
400
  processManuallyAddedElements: () => void;
401
- processServerLoadedElements: (loadedPage?: string | number | undefined) => void;
401
+ processServerLoadedElements: (loadedPage: string | number | null) => void;
402
402
  }
403
403
  export interface UseInfiniteScrollProps {
404
404
  dataManager: UseInfiniteScrollDataManager;
package/types/url.d.ts CHANGED
@@ -7,4 +7,6 @@ export declare function urlWithoutHash(url: URL | Location): URL;
7
7
  export declare const setHashIfSameUrl: (originUrl: URL | Location, destinationUrl: URL | Location) => void;
8
8
  export declare const isSameUrlWithoutHash: (url1: URL | Location, url2: URL | Location) => boolean;
9
9
  export declare function isUrlMethodPair(href: unknown): href is UrlMethodPair;
10
+ export declare function urlHasProtocol(url: string): boolean;
11
+ export declare function urlToString(url: URL | string, absolute: boolean): string;
10
12
  export {};