/*
 * Copyright (c) 2026 Meshtastic LLC
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package org.meshtastic.feature.discovery.export

import androidx.compose.runtime.Composable

/**
 * Returns a launcher that saves [ExportResult.Success] content to the platform's file system.
 *
 * On Android this opens a SAF document-picker (ACTION_CREATE_DOCUMENT). On Desktop this writes to a user-chosen file
 * via a file dialog.
 */
@Composable expect fun rememberExportSaver(): ExportSaverLauncher

/** Platform-agnostic handle for triggering a file-save from export data. */
fun interface ExportSaverLauncher {
    fun save(result: ExportResult.Success)
}
