From 56e144eb7d477afbd21591f85df127f6d1b7d017 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Tue, 2 Mar 2021 17:31:02 -0500 Subject: [PATCH] Remove all apis tagged @internal and add tests --- .../build_api_declaration.ts | 3 +- .../build_arrow_fn_dec.ts | 3 +- .../build_api_declarations/build_class_dec.ts | 24 ++- .../build_function_dec.ts | 5 +- .../build_interface_dec.ts | 31 +-- .../build_type_literal_dec.ts | 3 +- .../build_variable_dec.ts | 16 +- .../src/plugin_a/public/classes.ts | 14 ++ .../src/plugin_a/public/const_vars.ts | 7 + .../__fixtures__/src/plugin_a/public/fns.ts | 5 + .../src/plugin_a/public/plugin.ts | 5 + .../__fixtures__/src/plugin_a/public/types.ts | 3 + .../src/api_docs/tests/api_doc_suite.test.ts | 32 +++ .../api_docs/tests/snapshots/plugin_a.json | 188 ++++++++++++------ .../src/api_docs/tests/snapshots/plugin_a.mdx | 10 + .../tests/snapshots/plugin_a_foo.json | 3 + .../api_docs/tests/snapshots/plugin_a_foo.mdx | 4 + packages/kbn-docs-utils/src/api_docs/utils.ts | 4 + 18 files changed, 264 insertions(+), 96 deletions(-) diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts index 2d1cd7b9f97ca..7327c67944748 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts @@ -10,7 +10,7 @@ import { Node } from 'ts-morph'; import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { buildClassDec } from './build_class_dec'; import { buildFunctionDec } from './build_function_dec'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { isNamedNode } from '../tsmorph_utils'; import { AnchorLink, ApiDeclaration } from '../types'; import { buildVariableDec } from './build_variable_dec'; @@ -80,6 +80,7 @@ export function buildApiDeclaration( id: getApiSectionId(anchorLink), type: getTypeKind(node), label: apiName, + tags: getJSDocTagNames(node), description: getCommentsFromNode(node), source: getSourceForNode(node), signature: getSignature(node, plugins, log), diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts index 2f041c8d42b4b..58339bb1d1d4b 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts @@ -17,7 +17,7 @@ import { PropertyAssignment, } from 'ts-morph'; import { getApiSectionId } from '../utils'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { AnchorLink, TypeKind } from '../types'; import { getSourceForNode } from './utils'; import { buildApiDecsForParameters } from './build_parameter_decs'; @@ -55,6 +55,7 @@ export function getArrowFunctionDec( description: getCommentsFromNode(node), label: node.getName(), source: getSourceForNode(node), + tags: getJSDocTagNames(node), returnComment: getJSDocReturnTagComment(node), }; } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts index 2ccce506dde53..9417f45fc027e 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts @@ -9,10 +9,10 @@ import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { ClassDeclaration } from 'ts-morph'; import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { buildApiDeclaration } from './build_api_declaration'; import { getSourceForNode, isPrivate } from './utils'; -import { getApiSectionId } from '../utils'; +import { getApiSectionId, isInternal } from '../utils'; import { getSignature } from './get_signature'; export function buildClassDec( @@ -24,21 +24,23 @@ export function buildClassDec( return { id: getApiSectionId(anchorLink), type: TypeKind.ClassKind, + tags: getJSDocTagNames(node), label: node.getName() || 'Missing label', description: getCommentsFromNode(node), signature: getSignature(node, plugins, log), children: node.getMembers().reduce((acc, m) => { if (!isPrivate(m)) { - acc.push( - buildApiDeclaration( - m, - plugins, - log, - anchorLink.pluginName, - anchorLink.scope, - anchorLink.apiName - ) + const child = buildApiDeclaration( + m, + plugins, + log, + anchorLink.pluginName, + anchorLink.scope, + anchorLink.apiName ); + if (!isInternal(child)) { + acc.push(child); + } } return acc; }, [] as ApiDeclaration[]), diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts index 89050430085fd..287757dd1911f 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts @@ -39,7 +39,7 @@ export function buildFunctionDec( const label = Node.isConstructorDeclaration(node) ? 'Constructor' : node.getName() || '(WARN: Missing name)'; - return { + const fn = { id: getApiSectionId(anchorLink), type: TypeKind.FunctionKind, label, @@ -56,4 +56,7 @@ export function buildFunctionDec( returnComment: getJSDocReturnTagComment(node), source: getSourceForNode(node), }; + + log.warning(`fn ${label} has tags: ${fn.tags.join(', ')}`); + return fn; } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts index 2329aa2190d95..80cb4af462288 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts @@ -9,10 +9,10 @@ import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { InterfaceDeclaration } from 'ts-morph'; import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { buildApiDeclaration } from './build_api_declaration'; import { getSourceForNode } from './utils'; -import { getApiSectionId } from '../utils'; +import { getApiSectionId, isInternal } from '../utils'; import { getSignature } from './get_signature'; export function buildInterfaceDec( @@ -27,18 +27,21 @@ export function buildInterfaceDec( label: node.getName(), signature: getSignature(node, plugins, log), description: getCommentsFromNode(node), - children: node - .getMembers() - .map((m) => - buildApiDeclaration( - m, - plugins, - log, - anchorLink.pluginName, - anchorLink.scope, - anchorLink.apiName - ) - ), + tags: getJSDocTagNames(node), + children: node.getMembers().reduce((acc, m) => { + const child = buildApiDeclaration( + m, + plugins, + log, + anchorLink.pluginName, + anchorLink.scope, + anchorLink.apiName + ); + if (!isInternal(child)) { + acc.push(child); + } + return acc; + }, [] as ApiDeclaration[]), source: getSourceForNode(node), }; } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts index 39d47d5bacba1..c067e1b032bee 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts @@ -9,7 +9,7 @@ import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { TypeLiteralNode } from 'ts-morph'; import { getApiSectionId } from '../utils'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; import { getSourceForNode } from './utils'; @@ -37,6 +37,7 @@ export function buildTypeLiteralDec( id: getApiSectionId(anchorLink), type: TypeKind.ObjectKind, label: name, + tags: getJSDocTagNames(node), description: getCommentsFromNode(node), children: node .getMembers() diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts index 86e8e5078b6fb..f9ba00160c59f 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts @@ -15,8 +15,8 @@ import { PropertySignature, ShorthandPropertyAssignment, } from 'ts-morph'; -import { getApiSectionId } from '../utils'; -import { getCommentsFromNode } from './js_doc_utils'; +import { getApiSectionId, isInternal } from '../utils'; +import { getCommentsFromNode, getJSDocTagNames } from './js_doc_utils'; import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; import { getArrowFunctionDec } from './build_arrow_fn_dec'; import { buildApiDeclaration } from './build_api_declaration'; @@ -51,8 +51,9 @@ export function buildVariableDec( return { id: getApiSectionId(anchorLink), type: TypeKind.ObjectKind, - children: initializer.getProperties().map((prop) => { - return buildApiDeclaration( + tags: getJSDocTagNames(node), + children: initializer.getProperties().reduce((acc, prop) => { + const child = buildApiDeclaration( prop, plugins, log, @@ -60,7 +61,11 @@ export function buildVariableDec( anchorLink.scope, anchorLink.apiName ); - }), + if (!isInternal(child)) { + acc.push(child); + } + return acc; + }, [] as ApiDeclaration[]), description: getCommentsFromNode(node), label: node.getName(), source: getSourceForNode(node), @@ -71,6 +76,7 @@ export function buildVariableDec( // Otherwise return it just as a single entry. return { + tags: getJSDocTagNames(node), id: getApiSectionId(anchorLink), type: getTypeKind(node), label: node.getName(), diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts index c68d146f71502..77c16428b26a9 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts @@ -10,6 +10,20 @@ import { ImAType } from './types'; +/** + * @internal + */ +export class IShouldBeInternalClass { + st: string; +} + +/** + * @internal + */ +export interface IShouldBeInternalInterface { + st: string; +} + /** * An interface with a generic. */ diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts index 52abd520f8259..1236e9ca81e3e 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts @@ -45,6 +45,13 @@ export const aPretendNamespaceObj = { }, }; +/** + * @internal + */ +export const iShouldBeInternalObj = { + foo: 'hi', +}; + /** * This is a complicated union type */ diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts index c341a80c0875d..5190f8e0c6fb4 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts @@ -76,3 +76,8 @@ interface ImNotExported { export const fnWithNonExportedRef = (a: ImNotExported) => 'shi'; export type NotAnArrowFnType = typeof notAnArrowFn; + +/** + * @internal + */ +export const iShouldBeInternalFn = () => 'hi'; diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts index 839dc828c1886..9426cedc11380 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts @@ -66,6 +66,11 @@ export interface Start { * @returns The currently selected {@link SearchLanguage} */ getSearchLanguage: () => SearchLanguage; + + /** + * @internal + */ + anInternalStartFn: () => string; } /** diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts index 0f06f08018c22..cda793c3a0260 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts @@ -43,3 +43,6 @@ export type IRefANotExportedType = ImNotExportedFromIndex | { zed: 'hi' }; export interface ImAnObject { foo: FnWithGeneric; } + +/** @internal */ +export type IShouldBeInternal = string | { foo: string }; diff --git a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts index f32e58bdfc023..158eb68b4e5b7 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts @@ -170,9 +170,19 @@ describe('functions', () => { expect(fn2).toBeDefined(); expect(fn2?.type).toBe(TypeKind.FunctionKind); }); + + it('Fn with internal tag is not exported', () => { + const fn = doc.client.find((c) => c.label === 'iShouldBeInternalFn'); + expect(fn).toBeUndefined(); + }); }); describe('objects', () => { + it('Object with internal tag is not exported', () => { + const obj = doc.client.find((c) => c.label === 'iShouldBeInternalObj'); + expect(obj).toBeUndefined(); + }); + it('Object exported correctly', () => { const obj = doc.client.find((c) => c.label === 'aPretendNamespaceObj'); expect(obj).toBeDefined(); @@ -297,6 +307,11 @@ describe('Misc types', () => { expect(linkCount(type?.signature!)).toBe(3); expect((type!.signature![1] as Reference).docId).toBe('kibPluginAFooPluginApi'); }); + + it('types with internal tags are not exported', () => { + const internal = doc.client.find((c) => c.label === 'IShouldBeInternal'); + expect(internal).toBeUndefined(); + }); }); describe('interfaces and classes', () => { @@ -394,4 +409,21 @@ describe('interfaces and classes', () => { expect(fnWithGeneric).toBeDefined(); expect(fnWithGeneric?.type).toBe(TypeKind.FunctionKind); }); + + it('interfaces with internal tags are not exported', () => { + const internal = doc.client.find((c) => c.label === 'IShouldBeInternalInterface'); + expect(internal).toBeUndefined(); + }); + + it('classes with internal tags are not exported', () => { + const clss = doc.client.find((c) => c.label === 'IShouldBeInternalClass'); + expect(clss).toBeUndefined(); + }); + + it('interface property marked as internal not exported', () => { + const start = doc.client.find((c) => c.label === 'Start'); + + const internal = start?.children?.find((c) => c.label === 'anInternalStartFn'); + expect(internal).toBeUndefined(); + }); }); diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json index ab605006d7e3d..99b108eb2e6b3 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json @@ -5,6 +5,7 @@ { "id": "def-public.ExampleClass", "type": "Class", + "tags": [], "label": "ExampleClass", "description": [], "signature": [ @@ -27,14 +28,15 @@ ], "children": [ { + "tags": [], "id": "def-public.ExampleClass.component", "type": "CompoundType", "label": "component", "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 30, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L30" + "lineNumber": 44, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L44" }, "signature": [ "React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined" @@ -59,8 +61,8 @@ "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 32, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L32" + "lineNumber": 46, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L46" } } ], @@ -68,8 +70,8 @@ "returnComment": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 32, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L32" + "lineNumber": 46, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L46" } }, { @@ -92,8 +94,8 @@ "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 40, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L40" + "lineNumber": 54, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L54" } } ], @@ -121,9 +123,10 @@ "label": "arrowFn", "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 40, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L40" + "lineNumber": 54, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L54" }, + "tags": [], "returnComment": [] }, { @@ -163,8 +166,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 46, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L46" + "lineNumber": 60, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L60" } } ], @@ -172,21 +175,22 @@ "returnComment": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 46, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L46" + "lineNumber": 60, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L60" } } ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 24, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L24" + "lineNumber": 38, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L38" }, "initialIsOpen": false }, { "id": "def-public.CrazyClass", "type": "Class", + "tags": [], "label": "CrazyClass", "description": [], "signature": [ @@ -218,8 +222,8 @@ "children": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 51, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L51" + "lineNumber": 65, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L65" }, "initialIsOpen": false } @@ -489,6 +493,7 @@ "lineNumber": 41, "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts#L41" }, + "tags": [], "returnComment": [ "something!" ], @@ -502,9 +507,11 @@ "id": "def-public.crazyFunction.obj", "type": "Object", "label": "obj", + "tags": [], "description": [], "children": [ { + "tags": [], "id": "def-public.crazyFunction.obj.hi", "type": "string", "label": "hi", @@ -526,9 +533,11 @@ "id": "def-public.crazyFunction.{-fn }", "type": "Object", "label": "{ fn }", + "tags": [], "description": [], "children": [ { + "tags": [], "id": "def-public.crazyFunction.{-fn }.fn", "type": "Function", "label": "fn", @@ -553,9 +562,11 @@ "id": "def-public.crazyFunction.{-str }", "type": "Object", "label": "{ str }", + "tags": [], "description": [], "children": [ { + "tags": [], "id": "def-public.crazyFunction.{-str }.str", "type": "string", "label": "str", @@ -586,6 +597,7 @@ "lineNumber": 66, "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts#L66" }, + "tags": [], "returnComment": [ "I have no idea." ], @@ -620,6 +632,7 @@ "lineNumber": 76, "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts#L76" }, + "tags": [], "returnComment": [], "initialIsOpen": false } @@ -632,8 +645,10 @@ "description": [ "\nThe SearchSpec interface contains settings for creating a new SearchService, like\nusername and password." ], + "tags": [], "children": [ { + "tags": [], "id": "def-public.SearchSpec.username", "type": "string", "label": "username", @@ -647,6 +662,7 @@ } }, { + "tags": [], "id": "def-public.SearchSpec.password", "type": "string", "label": "password", @@ -684,16 +700,18 @@ "description": [ "\nAn interface with a generic." ], + "tags": [], "children": [ { + "tags": [], "id": "def-public.WithGen.t", "type": "Uncategorized", "label": "t", "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 17, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L17" + "lineNumber": 31, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L31" }, "signature": [ "T" @@ -702,8 +720,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 16, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L16" + "lineNumber": 30, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L30" }, "initialIsOpen": false }, @@ -722,16 +740,18 @@ "" ], "description": [], + "tags": [], "children": [ { + "tags": [], "id": "def-public.AnotherInterface.t", "type": "Uncategorized", "label": "t", "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 21, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L21" + "lineNumber": 35, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L35" }, "signature": [ "T" @@ -740,8 +760,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 20, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L20" + "lineNumber": 34, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L34" }, "initialIsOpen": false }, @@ -770,8 +790,10 @@ "description": [ "\nThis is an example interface so we can see how it appears inside the API\ndocumentation system." ], + "tags": [], "children": [ { + "tags": [], "id": "def-public.ExampleInterface.getAPromiseThatResolvesToString", "type": "Function", "label": "getAPromiseThatResolvesToString", @@ -780,14 +802,15 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 61, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L61" + "lineNumber": 75, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L75" }, "signature": [ "() => Promise" ] }, { + "tags": [], "id": "def-public.ExampleInterface.aFnWithGen", "type": "Function", "label": "aFnWithGen", @@ -796,8 +819,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 67, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L67" + "lineNumber": 81, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L81" }, "signature": [ "(t: T) => void" @@ -818,15 +841,15 @@ "returnComment": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 72, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L72" + "lineNumber": 86, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L86" } } ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 57, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L57" + "lineNumber": 71, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L71" }, "initialIsOpen": false }, @@ -837,16 +860,18 @@ "description": [ "\nAn interface that has a react component." ], + "tags": [], "children": [ { + "tags": [], "id": "def-public.IReturnAReactComponent.component", "type": "CompoundType", "label": "component", "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 79, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L79" + "lineNumber": 93, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L93" }, "signature": [ "React.ComponentType<{}>" @@ -855,8 +880,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts", - "lineNumber": 78, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L78" + "lineNumber": 92, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/classes.ts#L92" }, "initialIsOpen": false }, @@ -865,8 +890,10 @@ "type": "Interface", "label": "ImAnObject", "description": [], + "tags": [], "children": [ { + "tags": [], "id": "def-public.ImAnObject.foo", "type": "Function", "label": "foo", @@ -900,6 +927,7 @@ "id": "def-public.DayOfWeek", "type": "Enum", "label": "DayOfWeek", + "tags": [], "description": [ "\nComments on enums." ], @@ -913,6 +941,7 @@ ], "misc": [ { + "tags": [], "id": "def-public.imAnAny", "type": "Any", "label": "imAnAny", @@ -928,6 +957,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.imAnUnknown", "type": "Unknown", "label": "imAnUnknown", @@ -946,6 +976,7 @@ "id": "def-public.NotAnArrowFnType", "type": "Type", "label": "NotAnArrowFnType", + "tags": [], "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts", @@ -982,6 +1013,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.aUnionProperty", "type": "CompoundType", "label": "aUnionProperty", @@ -990,8 +1022,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 51, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L51" + "lineNumber": 58, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L58" }, "signature": [ "string | number | (() => string) | ", @@ -1007,6 +1039,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.aStrArray", "type": "Array", "label": "aStrArray", @@ -1015,8 +1048,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 56, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L56" + "lineNumber": 63, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L63" }, "signature": [ "string[]" @@ -1024,6 +1057,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.aNumArray", "type": "Array", "label": "aNumArray", @@ -1032,8 +1066,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 61, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L61" + "lineNumber": 68, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L68" }, "signature": [ "number[]" @@ -1041,6 +1075,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.aStr", "type": "string", "label": "aStr", @@ -1049,12 +1084,13 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 66, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L66" + "lineNumber": 73, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L73" }, "initialIsOpen": false }, { + "tags": [], "id": "def-public.aNum", "type": "number", "label": "aNum", @@ -1063,8 +1099,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 71, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L71" + "lineNumber": 78, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L78" }, "signature": [ "10" @@ -1072,6 +1108,7 @@ "initialIsOpen": false }, { + "tags": [], "id": "def-public.literalString", "type": "string", "label": "literalString", @@ -1080,8 +1117,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts", - "lineNumber": 76, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L76" + "lineNumber": 83, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L83" }, "signature": [ "\"HI\"" @@ -1092,6 +1129,7 @@ "id": "def-public.StringOrUndefinedType", "type": "Type", "label": "StringOrUndefinedType", + "tags": [], "description": [ "\nHow should a potentially undefined type show up." ], @@ -1109,6 +1147,7 @@ "id": "def-public.TypeWithGeneric", "type": "Type", "label": "TypeWithGeneric", + "tags": [], "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts", @@ -1124,6 +1163,7 @@ "id": "def-public.ImAType", "type": "Type", "label": "ImAType", + "tags": [], "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts", @@ -1162,6 +1202,7 @@ "id": "def-public.FnWithGeneric", "type": "Type", "label": "FnWithGeneric", + "tags": [], "description": [ "\nThis is a type that defines a function.\n" ], @@ -1187,6 +1228,7 @@ "id": "def-public.MultipleDeclarationsType", "type": "Type", "label": "MultipleDeclarationsType", + "tags": [], "description": [ "\nCalling node.getSymbol().getDeclarations() will return > 1 declaration." ], @@ -1204,6 +1246,7 @@ "id": "def-public.IRefANotExportedType", "type": "Type", "label": "IRefANotExportedType", + "tags": [], "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/types.ts", @@ -1227,8 +1270,10 @@ { "id": "def-public.aPretendNamespaceObj", "type": "Object", + "tags": [], "children": [ { + "tags": [], "id": "def-public.aPretendNamespaceObj.notAnArrowFn", "type": "Function", "label": "notAnArrowFn", @@ -1252,6 +1297,7 @@ ] }, { + "tags": [], "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection", "type": "Function", "label": "aPropertyMisdirection", @@ -1326,9 +1372,11 @@ "lineNumber": 31, "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/const_vars.ts#L31" }, + "tags": [], "returnComment": [] }, { + "tags": [], "id": "def-public.aPretendNamespaceObj.aPropertyStr", "type": "string", "label": "aPropertyStr", @@ -1344,8 +1392,10 @@ { "id": "def-public.aPretendNamespaceObj.nestedObj", "type": "Object", + "tags": [], "children": [ { + "tags": [], "id": "def-public.aPretendNamespaceObj.nestedObj.foo", "type": "string", "label": "foo", @@ -1387,8 +1437,12 @@ "description": [ "\nAccess setup functionality from your plugin's setup function by adding the example\nplugin as a dependency.\n\n```ts\nClass MyPlugin {\n setup(core: CoreDependencies, { example }: PluginDependencies) {\n // Here you can access this functionality.\n example.getSearchService();\n }\n}\n```" ], + "tags": [], "children": [ { + "tags": [ + "beta" + ], "id": "def-public.Setup.getSearchService", "type": "Function", "label": "getSearchService", @@ -1397,8 +1451,8 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 96, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L96" + "lineNumber": 101, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L101" }, "signature": [ "(searchSpec: ", @@ -1413,6 +1467,7 @@ ] }, { + "tags": [], "id": "def-public.Setup.getSearchService2", "type": "Function", "label": "getSearchService2", @@ -1421,14 +1476,17 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 104, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L104" + "lineNumber": 109, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L109" }, "signature": [ "(searchSpec: { username: string; password: string; }) => string" ] }, { + "tags": [ + "deprecated" + ], "id": "def-public.Setup.doTheThing", "type": "Function", "label": "doTheThing", @@ -1437,14 +1495,15 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 117, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L117" + "lineNumber": 122, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L122" }, "signature": [ "(thingOne: number, thingTwo: string, thingThree: { nestedVar: number; }) => void" ] }, { + "tags": [], "id": "def-public.Setup.fnWithInlineParams", "type": "Function", "label": "fnWithInlineParams", @@ -1453,14 +1512,15 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 128, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L128" + "lineNumber": 133, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L133" }, "signature": [ "(obj: { fn: (foo: { param: string; }) => number; }) => () => { retFoo: () => string; }" ] }, { + "tags": [], "id": "def-public.Setup.id", "type": "string", "label": "id", @@ -1469,15 +1529,15 @@ ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 135, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L135" + "lineNumber": 140, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L140" } } ], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts", - "lineNumber": 84, - "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L84" + "lineNumber": 89, + "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/plugin.ts#L89" }, "lifecycle": "setup", "initialIsOpen": true @@ -1489,8 +1549,10 @@ "description": [ "\nAccess start functionality from your plugin's start function by adding the example\nplugin as a dependency.\n\n```ts\nClass MyPlugin {\n start(core: CoreDependencies, { example }: PluginDependencies) {\n // Here you can access this functionality.\n example.getSearchLanguage();\n }\n}\n```" ], + "tags": [], "children": [ { + "tags": [], "id": "def-public.Start.getSearchLanguage", "type": "Function", "label": "getSearchLanguage", @@ -1538,8 +1600,10 @@ "type": "Interface", "label": "ImACommonType", "description": [], + "tags": [], "children": [ { + "tags": [], "id": "def-common.ImACommonType.goo", "type": "number", "label": "goo", diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx index 615bf7cb2460d..4325244ca0f0c 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx @@ -6,6 +6,7 @@ image: https://source.unsplash.com/400x175/?github summary: API docs for the pluginA plugin date: 2020-11-16 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'pluginA'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- import pluginAObj from './plugin_a.json'; @@ -14,21 +15,30 @@ import pluginAObj from './plugin_a.json'; ### Setup + ### Start + ### Objects + ### Functions + ### Classes + ### Interfaces + ### Enums + ### Consts, variables and types + ## Common ### Interfaces + diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.json index 2589948b54ff0..00fb2bd3aa7a9 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.json @@ -17,6 +17,7 @@ "lineNumber": 9, "link": "https://github.com/elastic/kibana/tree/masterpackages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/foo/index.ts#L9" }, + "tags": [], "returnComment": [], "initialIsOpen": false } @@ -28,6 +29,7 @@ "id": "def-public.FooType", "type": "Type", "label": "FooType", + "tags": [], "description": [], "source": { "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/foo/index.ts", @@ -57,6 +59,7 @@ "enums": [], "misc": [ { + "tags": [], "id": "def-common.commonFoo", "type": "string", "label": "commonFoo", diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx index a4f05fdeb2076..409c6f7e624a2 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx @@ -6,6 +6,7 @@ image: https://source.unsplash.com/400x175/?github summary: API docs for the pluginA.foo plugin date: 2020-11-16 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'pluginA.foo'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- import pluginAFooObj from './plugin_a_foo.json'; @@ -14,9 +15,12 @@ import pluginAFooObj from './plugin_a_foo.json'; ### Functions + ### Consts, variables and types + ## Common ### Consts, variables and types + diff --git a/packages/kbn-docs-utils/src/api_docs/utils.ts b/packages/kbn-docs-utils/src/api_docs/utils.ts index 66cdfee8f233b..3372d0249e29b 100644 --- a/packages/kbn-docs-utils/src/api_docs/utils.ts +++ b/packages/kbn-docs-utils/src/api_docs/utils.ts @@ -203,3 +203,7 @@ function scopeAccessor(scope: ApiScope): 'server' | 'common' | 'client' { return 'common'; } } + +export const isInternal = (dec: ApiDeclaration) => { + return dec.tags && dec.tags.find((tag) => tag === 'internal'); +};