Fix temporal dead zone error in exports
Changed exports to use export { } syntax after function definitions
to avoid 'cannot access before initialization' error.
Moved export statements to end of file where all functions are defined.
This commit is contained in:
@ -706,20 +706,15 @@ window.removeIndicator = function() {
|
||||
removeIndicatorById(configuringId);
|
||||
};
|
||||
|
||||
// Export functions for module imports
|
||||
export const addIndicator = window.addIndicator;
|
||||
export const removeIndicatorById = window.removeIndicatorById;
|
||||
|
||||
// Helper function for remove by index
|
||||
export function removeIndicatorByIndex(index) {
|
||||
if (index < 0 || index >= activeIndicators.length) return;
|
||||
removeIndicatorById(activeIndicators[index].id);
|
||||
}
|
||||
|
||||
// Assign to window for backward compatibility
|
||||
window.toggleIndicator = window.addIndicator;
|
||||
window.removeIndicatorByIndex = removeIndicatorByIndex;
|
||||
window.removeIndicatorByIndex = function(index) {
|
||||
if (index < 0 || index >= activeIndicators.length) return;
|
||||
removeIndicatorById(activeIndicators[index].id);
|
||||
};
|
||||
window.drawIndicatorsOnChart = drawIndicatorsOnChart;
|
||||
|
||||
// No additional window assignments needed - functions are already on window
|
||||
// Exports are now available for module import
|
||||
// Export functions for module imports
|
||||
export { window.addIndicator as addIndicator };
|
||||
export { window.removeIndicatorById as removeIndicatorById };
|
||||
export { window.removeIndicatorByIndex as removeIndicatorByIndex };
|
||||
Reference in New Issue
Block a user