Skip to content

Commit de27dd9

Browse files
[Backport 8.2] Update TypeScript docs and export estypes (#1676)
Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
1 parent 295553c commit de27dd9

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.github/ISSUE_TEMPLATE/regression.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ Paste the results here:
5151

5252
- *node version*: 6,8,10
5353
- `@elastic/elasticsearch` *version*: >=7.0.0
54+
- *typescript version*: 4.x (if applicable)
5455
- *os*: Mac, Windows, Linux
5556
- *any other relevant information*

docs/typescript.asciidoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ of type definitions of Elasticsearch's API surface.
77
The types are not 100% complete yet. Some APIs are missing (the newest ones, e.g. EQL),
88
and others may contain some errors, but we are continuously pushing fixes & improvements.
99

10+
NOTE: The client is developed against the https://www.npmjs.com/package/typescript?activeTab=versions[latest]
11+
version of TypeScript. Furthermore, unless you have set `skipLibCheck` to `true`,
12+
you should configure `esModuleInterop` to `true`.
13+
1014
[discrete]
1115
==== Example
1216

@@ -77,3 +81,10 @@ You can import the full TypeScript requests & responses definitions as it follow
7781
----
7882
import { estypes } from '@elastic/elasticsearch'
7983
----
84+
85+
If you need the legacy definitions with the body, you can do the following:
86+
87+
[source,ts]
88+
----
89+
import { estypesWithBody } from '@elastic/elasticsearch'
90+
----

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ import Client from './lib/client'
2121
import SniffingTransport from './lib/sniffingTransport'
2222

2323
export * from '@elastic/transport'
24+
export * as estypes from './lib/api/types'
25+
export * as estypesWithBody from './lib/api/types'
2426
export { Client, SniffingTransport }
2527
export type { ClientOptions, NodeOptions } from './lib/client'

0 commit comments

Comments
 (0)