inertiax-core 5.0.13 → 5.0.14

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": "inertiax-core",
3
- "version": "5.0.13",
3
+ "version": "5.0.14",
4
4
  "license": "MIT",
5
5
  "description": "A framework for creating server-driven single page apps.",
6
6
  "contributors": [
@@ -46,9 +46,9 @@
46
46
  },
47
47
  "scripts": {
48
48
  "dev": "./build.js --watch",
49
- "build": "npm run clean && ./build.js && tsc --emitDeclarationOnly",
49
+ "build": "bun run clean && ./build.js && tsc --emitDeclarationOnly",
50
50
  "clean": "rm -rf types && rm -rf dist",
51
- "prepublishOnly": "npm run build",
51
+ "prepublishOnly": "bun run build",
52
52
  "test": "vitest"
53
53
  },
54
54
  "dependencies": {
@@ -1,5 +1,4 @@
1
- import { GlobalEvent, GlobalEventNames, GlobalEventResult } from './types';
2
- type InternalEvent = 'missingHistoryItem';
1
+ import { GlobalEvent, GlobalEventNames, GlobalEventResult, InternalEvent } from './types';
3
2
  declare class EventHandler {
4
3
  protected internalListeners: {
5
4
  event: InternalEvent;
@@ -9,7 +8,7 @@ declare class EventHandler {
9
8
  onGlobalEvent<TEventName extends GlobalEventNames>(type: TEventName, callback: (event: GlobalEvent<TEventName>) => GlobalEventResult<TEventName>): VoidFunction;
10
9
  on(event: InternalEvent, callback: VoidFunction): VoidFunction;
11
10
  onMissingHistoryItem(): void;
12
- protected fireInternalEvent(event: InternalEvent): void;
11
+ fireInternalEvent(event: InternalEvent): void;
13
12
  protected registerListener(type: string, listener: EventListener): VoidFunction;
14
13
  protected handlePopstateEvent(event: PopStateEvent): void;
15
14
  }
@@ -24,7 +24,7 @@ export declare class Response {
24
24
  protected setFrame(): Promise<void>;
25
25
  protected getDataFromResponse(response: any): any;
26
26
  protected shouldSetFrame(pageResponse: Frame): boolean;
27
- protected pageUrl(pageResponse: Frame): string;
27
+ protected pageUrl(pageResponse: Frame): string | undefined;
28
28
  protected mergeProps(pageResponse: Frame): void;
29
29
  protected setRememberedState(pageResponse: Frame): Promise<void>;
30
30
  protected getScopedErrors(errors: Errors & ErrorBag): Errors;
package/types/types.d.ts CHANGED
@@ -164,6 +164,7 @@ export type GlobalEventResult<TEventName extends GlobalEventNames> = GlobalEvent
164
164
  export type GlobalEventDetails<TEventName extends GlobalEventNames> = GlobalEventsMap[TEventName]['details'];
165
165
  export type GlobalEventTrigger<TEventName extends GlobalEventNames> = (...params: GlobalEventParameters<TEventName>) => GlobalEventResult<TEventName>;
166
166
  export type GlobalEventCallback<TEventName extends GlobalEventNames> = (...params: GlobalEventParameters<TEventName>) => GlobalEventResult<TEventName>;
167
+ export type InternalEvent = 'missingHistoryItem' | 'loadDeferredProps';
167
168
  export type VisitCallbacks = {
168
169
  onCancelToken: {
169
170
  ({ cancel }: {