@@ -408,10 +408,6 @@ declare module 'svelte' {
408408 * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead
409409 * */
410410 export function afterUpdate ( fn : ( ) => void ) : void ;
411- /**
412- * Synchronously flushes any pending state changes and those that result from it.
413- * */
414- export function flushSync ( fn ?: ( ( ) => void ) | undefined ) : void ;
415411 /**
416412 * Create a snippet programmatically
417413 * */
@@ -421,6 +417,29 @@ declare module 'svelte' {
421417 } ) : Snippet < Params > ;
422418 /** Anything except a function */
423419 type NotFunction < T > = T extends Function ? never : T ;
420+ /**
421+ * Synchronously flush any pending updates.
422+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
423+ * */
424+ export function flushSync < T = void > ( fn ?: ( ( ) => T ) | undefined ) : T extends void ? void : T ;
425+ /**
426+ * Returns a promise that resolves once any pending state changes have been applied.
427+ * */
428+ export function tick ( ) : Promise < void > ;
429+ /**
430+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
431+ * any state read inside `fn` will not be treated as a dependency.
432+ *
433+ * ```ts
434+ * $effect(() => {
435+ * // this will run when `data` changes, but not when `time` changes
436+ * save(data, {
437+ * timestamp: untrack(() => time)
438+ * });
439+ * });
440+ * ```
441+ * */
442+ export function untrack < T > ( fn : ( ) => T ) : T ;
424443 /**
425444 * Retrieves the context that belongs to the closest parent component with the specified `key`.
426445 * Must be called during component initialisation.
@@ -494,24 +513,6 @@ declare module 'svelte' {
494513 export function unmount ( component : Record < string , any > , options ?: {
495514 outro ?: boolean ;
496515 } | undefined ) : Promise < void > ;
497- /**
498- * Returns a promise that resolves once any pending state changes have been applied.
499- * */
500- export function tick ( ) : Promise < void > ;
501- /**
502- * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
503- * any state read inside `fn` will not be treated as a dependency.
504- *
505- * ```ts
506- * $effect(() => {
507- * // this will run when `data` changes, but not when `time` changes
508- * save(data, {
509- * timestamp: untrack(() => time)
510- * });
511- * });
512- * ```
513- * */
514- export function untrack < T > ( fn : ( ) => T ) : T ;
515516 type Getters < T > = {
516517 [ K in keyof T ] : ( ) => T [ K ] ;
517518 } ;
0 commit comments