UNPKG

@stated-library/base

Version:
9 lines (8 loc) 654 B
import { StatedLibraryInterface } from '@stated-library/interface'; import { LibOpts, GetUpdates } from './StatedLib'; declare type GetMethods<Methods, State, RawState, Meta> = (base: { updateState: (update: Partial<RawState> | GetUpdates<State, RawState>, event: string, meta?: Meta) => void; base: StatedLibraryInterface<RawState, State, Meta>; }) => Methods; export declare function createStatedLib<RawState, Meta, Methods, State = RawState>(initialState: RawState, methodsOrGetMethods: GetMethods<Methods, State, RawState, Meta> | Methods, opts?: LibOpts<RawState, State>): StatedLibraryInterface<RawState, State, Meta> & Methods; export {};