// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

/// Implements Json Csv Writers behavior for the Scheduler Export Json package.
library;

import 'dart:convert';

import 'package:scheduler_core/scheduler_core.dart' as core;
import 'package:scheduler_export/export.dart';
part 'json_csv_writers/export_json_context_encoder.dart';
part 'json_csv_writers/json_export_writer.dart';
part 'json_csv_writers/csv_cell_encoder.dart';
part 'json_csv_writers/csv_export_writer.dart';

/// Create the readable export writer registry used by export commands.
ExportWriterRegistry readableExportWriterRegistry() {
  core.logger
      .finer(() => 'Readable export writer registry created. formatCount=2');
  return ExportWriterRegistry(
    factories: <String, ExportWriterFactory>{
      'json': JsonExportWriter.new,
      'csv': CsvExportWriter.new,
    },
  );
}
