Updated type definitions (#882)
* Updated type definitions * Updated test
This commit is contained in:
committed by
GitHub
parent
a1ca9cdda0
commit
ca50f580f4
@ -27,13 +27,29 @@ import {
|
||||
ResurrectEvent,
|
||||
events,
|
||||
errors,
|
||||
ClientExtendsCallbackOptions
|
||||
ClientExtendsCallbackOptions,
|
||||
NodeOptions
|
||||
} from '../../index'
|
||||
|
||||
import { TransportRequestParams, TransportRequestOptions } from '../../lib/Transport'
|
||||
import { URL } from 'url'
|
||||
|
||||
const client = new Client({ node: 'http://localhost:9200' })
|
||||
|
||||
const nodeOpts: NodeOptions = {
|
||||
url: new URL('http://localhost:9200'),
|
||||
id: 'winteriscoming',
|
||||
headers: { 'foo': 'bar' },
|
||||
roles: {
|
||||
master: false,
|
||||
data: true,
|
||||
ingest: false,
|
||||
ml: false
|
||||
}
|
||||
}
|
||||
|
||||
const client2 = new Client({ node: nodeOpts })
|
||||
|
||||
client.on(events.RESPONSE, (err: errors.ElasticsearchClientError | null, request: RequestEvent) => {
|
||||
if (err) console.log(err)
|
||||
const { body, statusCode } = request
|
||||
|
||||
Reference in New Issue
Block a user