// Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
// Use of this source code is governed by a Apache-2.0 license that can be
// found in the LICENSE file.

import { RNOHPackage, ComponentBuilderContext } from '@rnoh/react-native-openharmony';
import type {DescriptorWrapperFactoryByDescriptorTypeCtx, DescriptorWrapperFactoryByDescriptorType} from '@rnoh/react-native-openharmony/ts';
import { RNC } from './generated/ts';
import { LottieTurboAnimationView } from './LottieTurboAnimationView'

@Builder
function buildLottieTurboAnimationView(ctx: ComponentBuilderContext) {
  LottieTurboAnimationView({ ctx: ctx.rnComponentContext, tag: ctx.tag, })
}

export class LottieTurboAnimationViewPackage extends RNOHPackage {
  createDescriptorWrapperFactoryByDescriptorType(ctx:
          DescriptorWrapperFactoryByDescriptorTypeCtx):
          DescriptorWrapperFactoryByDescriptorType {
    return {
      LottieTurboAnimationView: (ctx) => new RNC.LottieTurboAnimationView.DescriptorWrapper(ctx.descriptor)
    }
  }
  createWrappedCustomRNComponentBuilderByComponentNameMap(): Map<string, WrappedBuilder<[ComponentBuilderContext]>> {
    return new Map().set(LottieTurboAnimationView.NAME, wrapBuilder(buildLottieTurboAnimationView))
  }
}