Skip to content

Commit

Permalink
docs: Update types and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ldoppea committed Dec 19, 2024
1 parent 9661764 commit 7f3835c
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/api/cozy-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ cozy-client

*Defined in*

packages/cozy-client/src/performances/defaultPerformanceApi.js:2
[packages/cozy-client/src/performances/defaultPerformanceApi.js:2](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/performances/defaultPerformanceApi.js#L2)

***

Expand Down Expand Up @@ -163,7 +163,7 @@ This hook manages the state during the saving of a document

*Defined in*

packages/cozy-client/src/performances/webPerformanceApi.js:42
[packages/cozy-client/src/performances/webPerformanceApi.js:42](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/performances/webPerformanceApi.js#L42)

## Functions

Expand Down
3 changes: 2 additions & 1 deletion docs/api/cozy-client/classes/CozyClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -1564,13 +1564,14 @@ Contains the fetched token and the client information.

### requestMutation

**requestMutation**(`definition`): `any`
**requestMutation**(`definition`, `options`): `any`

*Parameters*

| Name | Type |
| :------ | :------ |
| `definition` | `any` |
| `options` | `any` |

*Returns*

Expand Down
9 changes: 5 additions & 4 deletions docs/api/cozy-client/classes/CozyLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ Persist the given data into the links storage

*Defined in*

[packages/cozy-client/src/CozyLink.js:31](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L31)
[packages/cozy-client/src/CozyLink.js:32](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L32)

***

### request

**request**(`operation`, `result`, `forward`): `Promise`<`any`>
**request**(`operation`, `options`, `result`, `forward`): `Promise`<`any`>

Request the given operation from the link

Expand All @@ -63,6 +63,7 @@ Request the given operation from the link
| Name | Type | Description |
| :------ | :------ | :------ |
| `operation` | `any` | The operation to request |
| `options` | `any` | The request options |
| `result` | `any` | The result from the previous request of the chain |
| `forward` | `any` | The next request of the chain |

Expand All @@ -72,7 +73,7 @@ Request the given operation from the link

*Defined in*

[packages/cozy-client/src/CozyLink.js:20](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L20)
[packages/cozy-client/src/CozyLink.js:21](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L21)

***

Expand All @@ -88,4 +89,4 @@ Reset the link data

*Defined in*

[packages/cozy-client/src/CozyLink.js:40](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L40)
[packages/cozy-client/src/CozyLink.js:41](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L41)
6 changes: 4 additions & 2 deletions docs/api/cozy-client/classes/StackLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ Transfers queries and mutations to a remote stack

### executeMutation

**executeMutation**(`mutation`, `result`, `forward`): `Promise`<`any`>
**executeMutation**(`mutation`, `options`, `result`, `forward`): `Promise`<`any`>

*Parameters*

| Name | Type |
| :------ | :------ |
| `mutation` | `any` |
| `options` | `any` |
| `result` | `any` |
| `forward` | `any` |

Expand Down Expand Up @@ -153,7 +154,7 @@ Persist the given data into the links storage

### request

**request**(`operation`, `result`, `forward`): `Promise`<`any`>
**request**(`operation`, `options`, `result`, `forward`): `Promise`<`any`>

Request the given operation from the link

Expand All @@ -162,6 +163,7 @@ Request the given operation from the link
| Name | Type |
| :------ | :------ |
| `operation` | `any` |
| `options` | `any` |
| `result` | `any` |
| `forward` | `any` |

Expand Down
3 changes: 2 additions & 1 deletion docs/api/cozy-client/classes/WebFlagshipLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Persist the given data into the links storage

### request

**request**(`operation`, `result`, `forward`): `Promise`<`boolean`>
**request**(`operation`, `options`, `result`, `forward`): `Promise`<`boolean`>

Request the given operation from the link

Expand All @@ -99,6 +99,7 @@ Request the given operation from the link
| Name | Type |
| :------ | :------ |
| `operation` | `any` |
| `options` | `any` |
| `result` | `any` |
| `forward` | `any` |

Expand Down
6 changes: 4 additions & 2 deletions docs/api/cozy-pouch-link/classes/PouchLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,14 @@ Create the PouchDB index if not existing

### executeMutation

**executeMutation**(`mutation`, `result`, `forward`): `Promise`<`any`>
**executeMutation**(`mutation`, `options`, `result`, `forward`): `Promise`<`any`>

*Parameters*

| Name | Type |
| :------ | :------ |
| `mutation` | `any` |
| `options` | `any` |
| `result` | `any` |
| `forward` | `any` |

Expand Down Expand Up @@ -652,13 +653,14 @@ CozyLink.persistCozyData

### request

**request**(`operation`, `result?`, `forward?`): `Promise`<`any`>
**request**(`operation`, `options`, `result?`, `forward?`): `Promise`<`any`>

*Parameters*

| Name | Type | Default value |
| :------ | :------ | :------ |
| `operation` | `any` | `undefined` |
| `options` | `any` | `undefined` |
| `result` | `any` | `null` |
| `forward` | (`operation`: `any`, `result`: `any`) => `void` | `doNothing` |

Expand Down
2 changes: 1 addition & 1 deletion packages/cozy-client/types/CozyClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ declare class CozyClient {
* @private
*/
private fetchRelationships;
requestMutation(definition: any): any;
requestMutation(definition: any, options: any): any;
getIncludesRelationships(queryDefinition: any): import("lodash").Dictionary<any>;
/**
* Returns documents with their relationships resolved according to their schema.
Expand Down
3 changes: 2 additions & 1 deletion packages/cozy-client/types/CozyLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ export default class CozyLink {
* Request the given operation from the link
*
* @param {any} operation - The operation to request
* @param {any} options - The request options
* @param {any} result - The result from the previous request of the chain
* @param {any} forward - The next request of the chain
* @returns {Promise<any>}
*/
request(operation: any, result: any, forward: any): Promise<any>;
request(operation: any, options: any, result: any, forward: any): Promise<any>;
/**
* Persist the given data into the links storage
*
Expand Down
2 changes: 1 addition & 1 deletion packages/cozy-client/types/StackLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class StackLink extends CozyLink {
* @returns {Promise<import("./types").ClientResponse>}
*/
executeQuery(query: QueryDefinition): Promise<import("./types").ClientResponse>;
executeMutation(mutation: any, result: any, forward: any): Promise<any>;
executeMutation(mutation: any, options: any, result: any, forward: any): Promise<any>;
}
export type StackLinkOptions = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cozy-pouch-link/types/CozyPouchLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ declare class PouchLink extends CozyLink {
skip: any;
next: boolean;
}>;
executeMutation(mutation: any, result: any, forward: any): Promise<any>;
executeMutation(mutation: any, options: any, result: any, forward: any): Promise<any>;
createDocument(mutation: any): Promise<any>;
updateDocument(mutation: any): Promise<any>;
updateDocuments(mutation: any): Promise<any[]>;
Expand Down

0 comments on commit 7f3835c

Please sign in to comment.