mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	chore(client/print): fix typecheck issues
This commit is contained in:
		
							parent
							
								
									29d6784c59
								
							
						
					
					
						commit
						acae069b9e
					
				@ -1,4 +1,3 @@
 | 
				
			|||||||
import type child_process from "child_process";
 | 
					 | 
				
			||||||
import { describe, beforeAll, afterAll } from "vitest";
 | 
					import { describe, beforeAll, afterAll } from "vitest";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let etapiAuthToken: string | undefined;
 | 
					let etapiAuthToken: string | undefined;
 | 
				
			||||||
@ -12,8 +11,6 @@ type SpecDefinitionsFunc = () => void;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function describeEtapi(description: string, specDefinitions: SpecDefinitionsFunc): void {
 | 
					function describeEtapi(description: string, specDefinitions: SpecDefinitionsFunc): void {
 | 
				
			||||||
    describe(description, () => {
 | 
					    describe(description, () => {
 | 
				
			||||||
        let appProcess: ReturnType<typeof child_process.spawn>;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        beforeAll(async () => {});
 | 
					        beforeAll(async () => {});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        afterAll(() => {});
 | 
					        afterAll(() => {});
 | 
				
			||||||
 | 
				
			|||||||
@ -23,7 +23,7 @@ interface NoteListProps {
 | 
				
			|||||||
    isEnabled: boolean;
 | 
					    isEnabled: boolean;
 | 
				
			||||||
    ntxId: string | null | undefined;
 | 
					    ntxId: string | null | undefined;
 | 
				
			||||||
    media: ViewModeMedia;
 | 
					    media: ViewModeMedia;
 | 
				
			||||||
    onReady: () => void;
 | 
					    onReady?: () => void;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function NoteList<T extends object>(props: Pick<NoteListProps, "displayOnlyCollections" | "media" | "onReady">) {
 | 
					export default function NoteList<T extends object>(props: Pick<NoteListProps, "displayOnlyCollections" | "media" | "onReady">) {
 | 
				
			||||||
@ -36,7 +36,7 @@ export function SearchNoteList<T extends object>(props: Omit<NoteListProps, "isE
 | 
				
			|||||||
    return <CustomNoteList {...props} isEnabled={true} />
 | 
					    return <CustomNoteList {...props} isEnabled={true} />
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, ...restProps }: NoteListProps) {
 | 
					export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, onReady, ...restProps }: NoteListProps) {
 | 
				
			||||||
    const widgetRef = useRef<HTMLDivElement>(null);
 | 
					    const widgetRef = useRef<HTMLDivElement>(null);
 | 
				
			||||||
    const viewType = useNoteViewType(note);
 | 
					    const viewType = useNoteViewType(note);
 | 
				
			||||||
    const noteIds = useNoteIds(note, viewType, ntxId);
 | 
					    const noteIds = useNoteIds(note, viewType, ntxId);
 | 
				
			||||||
@ -79,6 +79,7 @@ export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable
 | 
				
			|||||||
            highlightedTokens,
 | 
					            highlightedTokens,
 | 
				
			||||||
            viewConfig: viewModeConfig[0],
 | 
					            viewConfig: viewModeConfig[0],
 | 
				
			||||||
            saveConfig: viewModeConfig[1],
 | 
					            saveConfig: viewModeConfig[1],
 | 
				
			||||||
 | 
					            onReady: onReady ?? (() => {}),
 | 
				
			||||||
            ...restProps
 | 
					            ...restProps
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user