@refinedev/core
Version:
Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.
36 lines • 1.22 kB
TypeScript
import type { BaseKey, CrudFilter, CrudSort, MetaQuery } from "../../../contexts/data/types";
import type { LiveEvent } from "../../../contexts/live/types";
export type UseSubscriptionProps = {
/**
* Channel name to subscribe.
*/
channel: string;
/**
* Callback that is run when new events from subscription arrive.
*/
onLiveEvent: (event: LiveEvent) => void;
/**
* Type of events to subscribe. `"*"` means all events.
* @type Array<"deleted" | "updated" | "created" | "*" | string>
*/
types?: LiveEvent["type"][];
/**
* Determines subscription should subscribe or not.
* @type Array<"deleted" | "updated" | "created" | "*" | string>
*/
enabled?: boolean;
params?: {
ids?: BaseKey[];
id?: BaseKey;
sorters?: CrudSort[];
filters?: CrudFilter[];
subscriptionType?: "useList" | "useOne" | "useMany";
resource?: string;
[key: string]: any;
};
meta?: MetaQuery & {
dataProviderName?: string;
};
};
export declare const useSubscription: ({ params, channel, types, enabled, onLiveEvent, meta, }: UseSubscriptionProps) => void;
//# sourceMappingURL=index.d.ts.map