@tinacms/toolkit
Version:
Tina is a lightweight but powerful toolkit for creating a site editing ui with javascript components. Tina surfaces superpowers for dev’s to create, expand on and customize a simple yet intuitive ui for editing content.
14 lines (10 loc) • 508 B
TypeScript
/**
*/
import * as React from 'react';
import { Callback, CMSEvent } from '../core';
export declare function useCMSEvent<E extends CMSEvent = CMSEvent>(event: E['type'] | E['type'][], callback: Callback<E>, deps: React.DependencyList): void;
export declare const useEventSubscription: typeof useCMSEvent;
export declare function useEvent<E extends CMSEvent = CMSEvent>(eventType: E['type']): {
dispatch: (event: Omit<E, 'type'>) => void;
subscribe: (callback: (event: E) => any) => () => void;
};