Export public http interfaces (#42001) (#42075)

* re-export http types

* update docs
This commit is contained in:
Mikhail Shustov 2019-07-27 10:47:18 +02:00 committed by GitHub
parent 6bdeff194e
commit 7683a741d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 509 additions and 11 deletions

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpBody](./kibana-plugin-public.httpbody.md)
## HttpBody type
<b>Signature:</b>
```typescript
export declare type HttpBody = BodyInit | null | any;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpErrorRequest](./kibana-plugin-public.httperrorrequest.md) &gt; [error](./kibana-plugin-public.httperrorrequest.error.md)
## HttpErrorRequest.error property
<b>Signature:</b>
```typescript
error: Error;
```

View file

@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpErrorRequest](./kibana-plugin-public.httperrorrequest.md)
## HttpErrorRequest interface
<b>Signature:</b>
```typescript
export interface HttpErrorRequest
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [error](./kibana-plugin-public.httperrorrequest.error.md) | <code>Error</code> | |
| [request](./kibana-plugin-public.httperrorrequest.request.md) | <code>Request</code> | |

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpErrorRequest](./kibana-plugin-public.httperrorrequest.md) &gt; [request](./kibana-plugin-public.httperrorrequest.request.md)
## HttpErrorRequest.request property
<b>Signature:</b>
```typescript
request?: Request;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpErrorResponse](./kibana-plugin-public.httperrorresponse.md) &gt; [error](./kibana-plugin-public.httperrorresponse.error.md)
## HttpErrorResponse.error property
<b>Signature:</b>
```typescript
error: Error | HttpFetchError;
```

View file

@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpErrorResponse](./kibana-plugin-public.httperrorresponse.md)
## HttpErrorResponse interface
<b>Signature:</b>
```typescript
export interface HttpErrorResponse extends HttpResponse
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [error](./kibana-plugin-public.httperrorresponse.error.md) | <code>Error &#124; HttpFetchError</code> | |

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) &gt; [headers](./kibana-plugin-public.httpfetchoptions.headers.md)
## HttpFetchOptions.headers property
<b>Signature:</b>
```typescript
headers?: HttpHeadersInit;
```

View file

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md)
## HttpFetchOptions interface
<b>Signature:</b>
```typescript
export interface HttpFetchOptions extends HttpRequestInit
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [headers](./kibana-plugin-public.httpfetchoptions.headers.md) | <code>HttpHeadersInit</code> | |
| [prependBasePath](./kibana-plugin-public.httpfetchoptions.prependbasepath.md) | <code>boolean</code> | |
| [query](./kibana-plugin-public.httpfetchoptions.query.md) | <code>HttpFetchQuery</code> | |

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) &gt; [prependBasePath](./kibana-plugin-public.httpfetchoptions.prependbasepath.md)
## HttpFetchOptions.prependBasePath property
<b>Signature:</b>
```typescript
prependBasePath?: boolean;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) &gt; [query](./kibana-plugin-public.httpfetchoptions.query.md)
## HttpFetchOptions.query property
<b>Signature:</b>
```typescript
query?: HttpFetchQuery;
```

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md)
## HttpFetchQuery interface
<b>Signature:</b>
```typescript
export interface HttpFetchQuery
```

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpHandler](./kibana-plugin-public.httphandler.md)
## HttpHandler type
<b>Signature:</b>
```typescript
export declare type HttpHandler = (path: string, options?: HttpFetchOptions) => Promise<HttpBody>;
```

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md)
## HttpHeadersInit interface
<b>Signature:</b>
```typescript
export interface HttpHeadersInit
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [body](./kibana-plugin-public.httprequestinit.body.md)
## HttpRequestInit.body property
<b>Signature:</b>
```typescript
body?: BodyInit | null;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [cache](./kibana-plugin-public.httprequestinit.cache.md)
## HttpRequestInit.cache property
<b>Signature:</b>
```typescript
cache?: RequestCache;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [credentials](./kibana-plugin-public.httprequestinit.credentials.md)
## HttpRequestInit.credentials property
<b>Signature:</b>
```typescript
credentials?: RequestCredentials;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [headers](./kibana-plugin-public.httprequestinit.headers.md)
## HttpRequestInit.headers property
<b>Signature:</b>
```typescript
headers?: HttpHeadersInit;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [integrity](./kibana-plugin-public.httprequestinit.integrity.md)
## HttpRequestInit.integrity property
<b>Signature:</b>
```typescript
integrity?: string;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [keepalive](./kibana-plugin-public.httprequestinit.keepalive.md)
## HttpRequestInit.keepalive property
<b>Signature:</b>
```typescript
keepalive?: boolean;
```

View file

@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md)
## HttpRequestInit interface
<b>Signature:</b>
```typescript
export interface HttpRequestInit
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [body](./kibana-plugin-public.httprequestinit.body.md) | <code>BodyInit &#124; null</code> | |
| [cache](./kibana-plugin-public.httprequestinit.cache.md) | <code>RequestCache</code> | |
| [credentials](./kibana-plugin-public.httprequestinit.credentials.md) | <code>RequestCredentials</code> | |
| [headers](./kibana-plugin-public.httprequestinit.headers.md) | <code>HttpHeadersInit</code> | |
| [integrity](./kibana-plugin-public.httprequestinit.integrity.md) | <code>string</code> | |
| [keepalive](./kibana-plugin-public.httprequestinit.keepalive.md) | <code>boolean</code> | |
| [method](./kibana-plugin-public.httprequestinit.method.md) | <code>string</code> | |
| [mode](./kibana-plugin-public.httprequestinit.mode.md) | <code>RequestMode</code> | |
| [redirect](./kibana-plugin-public.httprequestinit.redirect.md) | <code>RequestRedirect</code> | |
| [referrer](./kibana-plugin-public.httprequestinit.referrer.md) | <code>string</code> | |
| [referrerPolicy](./kibana-plugin-public.httprequestinit.referrerpolicy.md) | <code>ReferrerPolicy</code> | |
| [signal](./kibana-plugin-public.httprequestinit.signal.md) | <code>AbortSignal &#124; null</code> | |
| [window](./kibana-plugin-public.httprequestinit.window.md) | <code>any</code> | |

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [method](./kibana-plugin-public.httprequestinit.method.md)
## HttpRequestInit.method property
<b>Signature:</b>
```typescript
method?: string;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [mode](./kibana-plugin-public.httprequestinit.mode.md)
## HttpRequestInit.mode property
<b>Signature:</b>
```typescript
mode?: RequestMode;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [redirect](./kibana-plugin-public.httprequestinit.redirect.md)
## HttpRequestInit.redirect property
<b>Signature:</b>
```typescript
redirect?: RequestRedirect;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [referrer](./kibana-plugin-public.httprequestinit.referrer.md)
## HttpRequestInit.referrer property
<b>Signature:</b>
```typescript
referrer?: string;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [referrerPolicy](./kibana-plugin-public.httprequestinit.referrerpolicy.md)
## HttpRequestInit.referrerPolicy property
<b>Signature:</b>
```typescript
referrerPolicy?: ReferrerPolicy;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [signal](./kibana-plugin-public.httprequestinit.signal.md)
## HttpRequestInit.signal property
<b>Signature:</b>
```typescript
signal?: AbortSignal | null;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) &gt; [window](./kibana-plugin-public.httprequestinit.window.md)
## HttpRequestInit.window property
<b>Signature:</b>
```typescript
window?: any;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpResponse](./kibana-plugin-public.httpresponse.md) &gt; [body](./kibana-plugin-public.httpresponse.body.md)
## HttpResponse.body property
<b>Signature:</b>
```typescript
body?: HttpBody;
```

View file

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpResponse](./kibana-plugin-public.httpresponse.md)
## HttpResponse interface
<b>Signature:</b>
```typescript
export interface HttpResponse
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [body](./kibana-plugin-public.httpresponse.body.md) | <code>HttpBody</code> | |
| [request](./kibana-plugin-public.httpresponse.request.md) | <code>Request</code> | |
| [response](./kibana-plugin-public.httpresponse.response.md) | <code>Response</code> | |

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpResponse](./kibana-plugin-public.httpresponse.md) &gt; [request](./kibana-plugin-public.httpresponse.request.md)
## HttpResponse.request property
<b>Signature:</b>
```typescript
request: Request;
```

View file

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpResponse](./kibana-plugin-public.httpresponse.md) &gt; [response](./kibana-plugin-public.httpresponse.response.md)
## HttpResponse.response property
<b>Signature:</b>
```typescript
response?: Response;
```

View file

@ -40,7 +40,14 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ErrorToastOptions](./kibana-plugin-public.errortoastoptions.md) | |
| [FatalErrorInfo](./kibana-plugin-public.fatalerrorinfo.md) | Represents the <code>message</code> and <code>stack</code> of a fatal Error |
| [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. |
| [HttpErrorRequest](./kibana-plugin-public.httperrorrequest.md) | |
| [HttpErrorResponse](./kibana-plugin-public.httperrorresponse.md) | |
| [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) | |
| [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md) | |
| [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) | |
| [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) | |
| [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) | |
| [HttpResponse](./kibana-plugin-public.httpresponse.md) | |
| [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) | |
| [I18nStart](./kibana-plugin-public.i18nstart.md) | I18nStart.Context is required by any localizable React component from @<!-- -->kbn/i18n and @<!-- -->elastic/eui packages and is supposed to be used as the topmost component for any i18n-compatible React tree. |
| [LegacyNavLink](./kibana-plugin-public.legacynavlink.md) | |
@ -58,6 +65,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| --- | --- |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-public.chromenavlinkupdateablefields.md) | |
| [HttpBody](./kibana-plugin-public.httpbody.md) | |
| [HttpHandler](./kibana-plugin-public.httphandler.md) | |
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | |
| [HttpStart](./kibana-plugin-public.httpstart.md) | |
| [PluginInitializer](./kibana-plugin-public.plugininitializer.md) | The <code>plugin</code> export at the root of a plugin's <code>public</code> directory should conform to this interface. |

View file

@ -50,7 +50,7 @@ import {
ChromeRecentlyAccessedHistoryItem,
} from './chrome';
import { FatalErrorsSetup, FatalErrorInfo } from './fatal_errors';
import { HttpServiceBase, HttpSetup, HttpStart, HttpInterceptor } from './http';
import { HttpSetup, HttpStart } from './http';
import { I18nStart } from './i18n';
import { InjectedMetadataSetup, InjectedMetadataStart, LegacyNavLink } from './injected_metadata';
import {
@ -70,6 +70,19 @@ import { DocLinksStart } from './doc_links';
/** @interal */
export { CoreContext, CoreSystem } from './core_system';
export { RecursiveReadonly } from '../utils';
export {
HttpServiceBase,
HttpHeadersInit,
HttpRequestInit,
HttpFetchOptions,
HttpFetchQuery,
HttpErrorResponse,
HttpErrorRequest,
HttpInterceptor,
HttpResponse,
HttpHandler,
HttpBody,
} from './http';
/**
* Core services exposed to the `Plugin` setup lifecycle
@ -151,8 +164,6 @@ export {
ErrorToastOptions,
FatalErrorInfo,
FatalErrorsSetup,
HttpInterceptor,
HttpServiceBase,
HttpSetup,
HttpStart,
I18nStart,

View file

@ -329,26 +329,104 @@ export interface FatalErrorsSetup {
get$: () => Rx.Observable<FatalErrorInfo>;
}
// @public (undocumented)
export type HttpBody = BodyInit | null | any;
// @public (undocumented)
export interface HttpErrorRequest {
// (undocumented)
error: Error;
// (undocumented)
request?: Request;
}
// @public (undocumented)
export interface HttpErrorResponse extends HttpResponse {
// Warning: (ae-forgotten-export) The symbol "HttpFetchError" needs to be exported by the entry point index.d.ts
//
// (undocumented)
error: Error | HttpFetchError;
}
// @public (undocumented)
export interface HttpFetchOptions extends HttpRequestInit {
// (undocumented)
headers?: HttpHeadersInit;
// (undocumented)
prependBasePath?: boolean;
// (undocumented)
query?: HttpFetchQuery;
}
// @public (undocumented)
export interface HttpFetchQuery {
// (undocumented)
[key: string]: string | number | boolean | undefined;
}
// @public (undocumented)
export type HttpHandler = (path: string, options?: HttpFetchOptions) => Promise<HttpBody>;
// @public (undocumented)
export interface HttpHeadersInit {
// (undocumented)
[name: string]: any;
}
// @public (undocumented)
export interface HttpInterceptor {
// Warning: (ae-forgotten-export) The symbol "HttpInterceptController" needs to be exported by the entry point index.d.ts
//
// (undocumented)
request?(request: Request, controller: HttpInterceptController): Promise<Request> | Request | void;
// Warning: (ae-forgotten-export) The symbol "HttpErrorRequest" needs to be exported by the entry point index.d.ts
//
// (undocumented)
requestError?(httpErrorRequest: HttpErrorRequest, controller: HttpInterceptController): Promise<Request> | Request | void;
// Warning: (ae-forgotten-export) The symbol "HttpResponse" needs to be exported by the entry point index.d.ts
//
// (undocumented)
response?(httpResponse: HttpResponse, controller: HttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
// Warning: (ae-forgotten-export) The symbol "HttpErrorResponse" needs to be exported by the entry point index.d.ts
//
// (undocumented)
responseError?(httpErrorResponse: HttpErrorResponse, controller: HttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
}
// @public (undocumented)
export interface HttpRequestInit {
// (undocumented)
body?: BodyInit | null;
// (undocumented)
cache?: RequestCache;
// (undocumented)
credentials?: RequestCredentials;
// (undocumented)
headers?: HttpHeadersInit;
// (undocumented)
integrity?: string;
// (undocumented)
keepalive?: boolean;
// (undocumented)
method?: string;
// (undocumented)
mode?: RequestMode;
// (undocumented)
redirect?: RequestRedirect;
// (undocumented)
referrer?: string;
// (undocumented)
referrerPolicy?: ReferrerPolicy;
// (undocumented)
signal?: AbortSignal | null;
// (undocumented)
window?: any;
}
// @public (undocumented)
export interface HttpResponse {
// (undocumented)
body?: HttpBody;
// (undocumented)
request: Request;
// (undocumented)
response?: Response;
}
// @public (undocumented)
export interface HttpServiceBase {
// (undocumented)
@ -361,8 +439,6 @@ export interface HttpServiceBase {
};
// (undocumented)
delete: HttpHandler;
// Warning: (ae-forgotten-export) The symbol "HttpHandler" needs to be exported by the entry point index.d.ts
//
// (undocumented)
fetch: HttpHandler;
// (undocumented)