Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vrimar committed Mar 7, 2019
1 parent 0d0258f commit 289f188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/src/components/InterfaceTable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import m from 'mithril';
import { IDocumentationData } from '..';
import { Table, Popover } from '@/';
import { ITsInterface, ITsProperty, Kind } from 'documentalist/dist/client';
import { ITsInterface, ITsProperty } from 'documentalist/dist/client';

export interface IInterfaceTableAttrs {
data: IDocumentationData;
Expand Down Expand Up @@ -38,7 +38,7 @@ function renderPropRow(prop: ITsProperty, data: IDocumentationData) {
function renderPropType(prop: ITsProperty, data: IDocumentationData) {
const { type, defaultValue } = prop;
const typeDetails = data.docs.typescript[type];
const isPopover = typeDetails && typeDetails.kind === Kind.Enum;
const isPopover = typeDetails && typeDetails.kind === 'enum';

const trigger = m('.Docs-interface-type', { class: isPopover ? 'is-popover' : '' }, [
type,
Expand All @@ -49,7 +49,7 @@ function renderPropType(prop: ITsProperty, data: IDocumentationData) {
? m(Popover, {
class: 'Docs-interface-popover',
content: [
typeDetails.kind === Kind.Enum && typeDetails.members.map((member, index) => [
typeDetails.kind === 'enum' && typeDetails.members.map((member, index) => [
m('span.Docs-interface-member', `${member.defaultValue}`),
(index !== typeDetails.members.length - 1) && m('span', '|')
])
Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './style.scss';
import './favicon.ico';
import m from 'mithril';
import Main from './components/Main';
import { IMarkdownPluginData, ITypescriptPluginData, Kind } from 'documentalist/dist/client';
import { IMarkdownPluginData, ITypescriptPluginData } from 'documentalist/dist/client';
import { highlightCode } from './utils/highlightCode';

type Data = IMarkdownPluginData & ITypescriptPluginData;
Expand Down Expand Up @@ -60,7 +60,7 @@ function normalizeDocs(data: Data) {
Object.keys(data.typescript).map(key => {
const prop = data.typescript[key];

if (prop.kind === Kind.Interface || prop.kind === Kind.Class) {
if (prop.kind === 'interface' || prop.kind === 'class') {
prop.properties.sort((a, b) => {
const textA = a.name;
const textB = b.name;
Expand All @@ -74,7 +74,7 @@ function normalizeDocs(data: Data) {
});
}

if (prop.kind === Kind.Enum) {
if (prop.kind === 'enum') {
prop.members = prop.members
.filter(member => !member.name.includes('NONE') && !member.name.includes('DEFAULT'));
}
Expand Down

0 comments on commit 289f188

Please sign in to comment.