"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStateAdapter = createStateAdapter;
const default_state_adapter_1 = require("./adapters/default-state-adapter");
const memory_state_adapter_1 = require("./adapters/memory-state-adapter");
const redis_state_adapter_1 = require("./adapters/redis-state-adapter");
function createStateAdapter(config) {
    const { adapter = 'redis', ...adapterConfig } = config;
    switch (adapter) {
        case 'redis':
            return new redis_state_adapter_1.RedisStateAdapter(adapterConfig);
        case 'default':
            return new default_state_adapter_1.FileStateAdapter(adapterConfig);
        case 'memory':
            return new memory_state_adapter_1.MemoryStateAdapter();
        default:
            throw new Error(`Unknown state adapter type: ${adapter}`);
    }
}
