@types/hotwired__turbo 8.0.2 → 8.0.4

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.
hotwired__turbo/README.md CHANGED
@@ -8,8 +8,8 @@ This package contains type definitions for @hotwired/turbo (https://turbo.hotwir
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hotwired__turbo.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 11 Nov 2024 19:32:12 GMT
11
+ * Last updated: Sat, 25 Jan 2025 22:34:53 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
15
- These definitions were written by [Gareth Jones](https://github.com/G-Rath), and [Luke Davia](https://github.com/lukeify).
15
+ These definitions were written by [Gareth Jones](https://github.com/G-Rath), [Luke Davia](https://github.com/lukeify), and [Alex Coles](https://github.com/myabc).
@@ -187,18 +187,16 @@ export interface FormSubmission {
187
187
  submitter?: HTMLButtonElement | HTMLInputElement;
188
188
  }
189
189
  export type FormSubmissionResult =
190
- | { success: boolean; fetchResponse: FetchResponse }
191
- | { success: false; error: Error };
190
+ & { formSubmission: FormSubmission }
191
+ & (
192
+ | { success: true; error: undefined; fetchResponse: FetchResponse }
193
+ | { success: false; error?: Error; fetchResponse?: FetchResponse }
194
+ );
192
195
 
193
196
  export type TurboSubmitStartEvent = CustomEvent<{
194
197
  formSubmission: FormSubmission;
195
198
  }>;
196
- export type TurboSubmitEndEvent = CustomEvent<
197
- & { formSubmission: FormSubmission }
198
- & {
199
- [K in keyof FormSubmissionResult]?: FormSubmissionResult[K];
200
- }
201
- >;
199
+ export type TurboSubmitEndEvent = CustomEvent<FormSubmissionResult>;
202
200
 
203
201
  export type TurboFrameMissingEvent = CustomEvent<{
204
202
  response: Response;
@@ -220,6 +218,11 @@ export type TurboFetchRequestErrorEvent = CustomEvent<{
220
218
  error: Error;
221
219
  }>;
222
220
 
221
+ export interface TurboElementTagNameMap {
222
+ "turbo-frame": FrameElement;
223
+ "turbo-stream": StreamElement;
224
+ }
225
+
223
226
  export interface TurboElementEventMap {
224
227
  "turbo:before-frame-render": TurboBeforeFrameRenderEvent;
225
228
  "turbo:before-fetch-request": TurboBeforeFetchRequestEvent;
@@ -247,6 +250,7 @@ export interface TurboGlobalEventHandlersEventMap extends TurboElementEventMap {
247
250
 
248
251
  declare global {
249
252
  /* eslint-disable @typescript-eslint/no-empty-interface */
253
+ interface HTMLElementTagNameMap extends TurboElementTagNameMap {}
250
254
  interface ElementEventMap extends TurboElementEventMap {}
251
255
  interface GlobalEventHandlersEventMap extends TurboGlobalEventHandlersEventMap {}
252
256
  /* eslint-enable @typescript-eslint/no-empty-interface */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/hotwired__turbo",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "TypeScript definitions for @hotwired/turbo",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hotwired__turbo",
6
6
  "license": "MIT",
@@ -14,6 +14,11 @@
14
14
  "name": "Luke Davia",
15
15
  "githubUsername": "lukeify",
16
16
  "url": "https://github.com/lukeify"
17
+ },
18
+ {
19
+ "name": "Alex Coles",
20
+ "githubUsername": "myabc",
21
+ "url": "https://github.com/myabc"
17
22
  }
18
23
  ],
19
24
  "main": "",
@@ -26,6 +31,6 @@
26
31
  "scripts": {},
27
32
  "dependencies": {},
28
33
  "peerDependencies": {},
29
- "typesPublisherContentHash": "f650a9ca94456cc346fc48c3c2ba2c8bcd3d5c4f5113befe5ca20bc6ecc77c9a",
30
- "typeScriptVersion": "4.9"
34
+ "typesPublisherContentHash": "0d52f0788ffe8fffc814644e7fe2413384012ff99f8dbeffa538f580f07fd0c5",
35
+ "typeScriptVersion": "5.0"
31
36
  }