Small clean up with Cases plugin API (#101668)

* Clean up public API of cases plugin

1. Don't use export * on index.ts files that define the public API
2. Add comments to the interface show they show up in the API docs
3. Export types that are part of the public API so they show up in the API docs.
4. Fill in information for the up and coming `description` and `owner` items in kibana.json.

* Update returns comments to be more descriptive

* update api docs

* Remove kibana.json attributes, until PR supporting them is merged.

* Change all exports to export type to avoid increase page bundle size
This commit is contained in:
Stacey Gammon 2021-06-10 08:43:07 -04:00 committed by GitHub
parent 65d3f49f00
commit b2903e9f8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 997 additions and 340 deletions

File diff suppressed because it is too large Load diff

View file

@ -32,9 +32,6 @@ import casesObj from './cases.json';
### Interfaces
<DocDefinitionList data={casesObj.client.interfaces}/>
### Consts, variables and types
<DocDefinitionList data={casesObj.client.misc}/>
## Server
### Classes

View file

@ -3,11 +3,15 @@
"id": "cases",
"kibanaVersion": "kibana",
"extraPublicDirs": ["common"],
"requiredPlugins": ["actions", "esUiShared", "features", "kibanaReact", "kibanaUtils", "triggersActionsUi"],
"optionalPlugins": [
"spaces",
"security"
"requiredPlugins": [
"actions",
"esUiShared",
"features",
"kibanaReact",
"kibanaUtils",
"triggersActionsUi"
],
"optionalPlugins": ["spaces", "security"],
"server": true,
"ui": true,
"version": "8.0.0"

View file

@ -12,6 +12,11 @@ export function plugin(initializerContext: PluginInitializerContext) {
return new CasesUiPlugin(initializerContext);
}
export { CasesUiPlugin };
export * from './plugin';
export * from './types';
export type { CasesUiPlugin };
export type { CasesUiStart } from './types';
export type { AllCasesProps } from './components/all_cases';
export type { AllCasesSelectorModalProps } from './components/all_cases/selector_modal';
export type { CaseViewProps } from './components/case_view';
export type { ConfigureCasesProps } from './components/configure_cases';
export type { CreateCaseProps } from './components/create';
export type { RecentCasesProps } from './components/recent_cases';

View file

@ -44,12 +44,42 @@ export interface Owner {
}
export interface CasesUiStart {
/**
* Get the all cases table
* @param props AllCasesProps
* @returns A react component that displays all cases
*/
getAllCases: (props: AllCasesProps) => ReactElement<AllCasesProps>;
/**
* use Modal hook for all cases selector
* @param props UseAllCasesSelectorModalProps
* @returns A react component that is a modal for selecting a case
*/
getAllCasesSelectorModal: (
props: AllCasesSelectorModalProps
) => ReactElement<AllCasesSelectorModalProps>;
/**
* Get the case view component
* @param props CaseViewProps
* @returns A react component for viewing a specific case
*/
getCaseView: (props: CaseViewProps) => ReactElement<CaseViewProps>;
/**
* Get the configure case component
* @param props ConfigureCasesProps
* @returns A react component for configuring a specific case
*/
getConfigureCases: (props: ConfigureCasesProps) => ReactElement<ConfigureCasesProps>;
/**
* Get the create case form
* @param props CreateCaseProps
* @returns A react component for creating a new case
*/
getCreateCase: (props: CreateCaseProps) => ReactElement<CreateCaseProps>;
/**
* Get the recent cases component
* @param props RecentCasesProps
* @returns A react component for showing recent cases
*/
getRecentCases: (props: RecentCasesProps) => ReactElement<RecentCasesProps>;
}