diff --git a/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md b/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md index 973c5252e2..c91a17a065 100644 --- a/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md +++ b/apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md @@ -7,6 +7,7 @@ title: @sveltejs/kit ```js // @noErrors import { + Server, VERSION, error, fail, @@ -19,6 +20,43 @@ import { } from '@sveltejs/kit'; ``` +## Server + +
+ +```dts +class Server {/*…*/} +``` + +
+ +```dts +constructor(manifest: SSRManifest); +``` + +
+
+ +
+ +```dts +init(options: ServerInitOptions): Promise; +``` + +
+
+ +
+ +```dts +respond(request: Request, options: RequestOptions): Promise; +``` + +
+
+ + + ## VERSION
@@ -94,7 +132,9 @@ Checks whether this is an action failure thrown by `fail`.
```dts -function isActionFailure(e: unknown): e is ActionFailure; +function isActionFailure( + e: unknown +): e is ActionFailure; ```
@@ -2303,41 +2343,6 @@ A `[file]: size` map of all assets imported by server code
-## Server - -
- -```dts -class Server {/*…*/} -``` - -
- -```dts -constructor(manifest: SSRManifest); -``` - -
-
- -
- -```dts -init(options: ServerInitOptions): Promise; -``` - -
-
- -
- -```dts -respond(request: Request, options: RequestOptions): Promise; -``` - -
-
- ## ServerInitOptions
diff --git a/apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md b/apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md index e647351f91..6eb9cc5122 100644 --- a/apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md +++ b/apps/svelte.dev/content/docs/svelte/98-reference/20-svelte.md @@ -7,6 +7,8 @@ title: svelte ```js // @noErrors import { + SvelteComponent, + SvelteComponentTyped, afterUpdate, beforeUpdate, createEventDispatcher, @@ -26,6 +28,148 @@ import { } from 'svelte'; ``` +## SvelteComponent + +This was the base class for Svelte components in Svelte 4. Svelte 5+ components +are completely different under the hood. For typing, use `Component` instead. +To instantiate components, use `mount` instead`. +See [migration guide](/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info. + +
+ +```dts +class SvelteComponent< + Props extends Record = Record, + Events extends Record = any, + Slots extends Record = any +> {/*…*/} +``` + +
+ +```dts +static element?: typeof HTMLElement; +``` + +
+ +The custom element version of the component. Only present if compiled with the `customElement` compiler option + +
+
+ +
+ +```dts +[prop: string]: any; +``` + +
+
+ +
+ +```dts +constructor(options: ComponentConstructorOptions>); +``` + +
+ +
+ +- deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which +is a stop-gap solution. Migrate towards using `mount` instead. See +https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more info. + +
+ +
+
+ +
+ +```dts +$destroy(): void; +``` + +
+ +
+ +- deprecated This method only exists when using one of the legacy compatibility helpers, which +is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes +for more info. + +
+ +
+
+ +
+ +```dts +$on>( + type: K, + callback: (e: Events[K]) => void +): () => void; +``` + +
+ +
+ +- deprecated This method only exists when using one of the legacy compatibility helpers, which +is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes +for more info. + +
+ +
+
+ +
+ +```dts +$set(props: Partial): void; +``` + +
+ +
+ +- deprecated This method only exists when using one of the legacy compatibility helpers, which +is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes +for more info. + +
+ +
+
+ + + +## SvelteComponentTyped + +
+ +Use `Component` instead. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more information. + +
+ +
+ +```dts +class SvelteComponentTyped< + Props extends Record = Record, + Events extends Record = any, + Slots extends Record = any +> extends SvelteComponent {} +``` + +
+ + + ## afterUpdate
@@ -758,142 +902,4 @@ interface Snippet {/*…*/}
-## SvelteComponent - -This was the base class for Svelte components in Svelte 4. Svelte 5+ components -are completely different under the hood. For typing, use `Component` instead. -To instantiate components, use `mount` instead`. -See [migration guide](/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more info. - -
- -```dts -class SvelteComponent< - Props extends Record = Record, - Events extends Record = any, - Slots extends Record = any -> {/*…*/} -``` - -
- -```dts -static element?: typeof HTMLElement; -``` - -
- -The custom element version of the component. Only present if compiled with the `customElement` compiler option - -
-
- -
- -```dts -[prop: string]: any; -``` - -
-
- -
- -```dts -constructor(options: ComponentConstructorOptions>); -``` - -
- -
- -- deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which -is a stop-gap solution. Migrate towards using `mount` instead. See -https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more info. - -
- -
-
- -
- -```dts -$destroy(): void; -``` - -
- -
- -- deprecated This method only exists when using one of the legacy compatibility helpers, which -is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes -for more info. - -
- -
-
- -
- -```dts -$on>( - type: K, - callback: (e: Events[K]) => void -): () => void; -``` - -
- -
- -- deprecated This method only exists when using one of the legacy compatibility helpers, which -is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes -for more info. - -
- -
-
- -
- -```dts -$set(props: Partial): void; -``` - -
- -
- -- deprecated This method only exists when using one of the legacy compatibility helpers, which -is a stop-gap solution. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes -for more info. - -
- -
-
- -## SvelteComponentTyped - -
- -Use `Component` instead. See [migration guide](https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes) for more information. - -
- -
- -```dts -class SvelteComponentTyped< - Props extends Record = Record, - Events extends Record = any, - Slots extends Record = any -> extends SvelteComponent {} -``` - -
- diff --git a/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-reactivity.md b/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-reactivity.md index b6ada6638a..0106ee1ea0 100644 --- a/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-reactivity.md +++ b/apps/svelte.dev/content/docs/svelte/98-reference/21-svelte-reactivity.md @@ -22,6 +22,19 @@ Svelte provides reactive versions of various built-ins like `SvelteMap`, `Svelte ``` + + +```js +// @noErrors +import { + SvelteDate, + SvelteMap, + SvelteSet, + SvelteURL, + SvelteURLSearchParams +} from 'svelte/reactivity'; +``` + ## SvelteDate
@@ -48,6 +61,8 @@ constructor(...params: any[]);
+ + ## SvelteMap
@@ -83,6 +98,8 @@ set(key: K, value: V): this;
+ + ## SvelteSet
@@ -118,6 +135,8 @@ add(value: T): this;
+ + ## SvelteURL
@@ -144,6 +163,8 @@ get searchParams(): SvelteURLSearchParams;
+ + ## SvelteURLSearchParams
@@ -171,3 +192,5 @@ class SvelteURLSearchParams extends URLSearchParams {/*…*/}
+ + diff --git a/apps/svelte.dev/scripts/sync-docs/types.ts b/apps/svelte.dev/scripts/sync-docs/types.ts index 592b0ed21c..c46507dd93 100644 --- a/apps/svelte.dev/scripts/sync-docs/types.ts +++ b/apps/svelte.dev/scripts/sync-docs/types.ts @@ -152,7 +152,9 @@ export async function get_types(code: string, statements: ts.NodeArray