UNPKG

@cfcs/core

Version:

Write once, create framework components that supports React, Vue, Svelte, and more.

19 lines (18 loc) 913 B
import { ReactiveAdapterParam } from "./ReactiveAdapter"; import { ReactiveSubscribe } from "./decorators/ReactiveSubscribe"; import { ReactiveEventCallback, ReactiveState } from "./types"; /** * @category Reactive * @hidden */ export declare function adaptReactive<Instance extends ReactiveSubscribe<Record<string, any>>, State extends Record<string, any> = ReactiveState<Instance>, Methods extends keyof Partial<Instance> = never, Props = any, Events extends Record<string, any> = {}>(adapter: ReactiveAdapterParam<Instance, State, Methods, Props, Events>, props?: () => Props): { events: () => readonly (keyof Events)[]; state(): State; instance(): Instance; mounted(): void; init(): void; destroy(): void; methods(): any; on(eventName: string, listener: ReactiveEventCallback<any, any>): void; off(eventName: string, listener: ReactiveEventCallback<any, any>): void; };