@types/hotwired__turbo 8.0.1 → 8.0.3
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 +1 -1
- hotwired__turbo/index.d.ts +36 -11
- hotwired__turbo/package.json +4 -3
hotwired__turbo/README.md
CHANGED
|
@@ -8,7 +8,7 @@ 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:
|
|
11
|
+
* Last updated: Mon, 09 Dec 2024 04:03:00 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
hotwired__turbo/index.d.ts
CHANGED
|
@@ -40,13 +40,31 @@ export class StreamElement extends HTMLElement {
|
|
|
40
40
|
readonly requestId: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export class FetchRequest {
|
|
43
|
+
export class FetchRequest {
|
|
44
|
+
body: FormData | URLSearchParams;
|
|
45
|
+
enctype: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
46
|
+
fetchOptions: RequestInit;
|
|
47
|
+
headers: Headers | { [k: string]: any };
|
|
48
|
+
method: "get" | "post" | "put" | "patch" | "delete";
|
|
49
|
+
params: URLSearchParams;
|
|
50
|
+
target: HTMLFormElement | HTMLAnchorElement | FrameElement | null;
|
|
51
|
+
url: URL;
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
export class FetchResponse {
|
|
55
|
+
clientError: boolean;
|
|
56
|
+
contentType: string;
|
|
57
|
+
failed: boolean;
|
|
45
58
|
header(key: string): string | undefined;
|
|
46
|
-
|
|
47
|
-
responseText: Promise<string>;
|
|
59
|
+
isHTML: boolean;
|
|
48
60
|
location: URL;
|
|
61
|
+
redirected: boolean;
|
|
62
|
+
responseHTML: Promise<string>;
|
|
63
|
+
responseText: Promise<string>;
|
|
49
64
|
response: Response;
|
|
65
|
+
serverError: boolean;
|
|
66
|
+
statusCode: number;
|
|
67
|
+
succeeded: boolean;
|
|
50
68
|
}
|
|
51
69
|
|
|
52
70
|
/**
|
|
@@ -157,21 +175,28 @@ export type TurboBeforeStreamRenderEvent = CustomEvent<{
|
|
|
157
175
|
}>;
|
|
158
176
|
|
|
159
177
|
export interface FormSubmission {
|
|
178
|
+
action: string;
|
|
179
|
+
body: FormData | URLSearchParams;
|
|
180
|
+
enctype: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
181
|
+
fetchRequest: FetchRequest;
|
|
182
|
+
formElement: HTMLFormElement;
|
|
183
|
+
isSafe: boolean;
|
|
184
|
+
location: URL;
|
|
185
|
+
method: "get" | "post" | "put" | "patch" | "delete";
|
|
160
186
|
stop(): void;
|
|
187
|
+
submitter?: HTMLButtonElement | HTMLInputElement;
|
|
161
188
|
}
|
|
162
189
|
export type FormSubmissionResult =
|
|
163
|
-
|
|
164
|
-
|
|
190
|
+
& { formSubmission: FormSubmission }
|
|
191
|
+
& (
|
|
192
|
+
| { success: true; error: undefined; fetchResponse: FetchResponse }
|
|
193
|
+
| { success: false; error?: Error; fetchResponse?: FetchResponse }
|
|
194
|
+
);
|
|
165
195
|
|
|
166
196
|
export type TurboSubmitStartEvent = CustomEvent<{
|
|
167
197
|
formSubmission: FormSubmission;
|
|
168
198
|
}>;
|
|
169
|
-
export type TurboSubmitEndEvent = CustomEvent<
|
|
170
|
-
& { formSubmission: FormSubmission }
|
|
171
|
-
& {
|
|
172
|
-
[K in keyof FormSubmissionResult]?: FormSubmissionResult[K];
|
|
173
|
-
}
|
|
174
|
-
>;
|
|
199
|
+
export type TurboSubmitEndEvent = CustomEvent<FormSubmissionResult>;
|
|
175
200
|
|
|
176
201
|
export type TurboFrameMissingEvent = CustomEvent<{
|
|
177
202
|
response: Response;
|
hotwired__turbo/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/hotwired__turbo",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
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",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {},
|
|
27
27
|
"dependencies": {},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"peerDependencies": {},
|
|
29
|
+
"typesPublisherContentHash": "e7e8688baf0bc9ac3c70be34c99fa3fb32f41fc79b6d461b011b5ed3f5fca4c0",
|
|
30
|
+
"typeScriptVersion": "5.0"
|
|
30
31
|
}
|