diff --git a/README.md b/README.md index 8c404e0..d2f58b5 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The SPIDButtonProps object contains the following properties: #### configuration -**Possible values**: `{ method : "GET" } | { extraFields ?: RecordfieldName : stringmethod : "POST" }` +**Possible values**: `{ method : "GET" } | { extraFields ?: Record, fieldName : string, method : "POST" }` **Type**: `ConfigurationGET | ConfigurationPOST` diff --git a/scripts/doc.js b/scripts/doc.js index 3ed60f5..9526ea9 100644 --- a/scripts/doc.js +++ b/scripts/doc.js @@ -52,7 +52,7 @@ function getChildren({ kindString, children, type }) { throw Error('No children found'); } -function typeDescription({ type, ...props }) { +function typeDescription({ type, ...props }, inline = false) { if (type === 'literal') { return '"' + props.value + '"'; } @@ -87,7 +87,9 @@ function typeDescription({ type, ...props }) { if (props.declaration.children) { // object shaped return `{ - ${props.declaration.children.map(typeDescription).join('\n')} + ${props.declaration.children + .map(typeDescription) + .join(inline ? ', ' : '\n')} }`; } if (props.declaration.signatures) { @@ -109,7 +111,8 @@ function unrollType(record, array) { const referenced = array.find(({ name }) => name === record.name); if (referenced) { const value = typeDescription( - referenced.type ? referenced.type : referenced + referenced.type ? referenced.type : referenced, + true ); return value && value.replace(/\n/g, ''); }