Skip to content
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

Make generated type docs more explorable #47069

Merged
merged 7 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,17 @@ export interface VizRenderContext {
}

export type VizRenderer = (context: VizRenderContext, domElement: HTMLElement) => () => void;
// When a renderer is bound via `contextContainer.createHandler` this is the type that will be returned.
type BoundVizRenderer = (domElement: HTMLElement) => () => void;

class VizRenderingPlugin {
private readonly vizRenderers = new Map<string, ((domElement: HTMLElement) => () => void)>();
private readonly contextContainer?: IContextContainer<VizRenderer>;
private readonly vizRenderers = new Map<string, BoundVizRenderer>();

constructor(private readonly initContext: PluginInitializerContext) {}

setup(core) {
this.contextContainer = core.context.createContextContainer<
VizRenderContext,
ReturnType<VizRenderer>,
[HTMLElement]
>();
this.contextContainer = core.context.createContextContainer();

return {
registerContext: this.contextContainer.registerContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## ErrorToastOptions interface

Options available for APIs.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
error: Error | HttpFetchError;
error: Error | IHttpFetchError;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface HttpErrorResponse
| Property | Type | Description |
| --- | --- | --- |
| [body](./kibana-plugin-public.httperrorresponse.body.md) | <code>HttpBody</code> | |
| [error](./kibana-plugin-public.httperrorresponse.error.md) | <code>Error &#124; HttpFetchError</code> | |
| [error](./kibana-plugin-public.httperrorresponse.error.md) | <code>Error &#124; IHttpFetchError</code> | |
| [request](./kibana-plugin-public.httperrorresponse.request.md) | <code>Request</code> | |
| [response](./kibana-plugin-public.httperrorresponse.response.md) | <code>Response</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpFetchOptions.headers property

Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md)<!-- -->.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## HttpFetchOptions interface

All options that may be used with a [HttpHandler](./kibana-plugin-public.httphandler.md)<!-- -->.

<b>Signature:</b>

Expand All @@ -15,7 +16,7 @@ export interface HttpFetchOptions extends HttpRequestInit

| 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> | |
| [headers](./kibana-plugin-public.httpfetchoptions.headers.md) | <code>HttpHeadersInit</code> | Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md)<!-- -->. |
| [prependBasePath](./kibana-plugin-public.httpfetchoptions.prependbasepath.md) | <code>boolean</code> | Whether or not the request should automatically prepend the basePath. Defaults to <code>true</code>. |
| [query](./kibana-plugin-public.httpfetchoptions.query.md) | <code>HttpFetchQuery</code> | The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md)<!-- -->. |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpFetchOptions.prependBasePath property

Whether or not the request should automatically prepend the basePath. Defaults to `true`<!-- -->.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpFetchOptions.query property

The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md)<!-- -->.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## HttpHandler type

A function for making an HTTP requests to Kibana's backend. See [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) for options and [HttpBody](./kibana-plugin-public.httpbody.md) for the response.

<b>Signature:</b>

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## HttpInterceptor interface

An object that may define global interceptor functions for different parts of the request and response lifecycle. See [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md)<!-- -->.

<b>Signature:</b>

Expand All @@ -15,8 +16,8 @@ export interface HttpInterceptor

| Method | Description |
| --- | --- |
| [request(request, controller)](./kibana-plugin-public.httpinterceptor.request.md) | |
| [requestError(httpErrorRequest, controller)](./kibana-plugin-public.httpinterceptor.requesterror.md) | |
| [response(httpResponse, controller)](./kibana-plugin-public.httpinterceptor.response.md) | |
| [responseError(httpErrorResponse, controller)](./kibana-plugin-public.httpinterceptor.responseerror.md) | |
| [request(request, controller)](./kibana-plugin-public.httpinterceptor.request.md) | Define an interceptor to be executed before a request is sent. |
| [requestError(httpErrorRequest, controller)](./kibana-plugin-public.httpinterceptor.requesterror.md) | Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise. |
| [response(httpResponse, controller)](./kibana-plugin-public.httpinterceptor.response.md) | Define an interceptor to be executed after a response is received. |
| [responseError(httpErrorResponse, controller)](./kibana-plugin-public.httpinterceptor.responseerror.md) | Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise. |

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

## HttpInterceptor.request() method

Define an interceptor to be executed before a request is sent.

<b>Signature:</b>

```typescript
request?(request: Request, controller: HttpInterceptController): Promise<Request> | Request | void;
request?(request: Request, controller: IHttpInterceptController): Promise<Request> | Request | void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| request | <code>Request</code> | |
| controller | <code>HttpInterceptController</code> | |
| controller | <code>IHttpInterceptController</code> | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

## HttpInterceptor.requestError() method

Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise.

<b>Signature:</b>

```typescript
requestError?(httpErrorRequest: HttpErrorRequest, controller: HttpInterceptController): Promise<Request> | Request | void;
requestError?(httpErrorRequest: HttpErrorRequest, controller: IHttpInterceptController): Promise<Request> | Request | void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| httpErrorRequest | <code>HttpErrorRequest</code> | |
| controller | <code>HttpInterceptController</code> | |
| controller | <code>IHttpInterceptController</code> | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

## HttpInterceptor.response() method

Define an interceptor to be executed after a response is received.

<b>Signature:</b>

```typescript
response?(httpResponse: HttpResponse, controller: HttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
response?(httpResponse: HttpResponse, controller: IHttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| httpResponse | <code>HttpResponse</code> | |
| controller | <code>HttpInterceptController</code> | |
| controller | <code>IHttpInterceptController</code> | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

## HttpInterceptor.responseError() method

Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise.

<b>Signature:</b>

```typescript
responseError?(httpErrorResponse: HttpErrorResponse, controller: HttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
responseError?(httpErrorResponse: HttpErrorResponse, controller: IHttpInterceptController): Promise<HttpResponse> | HttpResponse | void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| httpErrorResponse | <code>HttpErrorResponse</code> | |
| controller | <code>HttpInterceptController</code> | |
| controller | <code>IHttpInterceptController</code> | |

<b>Returns:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.body property

A BodyInit object or null to set request's body.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.cache property

The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.credentials property

The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.headers property

[HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md)

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.integrity property

Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.keepalive property

Whether or not request can outlive the global in which it was created.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## HttpRequestInit interface

Fetch API options available to [HttpHandler](./kibana-plugin-public.httphandler.md)<!-- -->s.

<b>Signature:</b>

Expand All @@ -15,17 +16,17 @@ export interface HttpRequestInit

| 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> | |
| [body](./kibana-plugin-public.httprequestinit.body.md) | <code>BodyInit &#124; null</code> | A BodyInit object or null to set request's body. |
| [cache](./kibana-plugin-public.httprequestinit.cache.md) | <code>RequestCache</code> | The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. |
| [credentials](./kibana-plugin-public.httprequestinit.credentials.md) | <code>RequestCredentials</code> | The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. |
| [headers](./kibana-plugin-public.httprequestinit.headers.md) | <code>HttpHeadersInit</code> | [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) |
| [integrity](./kibana-plugin-public.httprequestinit.integrity.md) | <code>string</code> | Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. |
| [keepalive](./kibana-plugin-public.httprequestinit.keepalive.md) | <code>boolean</code> | Whether or not request can outlive the global in which it was created. |
| [method](./kibana-plugin-public.httprequestinit.method.md) | <code>string</code> | HTTP method, which is "GET" by default. |
| [mode](./kibana-plugin-public.httprequestinit.mode.md) | <code>RequestMode</code> | The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. |
| [redirect](./kibana-plugin-public.httprequestinit.redirect.md) | <code>RequestRedirect</code> | The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. |
| [referrer](./kibana-plugin-public.httprequestinit.referrer.md) | <code>string</code> | The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the <code>Referer</code> header of the request being made. |
| [referrerPolicy](./kibana-plugin-public.httprequestinit.referrerpolicy.md) | <code>ReferrerPolicy</code> | The referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. |
| [signal](./kibana-plugin-public.httprequestinit.signal.md) | <code>AbortSignal &#124; null</code> | Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. |
| [window](./kibana-plugin-public.httprequestinit.window.md) | <code>null</code> | Can only be null. Used to disassociate request from any Window. |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.method property

HTTP method, which is "GET" by default.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.mode property

The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.redirect property

The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.

<b>Signature:</b>

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## HttpRequestInit.referrer property

The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.

<b>Signature:</b>

```typescript
Expand Down
Loading