{ex.message}
${code}`) - .replace(/`([^`]+)`/g, (_, code) => `
${code}
`),
- };
-}
-
-function propTag(intent: Intent, title: string, ...children: React.ReactNode[]) {
- return (
-
- {formattedType}
- {prop.defaultValue}
-
- );
- } else {
- return (
-
- {prop.signatures[0].type}
-
- );
- }
-}
-
-function renderPropRow(prop: ITsProperty | ITsMethod) {
- const { flags: { isDeprecated, isExternal, isOptional }, inheritedFrom, name } = prop;
- const isDeprecatedBoolean = isDeprecated === true || typeof isDeprecated === "string";
- const classes = classNames("docs-prop-name", {
- "docs-prop-is-deprecated": isDeprecatedBoolean,
- "docs-prop-is-internal": !isExternal,
- "docs-prop-is-required": !isOptional,
- });
-
- const tags: JSX.Element[] = [];
- if (!isOptional) {
- tags.push(propTag(Intent.SUCCESS, "Required"));
- }
- if (isDeprecatedBoolean) {
- const maybeMessage =
- typeof isDeprecated === "string" ? (
-
- ) : (
- ""
- );
- tags.push(propTag(Intent.DANGER, "Deprecated", maybeMessage));
- }
- if (inheritedFrom != null) {
- tags.push(propTag(Intent.NONE, "Inherited from ", {inheritedFrom}
));
- }
-
- const documentation = isTsProperty(prop) ? prop.documentation : prop.signatures[0].documentation;
- // TODO: this ignores tags in prop docs, but that's kind of OK cuz they all get processed
- // into prop.tags by the TS compiler.
- const html =
- documentation && documentation.contents.reduce{name}
- {tags}
-Prop | -Description | -
---|
${code}`) + .replace(/`([^`]+)`/g, (_, code) => `
${code}
`),
+ };
+}
diff --git a/packages/docs-theme/src/components/typescript/enumTable.tsx b/packages/docs-theme/src/components/typescript/enumTable.tsx
new file mode 100644
index 00000000000..c449a9e06ba
--- /dev/null
+++ b/packages/docs-theme/src/components/typescript/enumTable.tsx
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017 Palantir Technologies, Inc. All rights reserved.
+ *
+ * Licensed under the terms of the LICENSE file distributed with this project.
+ */
+
+import * as classNames from "classnames";
+import { ITsEnum, ITsEnumMember } from "documentalist/dist/client";
+import * as React from "react";
+import { DocumentationContextTypes, IDocumentationContext } from "../../common/context";
+import { ApiHeader } from "./apiHeader";
+import { DeprecatedTag } from "./deprecatedTag";
+
+export type RendererMembers | +Description | +
---|
{name}
+
+ {entry.name}
+ {entry.defaultValue}
+
+ {this.renderTags(entry)}
+{title} | +Description | +
---|
{name}
+ {typeInfo}
+ {this.renderTags(entry)}
+{renderType(inheritedFrom)}
+ = {renderType(data.type)}
+ {renderBlock(data.documentation)} +{modifier.name}
-
- {modifierName}
+ {this.renderMarkupForModifier(markup, modifierName)}
+