import { ExtensionProperty , IProperty , Nullable , PropertyType } from '@gltf-transform/core' ; import { KHR_MATERIALS_VARIANTS } from '../constants' ; import { Mapping } from './mapping' ; interface IMappingList extends IProperty { mappings : Mapping [ ] ; } /**
 * # MappingList
 *
 * List of material variant  Mapping s. See  MaterialsVariants .
  export class MappingList extends ExtensionProperty < IMappingList > { public static EXTENSION_NAME = KHR_MATERIALS_VARIANTS ; public declare extensionName : typeof KHR_MATERIALS_VARIANTS ; public declare propertyType : 'MappingList' ; public declare parentTypes : [ PropertyType . PRIMITIVE ] ; protected init ( ) { this . extensionName = KHR_MATERIALS_VARIANTS ; this . propertyType = 'MappingList' ; this . parentTypes = [ PropertyType . PRIMITIVE ] ; } protected getDefaults ( ) { return Object . assign ( super . getDefaults ( ) as IProperty , { mappings : [ ] } ) ; } /** Adds a  Mapping to this mapping.  public addMapping ( mapping ) { return this . addRef ( 'mappings' , mapping ) ; } /** Removes a  Mapping from the list for this  Primitive .  public removeMapping ( mapping ) { return this . removeRef ( 'mappings' , mapping ) ; } /** Lists  Mapping s in this  Primitive .  public listMappings ( ) { return this . listRefs ( 'mappings' ) ; } }