/** * Copyright (c) Openizr. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ declare module '@perseid/store/connectors/svelte' { import { type Readable } from 'svelte/store'; import Store, { type Reducer } from '@perseid/store'; /** * Registers a new subscription to the specified module. * * @param moduleId Id of the module to subscribe to. * * @param reducer Optional state reducer. Allows you to transform the new state to * get exactly what you need. Defaults to the identify function. * * @returns Reduced state. */ export type UseSubscription = (id: string, reducer?: Reducer) => Readable; /** * Initializes a Svelte connection to `store`. * * @param store Perseid store to connect Svelte to. * * @returns `useSubscription` function. */ export default function connect(store: Store): UseSubscription; }