import { Cell } from '@ephox/katamari';
import { nuState } from '../common/BehaviourState';
const throttle = (_config) => {
    const state = Cell(null);
    const readState = () => ({
        timer: state.get() !== null ? 'set' : 'unset'
    });
    const setTimer = (t) => {
        state.set(t);
    };
    const cancel = () => {
        const t = state.get();
        if (t !== null) {
            t.cancel();
        }
    };
    return nuState({
        readState,
        setTimer,
        cancel
    });
};
const init = (spec) => spec.stream.streams.state(spec);
export { throttle, init };
//# sourceMappingURL=StreamingState.js.map