Skip to content

Include common interfaces in the source code #1134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ismail-codinglab opened this issue Mar 30, 2020 · 1 comment
Closed

Include common interfaces in the source code #1134

ismail-codinglab opened this issue Mar 30, 2020 · 1 comment

Comments

@ismail-codinglab
Copy link

🚀 Feature Proposal

I have not found an issue about this before.
It would be nice to have the common types included in the source code.
The ones that are here in this PR:
https://github.com/elastic/elasticsearch-js/pull/742/files

and use it like so:

import { Client, ApiResponse, RequestParams, SearchResponse } from '@elastic/elasticsearch';
interface CoolBody{
  cool: 'yes';
}
client
.search(params)
.then((result: ApiResponse<SearchResponse<CoolBody>>) => {

Motivation

Reduces code, maintenance, technical depth, complexity, learning curve

One argument I could think of why you wouldn't include them is if they are different per setup.
Then I would simply suggest to rename SearchResponse to DefaultSearchResponse

I can't teach my students all this workload before they can do a simple search. I want to hide this complexity.

@delvedor
Copy link
Member

Hello! We are working on this, and hopefully, we'll start shipping the first response interfaces soon!
Closing this issue as we are already discussing it in #933.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants