Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export store's useful typescript definitions - close #5864 #5887

Merged
merged 12 commits into from
Mar 24, 2021
8 changes: 4 additions & 4 deletions src/runtime/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { run_all, subscribe, noop, safe_not_equal, is_function, get_store_value } from 'svelte/internal';

/** Callback to inform of a value updates. */
type Subscriber<T> = (value: T) => void;
export type Subscriber<T> = (value: T) => void;

/** Unsubscribes from value updates. */
type Unsubscriber = () => void;
export type Unsubscriber = () => void;

/** Callback to update a value. */
type Updater<T> = (value: T) => T;
export type Updater<T> = (value: T) => T;

/** Cleanup logic callback. */
type Invalidator<T> = (value?: T) => void;
dummdidumm marked this conversation as resolved.
Show resolved Hide resolved

/** Start and stop notification callbacks. */
type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;
export type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;

/** Readable interface for subscribing. */
export interface Readable<T> {
Expand Down