import { Transport , TransportRequestOptions , TransportRequestOptionsWithMeta , TransportRequestOptionsWithOutMeta , TransportResult } from '@elastic/transport' ; import * as T from '../types' ; import * as TB from '../typesWithBodyKey' ; interface That { transport : Transport ; } export default class TextStructure { transport : Transport ; constructor ( transport ) { this . transport = transport ; } async findStructure < TJsonDocument = unknown > ( this , params , options ? ) ; async findStructure < TJsonDocument = unknown > ( this , params , options ? ) ; async findStructure < TJsonDocument = unknown > ( this , params , options ? ) ; async findStructure < TJsonDocument = unknown > ( this , params , options ? ) { const acceptedPath = [ ] ; const acceptedBody = [ 'text_files' ] ; const querystring = { } ; let body = params . body ?? undefined ; for ( const key in params ) { if ( acceptedBody . includes ( key ) ) { body = params [ key ] ; } else if ( acceptedPath . includes ( key ) ) { continue ; } else if ( key !== 'body' ) { querystring [ key ] = params [ key ] ; } } const method = 'POST' ; const path = '/_text_structure/find_structure' ; return await this . transport . request ( { path , method , querystring , bulkBody : body } , options ) ; } }