@@ -434,6 +434,11 @@ declare module 'svelte' {
434434 * @deprecated Use [`$effect`](https://svelte.dev/docs/svelte/$effect) instead
435435 * */
436436 export function afterUpdate ( fn : ( ) => void ) : void ;
437+ /**
438+ * Synchronously flush any pending updates.
439+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
440+ * */
441+ export function flushSync < T = void > ( fn ?: ( ( ) => T ) | undefined ) : T ;
437442 /**
438443 * Create a snippet programmatically
439444 * */
@@ -443,34 +448,6 @@ declare module 'svelte' {
443448 } ) : Snippet < Params > ;
444449 /** Anything except a function */
445450 type NotFunction < T > = T extends Function ? never : T ;
446- /**
447- * Synchronously flush any pending updates.
448- * Returns void if no callback is provided, otherwise returns the result of calling the callback.
449- * */
450- export function flushSync < T = void > ( fn ?: ( ( ) => T ) | undefined ) : T ;
451- /**
452- * Returns a promise that resolves once any pending state changes have been applied.
453- * */
454- export function tick ( ) : Promise < void > ;
455- /**
456- * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,
457- * have resolved and the DOM has been updated
458- * */
459- export function settled ( ) : Promise < void > ;
460- /**
461- * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
462- * any state read inside `fn` will not be treated as a dependency.
463- *
464- * ```ts
465- * $effect(() => {
466- * // this will run when `data` changes, but not when `time` changes
467- * save(data, {
468- * timestamp: untrack(() => time)
469- * });
470- * });
471- * ```
472- * */
473- export function untrack < T > ( fn : ( ) => T ) : T ;
474451 /**
475452 * Retrieves the context that belongs to the closest parent component with the specified `key`.
476453 * Must be called during component initialisation.
@@ -544,6 +521,29 @@ declare module 'svelte' {
544521 export function unmount ( component : Record < string , any > , options ?: {
545522 outro ?: boolean ;
546523 } | undefined ) : Promise < void > ;
524+ /**
525+ * Returns a promise that resolves once any pending state changes have been applied.
526+ * */
527+ export function tick ( ) : Promise < void > ;
528+ /**
529+ * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,
530+ * have resolved and the DOM has been updated
531+ * */
532+ export function settled ( ) : Promise < void > ;
533+ /**
534+ * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
535+ * any state read inside `fn` will not be treated as a dependency.
536+ *
537+ * ```ts
538+ * $effect(() => {
539+ * // this will run when `data` changes, but not when `time` changes
540+ * save(data, {
541+ * timestamp: untrack(() => time)
542+ * });
543+ * });
544+ * ```
545+ * */
546+ export function untrack < T > ( fn : ( ) => T ) : T ;
547547 type Getters < T > = {
548548 [ K in keyof T ] : ( ) => T [ K ] ;
549549 } ;
0 commit comments