Skip to content

Commit

Permalink
Add API documentation (#197)
Browse files Browse the repository at this point in the history
* Add documentation

* Add changeset
  • Loading branch information
christianklotz authored Jun 30, 2021
1 parent 2a4c984 commit f8d0463
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-mails-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sketch-hq/sketch-assistant-utils': patch
---

Add documentation for buildAssistantConfigSchema
9 changes: 9 additions & 0 deletions packages/utils/src/assistant-config-schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ const applyRuleConfig = (ops: JSONSchemaProps, config: RuleConfig): JSONSchemaPr
}, {})
}

/**
* Builds the JSON Schema for the configuration accepted by the given
* assistant. The schema is augmented with assistant's configuration,
* meaning the options set in the configuration are used as default values
* for the corresponding properties.
*
* @param assistant Assistant to generate the configuration schema from
* @returns JSON Schema describing the assistant's configuration shape
*/
const buildAssistantConfigSchema: AssistantConfigSchemaCreator = (assistant) => {
return {
type: 'object',
Expand Down

0 comments on commit f8d0463

Please sign in to comment.