getOverlayFileName
FitFileViewer - API Documentation v29.9.0
FitFileViewer - API Documentation / utils/files/import/getOverlayFileName / getOverlayFileName
Function: getOverlayFileName()
getOverlayFileName(
idx:number):string
Defined in: utils/files/import/getOverlayFileName.js:43
Gets the filename for a loaded FIT file overlay by index
Safely retrieves the file path from the loaded FIT files state with proper validation. Returns an empty string if the index is out of bounds or file data is unavailable.
Parametersβ
idxβ
number
Index of the overlay file
Returnsβ
string
The filename or empty string if not found
Exampleβ
// Get filename for the first overlay file
const filename = getOverlayFileName(0);
// Handle case where file doesn't exist
const filename = getOverlayFileName(999); // Returns ""
Throwsβ
If idx is not a valid number