Skip to content

Commit 539fb3f

Browse files
Sync kit docs (#1843)
sync kit docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 49505e6 commit 539fb3f

File tree

1 file changed

+54
-44
lines changed

1 file changed

+54
-44
lines changed

apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md

Lines changed: 54 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -557,14 +557,6 @@ The argument passed to [`afterNavigate`](/docs/kit/$app-navigation#afterNavigate
557557

558558
```dts
559559
type AfterNavigate = (Navigation | NavigationEnter) & {
560-
/**
561-
* The type of navigation:
562-
* - `enter`: The app has hydrated/started
563-
* - `form`: The user submitted a `<form method="GET">`
564-
* - `link`: Navigation was triggered by a link click
565-
* - `goto`: Navigation was triggered by a `goto(...)` call or a redirect
566-
* - `popstate`: Navigation was triggered by back/forward navigation
567-
*/
568560
type: Exclude<NavigationType, 'leave'>;
569561
/**
570562
* Since `afterNavigate` callbacks are called after a navigation completes, they will never be called with a navigation that unloads the page.
@@ -1706,7 +1698,7 @@ willUnload: boolean;
17061698

17071699
<div class="ts-block-property-details">
17081700

1709-
Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation)
1701+
Whether or not the navigation will result in the page being unloaded (i.e. not a client-side navigation).
17101702

17111703
</div>
17121704
</div>
@@ -1742,11 +1734,7 @@ type: 'enter';
17421734
<div class="ts-block-property-details">
17431735

17441736
The type of navigation:
1745-
- `form`: The user submitted a `<form method="GET">`
1746-
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
1747-
- `link`: Navigation was triggered by a link click
1748-
- `goto`: Navigation was triggered by a `goto(...)` call or a redirect
1749-
- `popstate`: Navigation was triggered by back/forward navigation
1737+
- `enter`: The app has hydrated/started
17501738

17511739
</div>
17521740
</div>
@@ -1846,23 +1834,42 @@ The URL of the current page
18461834
<div class="ts-block">
18471835

18481836
```dts
1849-
interface NavigationExternal extends NavigationBase {/*…*/}
1837+
type NavigationExternal = NavigationGoto | NavigationLeave;
1838+
```
1839+
1840+
</div>
1841+
1842+
## NavigationFormSubmit
1843+
1844+
<div class="ts-block">
1845+
1846+
```dts
1847+
interface NavigationFormSubmit extends NavigationBase {/*…*/}
18501848
```
18511849

18521850
<div class="ts-block-property">
18531851

18541852
```dts
1855-
type: Exclude<NavigationType, 'enter' | 'popstate' | 'link' | 'form'>;
1853+
type: 'form';
18561854
```
18571855

18581856
<div class="ts-block-property-details">
18591857

18601858
The type of navigation:
18611859
- `form`: The user submitted a `<form method="GET">`
1862-
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
1863-
- `link`: Navigation was triggered by a link click
1864-
- `goto`: Navigation was triggered by a `goto(...)` call or a redirect
1865-
- `popstate`: Navigation was triggered by back/forward navigation
1860+
1861+
</div>
1862+
</div>
1863+
1864+
<div class="ts-block-property">
1865+
1866+
```dts
1867+
event: SubmitEvent;
1868+
```
1869+
1870+
<div class="ts-block-property-details">
1871+
1872+
The `SubmitEvent` that caused the navigation
18661873

18671874
</div>
18681875
</div>
@@ -1880,41 +1887,59 @@ In case of a history back/forward navigation, the number of steps to go back/for
18801887
</div>
18811888
</div></div>
18821889

1883-
## NavigationFormSubmit
1890+
## NavigationGoto
18841891

18851892
<div class="ts-block">
18861893

18871894
```dts
1888-
interface NavigationFormSubmit extends NavigationBase {/*…*/}
1895+
interface NavigationGoto extends NavigationBase {/*…*/}
18891896
```
18901897

18911898
<div class="ts-block-property">
18921899

18931900
```dts
1894-
type: 'form';
1901+
type: 'goto';
18951902
```
18961903

18971904
<div class="ts-block-property-details">
18981905

18991906
The type of navigation:
1900-
- `form`: The user submitted a `<form method="GET">`
1901-
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
1902-
- `link`: Navigation was triggered by a link click
19031907
- `goto`: Navigation was triggered by a `goto(...)` call or a redirect
1904-
- `popstate`: Navigation was triggered by back/forward navigation
19051908

19061909
</div>
19071910
</div>
19081911

19091912
<div class="ts-block-property">
19101913

19111914
```dts
1912-
event: SubmitEvent;
1915+
delta?: undefined;
19131916
```
19141917

19151918
<div class="ts-block-property-details">
19161919

1917-
The `SubmitEvent` that caused the navigation
1920+
In case of a history back/forward navigation, the number of steps to go back/forward
1921+
1922+
</div>
1923+
</div></div>
1924+
1925+
## NavigationLeave
1926+
1927+
<div class="ts-block">
1928+
1929+
```dts
1930+
interface NavigationLeave extends NavigationBase {/*…*/}
1931+
```
1932+
1933+
<div class="ts-block-property">
1934+
1935+
```dts
1936+
type: 'leave';
1937+
```
1938+
1939+
<div class="ts-block-property-details">
1940+
1941+
The type of navigation:
1942+
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
19181943

19191944
</div>
19201945
</div>
@@ -1949,11 +1974,7 @@ type: 'link';
19491974
<div class="ts-block-property-details">
19501975

19511976
The type of navigation:
1952-
- `form`: The user submitted a `<form method="GET">`
1953-
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
19541977
- `link`: Navigation was triggered by a link click
1955-
- `goto`: Navigation was triggered by a `goto(...)` call or a redirect
1956-
- `popstate`: Navigation was triggered by back/forward navigation
19571978

19581979
</div>
19591980
</div>
@@ -2001,10 +2022,6 @@ type: 'popstate';
20012022
<div class="ts-block-property-details">
20022023

20032024
The type of navigation:
2004-
- `form`: The user submitted a `<form method="GET">`
2005-
- `leave`: The app is being left either because the tab is being closed or a navigation to a different document is occurring
2006-
- `link`: Navigation was triggered by a link click
2007-
- `goto`: Navigation was triggered by a `goto(...)` call or a redirect
20082025
- `popstate`: Navigation was triggered by back/forward navigation
20092026

20102027
</div>
@@ -2169,13 +2186,6 @@ The argument passed to [`onNavigate`](/docs/kit/$app-navigation#onNavigate) call
21692186

21702187
```dts
21712188
type OnNavigate = Navigation & {
2172-
/**
2173-
* The type of navigation:
2174-
* - `form`: The user submitted a `<form method="GET">`
2175-
* - `link`: Navigation was triggered by a link click
2176-
* - `goto`: Navigation was triggered by a `goto(...)` call or a redirect
2177-
* - `popstate`: Navigation was triggered by back/forward navigation
2178-
*/
21792189
type: Exclude<NavigationType, 'enter' | 'leave'>;
21802190
/**
21812191
* Since `onNavigate` callbacks are called immediately before a client-side navigation, they will never be called with a navigation that unloads the page.

0 commit comments

Comments
 (0)