Skip to content

Commit 8945b56

Browse files
authored
[7.x] Generate core API docs from TSDoc comments (#32148) (#34421)
* Generate core API docs from TSDoc comments (#32148) * Generate core API docs from TSDoc comments Uses api-extractor and api-documenter to generate documentation for the Kibana core API from TSDoc comments in the source code. Documentation can be generated using `npm run docs:api`. I used --no-verify to ignore the following pre-commit hook errors: 1. Filenames MUST use snake_case - api-extractor.json It's possible to specify a different config file, but I prefer to keep the "standard" config file name. 2. UNHANDLED ERROR: Unable to find tsconfig.json file selecting "common/core_api_review/kibana.api.ts". Ensure one exists and it is listed in "src/dev/typescript/projects.ts" This is not a source file, so safe to ignore. * Flesh out API docs a little bit * Ignore snake_case check for api-extractor.json * Ignore api-extractor's review file from pre-commit check * Try to fix build failing by using masters yarn.lock * I'm being stupid * Found a better home for ignoring common/core_api_review/kibana.api.ts * Node script for detecting core API changes I initially wanted to include this as a precommit hook, but it takes quite long to execute (~12s) so might be better suited as a test or as part of the release process. The script currently fails because api-extractor uses an older version of typescript. * Fix tslint precommit hook ignore condition * Write tsdoc-metadata.json into ./build * Add LogMeta and ElasticSearch to exported types & docs * Suppress logging when running api-extractor from script * Improve check_core_api_changes script and run as test * Inline api-extractor.json config * Fix check_core_api_changes --help flag * LogMeta TSDoc comments * check_core_api_changes: fail if api-extractor produces warnings or errors And print more useful messages to the console * Move ignored ts files list into dev/file * Add back build:types since api-exporter cannot operate on source files * Upgrade api-exporter/documenter * api-extractor: independantly analyze core/public and core/server Becasue of microsoft/rushstack#1029 api-extractor can't use core/index.ts as a single entry point for analyzing the public and server API's as isolated namespaces. Instead we analyze these projects separately. This introduces other problems like the api review files and documentation always being called "kibana." from the package.json filename. * Build types as part of build task * Include types in typescript browser compilation * Force inclusion of core/public for building types * Fix api review filename in api-exporter errors * Update docs and API review files * Fix api-extractor warnings * Remove ts file ignored list since it's no longer necessary * Rename exported api package name * Review comments * Export other missing types * Upgrade api-documenter to latest beta * Export more missing types * Fix warnings and add api-exporter to Jenkins tests * Correctly handle runBuildTypes() exceptions * Fix another swallowed exception * Fix api-extractor warnings after master merge * Update yarn.lock * Fix erraneous type * Revert "Update yarn.lock" This reverts commit 85a8093. * Revert "Fix erraneous type" This reverts commit 7f0550c. * Backport #32440 * Update core api signature and docs
1 parent e97b329 commit 8945b56

File tree

138 files changed

+2627
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2627
-81
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [BasePathSetup](./kibana-plugin-public.basepathsetup.md)
2+
3+
## BasePathSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type BasePathSetup = ReturnType<BasePathService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBrand](./kibana-plugin-public.chromebrand.md) &gt; [logo](./kibana-plugin-public.chromebrand.logo.md)
2+
3+
## ChromeBrand.logo property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
logo?: string;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBrand](./kibana-plugin-public.chromebrand.md)
2+
3+
## ChromeBrand interface
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export interface ChromeBrand
10+
```
11+
12+
## Properties
13+
14+
| Property | Type | Description |
15+
| --- | --- | --- |
16+
| [logo](./kibana-plugin-public.chromebrand.logo.md) | <code>string</code> | |
17+
| [smallLogo](./kibana-plugin-public.chromebrand.smalllogo.md) | <code>string</code> | |
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBrand](./kibana-plugin-public.chromebrand.md) &gt; [smallLogo](./kibana-plugin-public.chromebrand.smalllogo.md)
2+
3+
## ChromeBrand.smallLogo property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
smallLogo?: string;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) &gt; [data-test-subj](./kibana-plugin-public.chromebreadcrumb.data-test-subj.md)
2+
3+
## ChromeBreadcrumb.data-test-subj property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
'data-test-subj'?: string;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) &gt; [href](./kibana-plugin-public.chromebreadcrumb.href.md)
2+
3+
## ChromeBreadcrumb.href property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
href?: string;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md)
2+
3+
## ChromeBreadcrumb interface
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export interface ChromeBreadcrumb
10+
```
11+
12+
## Properties
13+
14+
| Property | Type | Description |
15+
| --- | --- | --- |
16+
| [data-test-subj](./kibana-plugin-public.chromebreadcrumb.data-test-subj.md) | <code>string</code> | |
17+
| [href](./kibana-plugin-public.chromebreadcrumb.href.md) | <code>string</code> | |
18+
| [text](./kibana-plugin-public.chromebreadcrumb.text.md) | <code>string</code> | |
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) &gt; [text](./kibana-plugin-public.chromebreadcrumb.text.md)
2+
3+
## ChromeBreadcrumb.text property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
text: string;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md)
2+
3+
## ChromeHelpExtension type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type ChromeHelpExtension = (element: HTMLDivElement) => (() => void);
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeSetup](./kibana-plugin-public.chromesetup.md)
2+
3+
## ChromeSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type ChromeSetup = ReturnType<ChromeService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [basePath](./kibana-plugin-public.coresetup.basepath.md)
2+
3+
## CoreSetup.basePath property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
basePath: BasePathSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [chrome](./kibana-plugin-public.coresetup.chrome.md)
2+
3+
## CoreSetup.chrome property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
chrome: ChromeSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md)
2+
3+
## CoreSetup.fatalErrors property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
fatalErrors: FatalErrorsSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [http](./kibana-plugin-public.coresetup.http.md)
2+
3+
## CoreSetup.http property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
http: HttpSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [i18n](./kibana-plugin-public.coresetup.i18n.md)
2+
3+
## CoreSetup.i18n property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
i18n: I18nSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md)
2+
3+
## CoreSetup.injectedMetadata property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
injectedMetadata: InjectedMetadataSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md)
2+
3+
## CoreSetup interface
4+
5+
Core services exposed to the start lifecycle
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface CoreSetup
11+
```
12+
13+
## Properties
14+
15+
| Property | Type | Description |
16+
| --- | --- | --- |
17+
| [basePath](./kibana-plugin-public.coresetup.basepath.md) | <code>BasePathSetup</code> | |
18+
| [chrome](./kibana-plugin-public.coresetup.chrome.md) | <code>ChromeSetup</code> | |
19+
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | <code>FatalErrorsSetup</code> | |
20+
| [http](./kibana-plugin-public.coresetup.http.md) | <code>HttpSetup</code> | |
21+
| [i18n](./kibana-plugin-public.coresetup.i18n.md) | <code>I18nSetup</code> | |
22+
| [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md) | <code>InjectedMetadataSetup</code> | |
23+
| [notifications](./kibana-plugin-public.coresetup.notifications.md) | <code>NotificationsSetup</code> | |
24+
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | <code>UiSettingsSetup</code> | |
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [notifications](./kibana-plugin-public.coresetup.notifications.md)
2+
3+
## CoreSetup.notifications property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
notifications: NotificationsSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [uiSettings](./kibana-plugin-public.coresetup.uisettings.md)
2+
3+
## CoreSetup.uiSettings property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
uiSettings: UiSettingsSetup;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md)
2+
3+
## FatalErrorsSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type FatalErrorsSetup = ReturnType<FatalErrorsService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [HttpSetup](./kibana-plugin-public.httpsetup.md)
2+
3+
## HttpSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type HttpSetup = ReturnType<HttpService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [I18nSetup](./kibana-plugin-public.i18nsetup.md)
2+
3+
## I18nSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type I18nSetup = ReturnType<I18nService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [InjectedMetadataSetup](./kibana-plugin-public.injectedmetadatasetup.md)
2+
3+
## InjectedMetadataSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type InjectedMetadataSetup = ReturnType<InjectedMetadataService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md)
2+
3+
## kibana-plugin-public package
4+
5+
## Classes
6+
7+
| Class | Description |
8+
| --- | --- |
9+
| [ToastsSetup](./kibana-plugin-public.toastssetup.md) | |
10+
| [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) | |
11+
12+
## Interfaces
13+
14+
| Interface | Description |
15+
| --- | --- |
16+
| [ChromeBrand](./kibana-plugin-public.chromebrand.md) | |
17+
| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | |
18+
| [CoreSetup](./kibana-plugin-public.coresetup.md) | Core services exposed to the start lifecycle |
19+
| [Plugin](./kibana-plugin-public.plugin.md) | The interface that should be returned by a <code>PluginInitializer</code>. |
20+
| [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md) | The available core services passed to a <code>PluginInitializer</code> |
21+
| [PluginSetupContext](./kibana-plugin-public.pluginsetupcontext.md) | The available core services passed to a plugin's <code>Plugin#setup</code> method. |
22+
| [UiSettingsState](./kibana-plugin-public.uisettingsstate.md) | |
23+
24+
## Type Aliases
25+
26+
| Type Alias | Description |
27+
| --- | --- |
28+
| [BasePathSetup](./kibana-plugin-public.basepathsetup.md) | |
29+
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
30+
| [ChromeSetup](./kibana-plugin-public.chromesetup.md) | |
31+
| [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) | |
32+
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | |
33+
| [I18nSetup](./kibana-plugin-public.i18nsetup.md) | |
34+
| [InjectedMetadataSetup](./kibana-plugin-public.injectedmetadatasetup.md) | |
35+
| [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) | |
36+
| [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. |
37+
| [ToastInput](./kibana-plugin-public.toastinput.md) | |
38+
| [UiSettingsSetup](./kibana-plugin-public.uisettingssetup.md) | |
39+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [NotificationsSetup](./kibana-plugin-public.notificationssetup.md)
2+
3+
## NotificationsSetup type
4+
5+
6+
<b>Signature:</b>
7+
8+
```typescript
9+
export declare type NotificationsSetup = ReturnType<NotificationsService['setup']>;
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [Plugin](./kibana-plugin-public.plugin.md)
2+
3+
## Plugin interface
4+
5+
The interface that should be returned by a `PluginInitializer`<!-- -->.
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface Plugin<TSetup, TDependencies extends Record<string, unknown> =
11+
```
12+
13+
## Properties
14+
15+
| Property | Type | Description |
16+
| --- | --- | --- |
17+
| [setup](./kibana-plugin-public.plugin.setup.md) | <code>(core: PluginSetupContext, dependencies: TDependencies) =&gt; TSetup &#124; Promise&lt;TSetup&gt;</code> | |
18+
| [stop](./kibana-plugin-public.plugin.stop.md) | <code>() =&gt; void</code> | |
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [Plugin](./kibana-plugin-public.plugin.md) &gt; [setup](./kibana-plugin-public.plugin.setup.md)
2+
3+
## Plugin.setup property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
setup: (core: PluginSetupContext, dependencies: TDependencies) => TSetup | Promise<TSetup>;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [Plugin](./kibana-plugin-public.plugin.md) &gt; [stop](./kibana-plugin-public.plugin.stop.md)
2+
3+
## Plugin.stop property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
stop?: () => void;
9+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [PluginInitializer](./kibana-plugin-public.plugininitializer.md)
2+
3+
## PluginInitializer type
4+
5+
The `plugin` export at the root of a plugin's `public` directory should conform to this interface.
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export declare type PluginInitializer<TSetup, TDependencies extends Record<string, unknown> = {}> = (core: PluginInitializerContext) => Plugin<TSetup, TDependencies>;
11+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md)
2+
3+
## PluginInitializerContext interface
4+
5+
The available core services passed to a `PluginInitializer`
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface PluginInitializerContext
11+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Home](./index) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [PluginSetupContext](./kibana-plugin-public.pluginsetupcontext.md) &gt; [basePath](./kibana-plugin-public.pluginsetupcontext.basepath.md)
2+
3+
## PluginSetupContext.basePath property
4+
5+
<b>Signature:</b>
6+
7+
```typescript
8+
basePath: BasePathSetup;
9+
```

0 commit comments

Comments
 (0)