import { DataTypeFieldConfig , xLuceneTypeConfig , } from '@terascope/types' ; import BaseType from './base-type' ; import { GraphQLType , TypeESMapping } from '../interfaces' ; export default class TupleType extends BaseType { readonly types : readonly BaseType [ ] ; constructor ( field , version , baseConfig , types ) { super ( field , baseConfig , version ) ; this . types = types . slice ( ) ; } toESMapping ( ) { return { mapping : { [ this . field ] : { enabled : false } } } ; } toGraphQL ( ) { return this . _formatGql ( 'JSON' ) ; } toXlucene ( ) { const configs = this . types . map ( ( type ) => type . toXlucene ( ) ) ; return Object . assign ( { } , ... configs ) ; } }