@sberdevices/plasma-temple
Version:
SberDevices CanvasApp Templates.
38 lines • 1.35 kB
TypeScript
import React from 'react';
import { Axis } from '../types';
declare type ShortKey = 'UP' | 'DOWN' | 'LEFT' | 'RIGHT' | 'OK';
declare type LongKey = 'LONG_UP' | 'LONG_DOWN' | 'LONG_LEFT' | 'LONG_RIGHT' | 'LONG_OK';
export declare type RemoteKey = ShortKey | LongKey;
interface UseRemoteListenerProps {
keypressTimeMs?: number;
disable?: boolean;
}
interface UseRemoteListenerCallback {
(key: RemoteKey, event: KeyboardEvent): void;
}
interface UseRemoteListenerProps {
keypressTimeMs?: number;
disable?: boolean;
}
export declare const useRemoteListener: (cb: UseRemoteListenerCallback, params: UseRemoteListenerProps) => void;
declare const throttlingParamsDefault: {
leading: boolean;
trailing: boolean;
};
interface UseRemoteHandlersProps {
initialIndex: number;
axis: Axis;
delay?: number;
longDelay?: number;
min: number;
max: number;
count?: number;
longCount?: number;
throttlingParams?: typeof throttlingParamsDefault;
detectCondition?: boolean;
disable?: boolean;
repeat?: boolean;
}
export declare function useRemoteHandlers({ initialIndex, axis, delay, longDelay, min, max, count, longCount, throttlingParams, disable, repeat, }: UseRemoteHandlersProps): [number, React.Dispatch<React.SetStateAction<number>>];
export {};
//# sourceMappingURL=useRemoteHandlers.d.ts.map