aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/documentation/type_definition.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/pages/documentation/type_definition.tsx')
-rw-r--r--packages/website/ts/pages/documentation/type_definition.tsx68
1 files changed, 23 insertions, 45 deletions
diff --git a/packages/website/ts/pages/documentation/type_definition.tsx b/packages/website/ts/pages/documentation/type_definition.tsx
index 25499a6d0..d46eec76c 100644
--- a/packages/website/ts/pages/documentation/type_definition.tsx
+++ b/packages/website/ts/pages/documentation/type_definition.tsx
@@ -1,16 +1,16 @@
import * as _ from 'lodash';
import * as React from 'react';
-import {Comment} from 'ts/pages/documentation/comment';
-import {CustomEnum} from 'ts/pages/documentation/custom_enum';
-import {DocsInfo} from 'ts/pages/documentation/docs_info';
-import {Enum} from 'ts/pages/documentation/enum';
-import {Interface} from 'ts/pages/documentation/interface';
-import {MethodSignature} from 'ts/pages/documentation/method_signature';
-import {Type} from 'ts/pages/documentation/type';
-import {AnchorTitle} from 'ts/pages/shared/anchor_title';
-import {CustomType, CustomTypeChild, HeaderSizes, KindString, TypeDocTypes} from 'ts/types';
-import {colors} from 'ts/utils/colors';
-import {utils} from 'ts/utils/utils';
+import { Comment } from 'ts/pages/documentation/comment';
+import { CustomEnum } from 'ts/pages/documentation/custom_enum';
+import { DocsInfo } from 'ts/pages/documentation/docs_info';
+import { Enum } from 'ts/pages/documentation/enum';
+import { Interface } from 'ts/pages/documentation/interface';
+import { MethodSignature } from 'ts/pages/documentation/method_signature';
+import { Type } from 'ts/pages/documentation/type';
+import { AnchorTitle } from 'ts/pages/shared/anchor_title';
+import { CustomType, CustomTypeChild, HeaderSizes, KindString, TypeDocTypes } from 'ts/types';
+import { colors } from 'ts/utils/colors';
+import { utils } from 'ts/utils/utils';
interface TypeDefinitionProps {
sectionName: string;
@@ -45,21 +45,13 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
case KindString.Interface:
typePrefix = 'Interface';
codeSnippet = (
- <Interface
- type={customType}
- sectionName={this.props.sectionName}
- docsInfo={this.props.docsInfo}
- />
+ <Interface type={customType} sectionName={this.props.sectionName} docsInfo={this.props.docsInfo} />
);
break;
case KindString.Variable:
typePrefix = 'Enum';
- codeSnippet = (
- <CustomEnum
- type={customType}
- />
- );
+ codeSnippet = <CustomEnum type={customType} />;
break;
case KindString.Enumeration:
@@ -70,28 +62,21 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
defaultValue: c.defaultValue,
};
});
- codeSnippet = (
- <Enum
- values={enumValues}
- />
- );
+ codeSnippet = <Enum values={enumValues} />;
break;
case KindString.TypeAlias:
typePrefix = 'Type Alias';
codeSnippet = (
<span>
- <span
- style={{color: colors.lightPurple}}
- >
- type
- </span> {customType.name} ={' '}
- {customType.type.typeDocType !== TypeDocTypes.Reflection ?
+ <span style={{ color: colors.lightPurple }}>type</span> {customType.name} ={' '}
+ {customType.type.typeDocType !== TypeDocTypes.Reflection ? (
<Type
type={customType.type}
sectionName={this.props.sectionName}
docsInfo={this.props.docsInfo}
- /> :
+ />
+ ) : (
<MethodSignature
method={customType.type.method}
sectionName={this.props.sectionName}
@@ -99,7 +84,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
shouldUseArrowSyntax={true}
docsInfo={this.props.docsInfo}
/>
- }
+ )}
</span>
);
break;
@@ -113,7 +98,7 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
<div
id={this.props.shouldAddId ? typeDefinitionAnchorId : ''}
className="pb2"
- style={{overflow: 'hidden', width: '100%'}}
+ style={{ overflow: 'hidden', width: '100%' }}
onMouseOver={this._setAnchorVisibility.bind(this, true)}
onMouseOut={this._setAnchorVisibility.bind(this, false)}
>
@@ -123,19 +108,12 @@ export class TypeDefinition extends React.Component<TypeDefinitionProps, TypeDef
id={this.props.shouldAddId ? typeDefinitionAnchorId : ''}
shouldShowAnchor={this.state.shouldShowAnchor}
/>
- <div style={{fontSize: 16}}>
+ <div style={{ fontSize: 16 }}>
<pre>
- <code className="hljs">
- {codeSnippet}
- </code>
+ <code className="hljs">{codeSnippet}</code>
</pre>
</div>
- {customType.comment &&
- <Comment
- comment={customType.comment}
- className="py2"
- />
- }
+ {customType.comment && <Comment comment={customType.comment} className="py2" />}
</div>
);
}