mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-24 11:22:34 +01:00
fix types
This commit is contained in:
parent
f4cfe72b4b
commit
2452de6de5
@ -11,7 +11,7 @@ import Switch from './Switch';
|
||||
import useUserSettings from '../hooks/useUserSettings';
|
||||
import { askForFfPath } from '../dialogs';
|
||||
import { isMasBuild, isStoreBuild } from '../util';
|
||||
import { LanguageKey, TimecodeFormat, langNames } from '../../../../types';
|
||||
import { LanguageKey, ModifierKey, TimecodeFormat, langNames } from '../../../../types';
|
||||
import styles from './Settings.module.css';
|
||||
import Select from './Select';
|
||||
|
||||
@ -365,7 +365,7 @@ function Settings({
|
||||
<Row>
|
||||
<KeyCell>{t('Mouse wheel zoom modifier key')}</KeyCell>
|
||||
<td>
|
||||
<Select value={mouseWheelZoomModifierKey} onChange={(e) => setMouseWheelZoomModifierKey(e.target.value)}>
|
||||
<Select value={mouseWheelZoomModifierKey} onChange={(e) => setMouseWheelZoomModifierKey(e.target.value as ModifierKey)}>
|
||||
{Object.entries(getModifierKeyNames()).map(([key, values]) => (
|
||||
<option key={key} value={key}>{values.join(' / ')}</option>
|
||||
))}
|
||||
|
@ -2,6 +2,7 @@ import { WheelEventHandler, useCallback } from 'react';
|
||||
import { t } from 'i18next';
|
||||
|
||||
import normalizeWheel from './normalizeWheel';
|
||||
import { ModifierKey } from '../../../../types';
|
||||
|
||||
export const keyMap = {
|
||||
ctrl: 'ctrlKey',
|
||||
@ -17,10 +18,10 @@ export const getModifierKeyNames = () => ({
|
||||
meta: [t('⌘ Cmd'), t('⊞ Win')],
|
||||
});
|
||||
|
||||
export const getModifier = (key) => getModifierKeyNames()[key];
|
||||
export const getModifier = (key: ModifierKey) => getModifierKeyNames()[key];
|
||||
|
||||
function useTimelineScroll({ wheelSensitivity, mouseWheelZoomModifierKey, invertTimelineScroll, zoomRel, seekRel }: {
|
||||
wheelSensitivity: number, mouseWheelZoomModifierKey: string, invertTimelineScroll?: boolean | undefined, zoomRel: (a: number) => void, seekRel: (a: number) => void,
|
||||
wheelSensitivity: number, mouseWheelZoomModifierKey: ModifierKey, invertTimelineScroll?: boolean | undefined, zoomRel: (a: number) => void, seekRel: (a: number) => void,
|
||||
}) {
|
||||
const onWheel = useCallback<WheelEventHandler<Element>>((e) => {
|
||||
const { pixelX, pixelY } = normalizeWheel(e);
|
||||
|
5
types.ts
5
types.ts
@ -42,6 +42,9 @@ export type TimecodeFormat = 'timecodeWithDecimalFraction' | 'frameCount' | 'tim
|
||||
|
||||
export type AvoidNegativeTs = 'make_zero' | 'auto' | 'make_non_negative' | 'disabled';
|
||||
|
||||
export type ModifierKey = 'ctrl' | 'shift' | 'alt' | 'meta';
|
||||
|
||||
|
||||
export interface Config {
|
||||
captureFormat: CaptureFormat,
|
||||
customOutDir: string | undefined,
|
||||
@ -87,7 +90,7 @@ export interface Config {
|
||||
customFfPath: string | undefined,
|
||||
storeProjectInWorkingDir: boolean,
|
||||
enableOverwriteOutput: boolean,
|
||||
mouseWheelZoomModifierKey: string,
|
||||
mouseWheelZoomModifierKey: ModifierKey,
|
||||
captureFrameMethod: 'videotag' | 'ffmpeg',
|
||||
captureFrameQuality: number,
|
||||
captureFrameFileNameFormat: 'timestamp' | 'index',
|
||||
|
Loading…
Reference in New Issue
Block a user