Skip to content

Commit

Permalink
Don't display object types inline.
Browse files Browse the repository at this point in the history
Fixes #7 and as a result we can clean up types a fair bit
  • Loading branch information
tmeasday committed Aug 5, 2016
1 parent a9e73e8 commit cc8fdbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 8 additions & 2 deletions react-docs/scripts/typescript-api-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,17 @@ function _typeName(type) {
} else if (type.type === 'union') {
return _.map(type.types, _typeName).join(' | ');
} else if (type.type === 'reference') {

// check to see if the reference type is a simple type alias
var referencedData = dataByKey[type.name];
if (referencedData && referencedData.kindString === "Type alias") {
console.log(type.name, referencedData)
return _type(referencedData);

// Is it an "objecty" type? We can't display it in one line if so
if (!referencedData.type.declaration ||
!referencedData.type.declaration.children) {
return _type(referencedData);
}

}
return '<a href="#' + _typeId(type) + '">' + type.name + '</a>';
} else if (type.type === 'stringLiteral') {
Expand Down
6 changes: 0 additions & 6 deletions react-docs/source/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,12 @@ order: 6
{% tsapibox NetworkInterface %}
{% tsapibox NormalizedCache %}
{% tsapibox ApolloReducerConfig %}
{% tsapibox MutationBehaviorReducerMap %}
{% tsapibox MutationBehaviorReducer %}
{% tsapibox MutationBehaviorReducerArgs %}
{% tsapibox MutationBehavior %}
{% tsapibox MutationArrayInsertBehavior %}
{% tsapibox MutationArrayDeleteBehavior %}
{% tsapibox MutationDeleteBehavior %}
{% tsapibox ArrayInsertWhere %}
{% tsapibox Request %}
{% tsapibox RequestInit %}
{% tsapibox SelectionSet %}
{% tsapibox StorePath %}
{% tsapibox StoreObject %}
{% tsapibox StoreValue %}
{% tsapibox FragmentMap %}

0 comments on commit cc8fdbf

Please sign in to comment.