Skip to content

Commit b36f65a

Browse files
Rich-Harrismrkishi
andauthored
rename LoadInput to LoadEvent (#5015)
* rename LoadInput to LoadEvent - closes #4965 * Update packages/kit/types/index.d.ts Co-authored-by: Maurício Kishi <[email protected]> * Update packages/kit/types/index.d.ts Co-authored-by: Maurício Kishi <[email protected]> Co-authored-by: Maurício Kishi <[email protected]>
1 parent 7d9d9c4 commit b36f65a

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.changeset/nine-kangaroos-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
[breaking] Rename LoadInput to LoadEvent

packages/kit/src/runtime/client/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ export function create_client({ target, session, base, trailing_slash }) {
552552
const session = $session;
553553

554554
if (module.load) {
555-
/** @type {import('types').LoadInput} */
555+
/** @type {import('types').LoadEvent} */
556556
const load_input = {
557557
routeId,
558558
params: uses_params,

packages/kit/src/runtime/server/page/load_node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function load_node({
8181
redirect: shadow.redirect
8282
};
8383
} else if (module.load) {
84-
/** @type {import('types').LoadInput} */
84+
/** @type {import('types').LoadEvent} */
8585
const load_input = {
8686
url: state.prerendering ? create_prerendering_url_proxy(event.url) : event.url,
8787
params: event.params,

packages/kit/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export interface HandleError {
173173
}
174174

175175
/**
176-
* The `(input: LoadInput) => LoadOutput` `load` function exported from `<script context="module">` in a page or layout.
176+
* The `(event: LoadEvent) => LoadOutput` `load` function exported from `<script context="module">` in a page or layout.
177177
*
178178
* Note that you can use [generated types](/docs/types#generated-types) instead of manually specifying the Params generic argument.
179179
*/
@@ -182,10 +182,10 @@ export interface Load<
182182
InputProps extends Record<string, any> = Record<string, any>,
183183
OutputProps extends Record<string, any> = InputProps
184184
> {
185-
(input: LoadInput<Params, InputProps>): MaybePromise<LoadOutput<OutputProps>>;
185+
(event: LoadEvent<Params, InputProps>): MaybePromise<LoadOutput<OutputProps>>;
186186
}
187187

188-
export interface LoadInput<
188+
export interface LoadEvent<
189189
Params extends Record<string, string> = Record<string, string>,
190190
Props extends Record<string, any> = Record<string, any>
191191
> {

0 commit comments

Comments
 (0)