Skip to content

Commit 5ced942

Browse files
committed
oops
1 parent 4da4898 commit 5ced942

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

packages/svelte/src/store/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @import { Readable, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable } from './public' */
2-
/** @import { Stores, SubscribeInvalidateTuple } from './private' */
2+
/** @import { Stores, StoresValues, SubscribeInvalidateTuple } from './private' */
33
import { noop, run_all } from '../internal/shared/utils.js';
44
import { safe_not_equal } from '../internal/client/reactivity/equality.js';
55
import { subscribe_to_store } from './utils.js';

packages/svelte/types/index.d.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ declare module 'svelte/motion' {
20752075
* @param run subscription callback
20762076
* @param invalidate cleanup callback
20772077
*/
2078-
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator): Unsubscriber;
2078+
subscribe(this: void, run: Subscriber<T>, invalidate?: () => void): Unsubscriber;
20792079
}
20802080
interface SpringOpts {
20812081
stiffness?: number;
@@ -2096,8 +2096,6 @@ declare module 'svelte/motion' {
20962096
easing?: (t: number) => number;
20972097
interpolate?: (a: T, b: T) => (t: number) => T;
20982098
}
2099-
/** Cleanup logic callback. */
2100-
type Invalidator = () => void;
21012099
/**
21022100
* The spring function in Svelte creates a store whose value is animated, with a motion that simulates the behavior of a spring. This means when the value changes, instead of transitioning at a steady rate, it "bounces" like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience.
21032101
*
@@ -2221,7 +2219,7 @@ declare module 'svelte/store' {
22212219
* @param run subscription callback
22222220
* @param invalidate cleanup callback
22232221
*/
2224-
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator): Unsubscriber;
2222+
subscribe(this: void, run: Subscriber<T>, invalidate?: () => void): Unsubscriber;
22252223
}
22262224

22272225
/** Writable interface for both updating and subscribing. */
@@ -2238,15 +2236,6 @@ declare module 'svelte/store' {
22382236
*/
22392237
update(this: void, updater: Updater<T>): void;
22402238
}
2241-
/** Cleanup logic callback. */
2242-
type Invalidator = () => void;
2243-
2244-
/** One or more `Readable`s. */
2245-
type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;
2246-
2247-
/** One or more values from `Readable` stores. */
2248-
type StoresValues<T> =
2249-
T extends Readable<infer U> ? U : { [K in keyof T]: T[K] extends Readable<infer U> ? U : never };
22502239
/**
22512240
* Creates a `Readable` store that allows reading by subscription.
22522241
*
@@ -2288,6 +2277,12 @@ declare module 'svelte/store' {
22882277
* https://svelte.dev/docs/svelte-store#get
22892278
* */
22902279
export function get<T>(store: Readable<T>): T;
2280+
/** One or more `Readable`s. */
2281+
type Stores = Readable<any> | [Readable<any>, ...Array<Readable<any>>] | Array<Readable<any>>;
2282+
2283+
/** One or more values from `Readable` stores. */
2284+
type StoresValues<T> =
2285+
T extends Readable<infer U> ? U : { [K in keyof T]: T[K] extends Readable<infer U> ? U : never };
22912286

22922287
export { Subscriber, Unsubscriber, Updater, StartStopNotifier, Readable, Writable };
22932288
}

0 commit comments

Comments
 (0)