diff --git a/site/docs/api/UseAPIConfig.mdx b/site/docs/api/UseAPIConfig.mdx new file mode 100644 index 0000000..6f1e1ca --- /dev/null +++ b/site/docs/api/UseAPIConfig.mdx @@ -0,0 +1,16 @@ +--- +custom_edit_url: null +--- + +
+ +
+ +**Type**: object + +|PROPERTY|TYPE|DESCRIPTION| +|:---:|:---:|:---:| +|serviceName|string|Name of the feathers service| +|params|object|Params to find to service.find()| +|onError|function|Callback for when an error occurs| + diff --git a/site/docs/api/UseAPIResponse.mdx b/site/docs/api/UseAPIResponse.mdx new file mode 100644 index 0000000..04ee23a --- /dev/null +++ b/site/docs/api/UseAPIResponse.mdx @@ -0,0 +1,16 @@ +--- +custom_edit_url: null +--- + +
+ +
+ +**Type**: object + +|PROPERTY|TYPE|DESCRIPTION| +|:---:|:---:|:---:| +|response|object|Feathers response| +|loading|boolean|Loading state| +|error|error|Feathers service error| + diff --git a/site/docs/api/useApi.mdx b/site/docs/api/useApi.mdx new file mode 100644 index 0000000..1cb5d53 --- /dev/null +++ b/site/docs/api/useApi.mdx @@ -0,0 +1,21 @@ +--- +custom_edit_url: null +--- + +```ts +function useApi(config: [UseAPIConfig](UseAPIConfig), ready: boolean = true) +``` + +
+ +
+ +Access the Feathers API directly, via a specific service + +**Returns**: + +|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| +|:---:|:---:|:---:|:---:|:---:| +|config|[UseAPIConfig](UseAPIConfig)|||| +|ready|boolean|✔️|true|| + diff --git a/site/docs/api/useDebounce.mdx b/site/docs/api/useDebounce.mdx new file mode 100644 index 0000000..85e0743 --- /dev/null +++ b/site/docs/api/useDebounce.mdx @@ -0,0 +1,22 @@ +--- +custom_edit_url: null +--- + +```ts +function useDebounce(value: any, delay: number) +``` + +
+ +
+ +Debounce a value. Useful during auto-complete typing, to avoid pinging your API too much. + +**Returns**: +- value from executed function + +|PARAMETER|TYPE|OPTIONAL|DEFAULT|DESCRIPTION| +|:---:|:---:|:---:|:---:|:---:| +|value|any|||value to debounce| +|delay|number|||MS to delay| + diff --git a/site/jsdoc-mdx-conf.json b/site/jsdoc-mdx-conf.json new file mode 100644 index 0000000..10d65ab --- /dev/null +++ b/site/jsdoc-mdx-conf.json @@ -0,0 +1,11 @@ +{ + "tags": { + "allowUnknownTags" : true, + "dictionaries": ["jsdoc", "closure"] + }, + "source": { + "include": ["../packages/react-feathers/src/hooks/"], + "includePattern": ".+\\.(j|t)s(doc|x)?$", + "excludePattern": "(^|\\/|\\\\)_" + } +} diff --git a/site/jsdoc-mdx.json b/site/jsdoc-mdx.json new file mode 100644 index 0000000..fb6adee --- /dev/null +++ b/site/jsdoc-mdx.json @@ -0,0 +1,5 @@ +{ + "sidebar": "./", + "outDir": "./docs/api", + "jsdoc": "./jsdoc-mdx-conf.json" +} \ No newline at end of file diff --git a/site/package.json b/site/package.json index d76a230..3f6665c 100644 --- a/site/package.json +++ b/site/package.json @@ -14,6 +14,7 @@ "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "api-generate": "jsdoc2md --files ../packages/react-feathers/src/hooks/*.js --configure jsdoc-conf.js > docs/API.md", + "api-generate-2": "npx jsdoc-to-mdx -c jsdoc-mdx.json", "typecheck": "tsc" }, "dependencies": {