import { ExtensionProperty , IProperty , Material , Nullable } from '@gltf-transform/core' ; import { KHR_MATERIALS_VARIANTS } from '../constants' ; import { Variant } from './variant' ; interface IMapping extends IProperty { material : Material ; variants : Variant [ ] ; } /**
 * # Mapping
 *
 * Maps  Variant s to  Material s. See  MaterialsVariants .
  export class Mapping extends ExtensionProperty < IMapping > { public static EXTENSION_NAME = KHR_MATERIALS_VARIANTS ; public declare extensionName : typeof KHR_MATERIALS_VARIANTS ; public declare propertyType : 'Mapping' ; public declare parentTypes : [ 'MappingList' ] ; protected init ( ) { this . extensionName = KHR_MATERIALS_VARIANTS ; this . propertyType = 'Mapping' ; this . parentTypes = [ 'MappingList' ] ; } protected getDefaults ( ) { return Object . assign ( super . getDefaults ( ) as IProperty , { material : null , variants : [ ] } ) ; } /** The  Material designated for this  Primitive , under the given variants.  public getMaterial ( ) { return this . getRef ( 'material' ) ; } /** The  Material designated for this  Primitive , under the given variants.  public setMaterial ( material ) { return this . setRef ( 'material' , material ) ; } /** Adds a  Variant to this mapping.  public addVariant ( variant ) { return this . addRef ( 'variants' , variant ) ; } /** Removes a  Variant from this mapping.  public removeVariant ( variant ) { return this . removeRef ( 'variants' , variant ) ; } /** Lists  Variant s in this mapping.  public listVariants ( ) { return this . listRefs ( 'variants' ) ; } }