File tree Expand file tree Collapse file tree
apps/desktop/src/routes/editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ function TranscriptEditor(props: {
465465 } else {
466466 props . onDeleteWords ( indices ) ;
467467 }
468- setSelectedIndices ( new Set ( ) ) ;
468+ setSelectedIndices ( new Set < number > ( ) ) ;
469469 setAnchorIndex ( - 1 ) ;
470470 } else if ( e . key === "ArrowLeft" ) {
471471 e . preventDefault ( ) ;
@@ -488,7 +488,7 @@ function TranscriptEditor(props: {
488488
489489 const handleContainerClick = ( e : MouseEvent ) => {
490490 if ( e . target === scrollContainerRef ) {
491- setSelectedIndices ( new Set ( ) ) ;
491+ setSelectedIndices ( new Set < number > ( ) ) ;
492492 setAnchorIndex ( - 1 ) ;
493493 }
494494 } ;
@@ -544,7 +544,7 @@ function TranscriptEditor(props: {
544544 } else {
545545 props . onDeleteWord ( flatIndexOf ( word ) ) ;
546546 }
547- setSelectedIndices ( new Set ( ) ) ;
547+ setSelectedIndices ( new Set < number > ( ) ) ;
548548 setAnchorIndex ( - 1 ) ;
549549 } ;
550550
Original file line number Diff line number Diff line change @@ -69,17 +69,19 @@ export type LayoutMode = { type: "export" } | { type: "transcript" };
6969export type CurrentDialog = ModalDialog | LayoutMode ;
7070
7171export type DialogState = { open : false } | ( { open : boolean } & CurrentDialog ) ;
72+ export type OpenLayoutMode = { open : true } & LayoutMode ;
73+ export type OpenModalDialog = { open : true } & ModalDialog ;
7274
7375const LAYOUT_MODE_TYPES : Set < CurrentDialog [ "type" ] > = new Set ( [
7476 "export" ,
7577 "transcript" ,
7678] ) ;
7779
78- export function isLayoutMode ( d : DialogState ) : boolean {
80+ export function isLayoutMode ( d : DialogState ) : d is OpenLayoutMode {
7981 return d . open && "type" in d && LAYOUT_MODE_TYPES . has ( d . type ) ;
8082}
8183
82- export function isModalDialog ( d : DialogState ) : boolean {
84+ export function isModalDialog ( d : DialogState ) : d is OpenModalDialog {
8385 return d . open && "type" in d && ! LAYOUT_MODE_TYPES . has ( d . type ) ;
8486}
8587
You can’t perform that action at this time.
0 commit comments