export store's useful typescript definitions

the store has some internal types that are useful and should be exported
to help consumer apps typing their store implementations.
pull/5887/head
hantatsang 6 years ago
parent 8180c5dd6c
commit 45d4f2c0db

@ -1,19 +1,19 @@
import { run_all, subscribe, noop, safe_not_equal, is_function, get_store_value } from 'svelte/internal'; import { run_all, subscribe, noop, safe_not_equal, is_function, get_store_value } from 'svelte/internal';
/** Callback to inform of a value updates. */ /** Callback to inform of a value updates. */
type Subscriber<T> = (value: T) => void; export type Subscriber<T> = (value: T) => void;
/** Unsubscribes from value updates. */ /** Unsubscribes from value updates. */
type Unsubscriber = () => void; export type Unsubscriber = () => void;
/** Callback to update a value. */ /** Callback to update a value. */
type Updater<T> = (value: T) => T; export type Updater<T> = (value: T) => T;
/** Cleanup logic callback. */ /** Cleanup logic callback. */
type Invalidator<T> = (value?: T) => void; export type Invalidator<T> = (value?: T) => void;
/** Start and stop notification callbacks. */ /** 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. */ /** Readable interface for subscribing. */
export interface Readable<T> { export interface Readable<T> {

Loading…
Cancel
Save