/*
    Scanbot SDK ReactNative Module
    Copyright (c) 2017 doo GmbH. All rights reserved.
*/
package io.scanbot.sdk.reactnative;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import io.scanbot.sdk.reactnative.components.barcodecameraview.ScanbotBarcodeCameraViewManager;
import io.scanbot.sdk.reactnative.internal.ScanbotInternal;
import io.scanbot.sdk.reactnative.ui.DefaultUiModule;

public class ScanbotSDKPackage implements ReactPackage {

    @Override
    public List<NativeModule> createNativeModules(
            ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new ScanbotSDKReactNative(reactContext));
        modules.add(new DefaultUiModule(reactContext));
        modules.add(new ScanbotInternal(reactContext));

        return modules;
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Arrays.asList(new ViewManager[]{
            new ScanbotBarcodeCameraViewManager(reactContext)
        });
    }

}
