/// /// Variant_ImageOverlay_TextOverlay.kt /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © Marc Rousavy @ Margelo /// package com.margelo.nitro.videopipeline import com.facebook.proguard.annotations.DoNotStrip /** * Represents the TypeScript variant "ImageOverlay | TextOverlay". */ @Suppress("ClassName") @DoNotStrip sealed class Variant_ImageOverlay_TextOverlay { @DoNotStrip data class First(@DoNotStrip val value: ImageOverlay): Variant_ImageOverlay_TextOverlay() @DoNotStrip data class Second(@DoNotStrip val value: TextOverlay): Variant_ImageOverlay_TextOverlay() val isFirst: Boolean get() = this is First val isSecond: Boolean get() = this is Second fun asFirstOrNull(): ImageOverlay? { val value = (this as? First)?.value ?: return null return value } fun asSecondOrNull(): TextOverlay? { val value = (this as? Second)?.value ?: return null return value } inline fun match(first: (ImageOverlay) -> R, second: (TextOverlay) -> R): R { return when (this) { is First -> first(value) is Second -> second(value) } } companion object { @JvmStatic @DoNotStrip fun create(value: ImageOverlay): Variant_ImageOverlay_TextOverlay = First(value) @JvmStatic @DoNotStrip fun create(value: TextOverlay): Variant_ImageOverlay_TextOverlay = Second(value) } }