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 Sep 19, 2024
1 parent b5a5a6f commit cba2711
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 24 deletions.
50 changes: 35 additions & 15 deletions docs/api/cozy-client/classes/CozyLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,61 @@

### persistCozyData

**persistCozyData**(`data`, `forward`): `void`
**persistCozyData**(`data`, `forward`): `Promise`<`any`>

Persist the given data into the links storage

*Parameters*

| Name | Type |
| :------ | :------ |
| `data` | `any` |
| `forward` | `any` |
| Name | Type | Description |
| :------ | :------ | :------ |
| `data` | `any` | The document to persist |
| `forward` | `any` | The next persistCozyData of the chain |

*Returns*

`void`
`Promise`<`any`>

*Defined in*

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

***

### request

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

Request the given operation from the link

*Parameters*

| Name | Type |
| :------ | :------ |
| `operation` | `any` |
| `result` | `any` |
| `forward` | `any` |
| Name | Type | Description |
| :------ | :------ | :------ |
| `operation` | `any` | The operation to request |
| `result` | `any` | The result from the previous request of the chain |
| `forward` | `any` | The next request of the chain |

*Returns*

`Promise`<`any`>

*Defined in*

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

***

### reset

**reset**(): `Promise`<`any`>

Reset the link data

*Returns*

`void`
`Promise`<`any`>

*Defined in*

[packages/cozy-client/src/CozyLink.js:12](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L12)
[packages/cozy-client/src/CozyLink.js:40](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L40)
14 changes: 12 additions & 2 deletions docs/api/cozy-client/classes/FlagshipLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

**persistCozyData**(`data`, `forward`): `Promise`<`void`>

Persist the given data into the links storage

*Parameters*

| Name | Type |
Expand Down Expand Up @@ -90,6 +92,8 @@

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

Request the given operation from the link

*Parameters*

| Name | Type |
Expand All @@ -114,11 +118,17 @@

### reset

**reset**(): `void`
**reset**(): `Promise`<`void`>

Reset the link data

*Returns*

`void`
`Promise`<`void`>

*Overrides*

[CozyLink](CozyLink.md).[reset](CozyLink.md#reset)

*Defined in*

Expand Down
14 changes: 12 additions & 2 deletions docs/api/cozy-client/classes/StackLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Transfers queries and mutations to a remote stack

**persistCozyData**(`data`, `forward`): `Promise`<`any`>

Persist the given data into the links storage

*Parameters*

| Name | Type |
Expand Down Expand Up @@ -143,6 +145,8 @@ Transfers queries and mutations to a remote stack

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

Request the given operation from the link

*Parameters*

| Name | Type |
Expand All @@ -167,11 +171,17 @@ Transfers queries and mutations to a remote stack

### reset

**reset**(): `void`
**reset**(): `Promise`<`void`>

Reset the link data

*Returns*

`void`
`Promise`<`void`>

*Overrides*

[CozyLink](CozyLink.md).[reset](CozyLink.md#reset)

*Defined in*

Expand Down
4 changes: 4 additions & 0 deletions docs/api/cozy-pouch-link/classes/PouchLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ CozyLink.request

`Promise`<`void`>

*Overrides*

CozyLink.reset

*Defined in*

[CozyPouchLink.js:229](https://github.com/cozy/cozy-client/blob/master/packages/cozy-pouch-link/src/CozyPouchLink.js#L229)
Expand Down
25 changes: 23 additions & 2 deletions packages/cozy-client/types/CozyLink.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
export default class CozyLink {
constructor(requestHandler: any, persistHandler: any);
request(operation: any, result: any, forward: any): void;
persistCozyData(data: any, forward: any): void;
/**
* Request the given operation from the link
*
* @param {any} operation - The operation to request
* @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>;
/**
* Persist the given data into the links storage
*
* @param {any} data - The document to persist
* @param {any} forward - The next persistCozyData of the chain
* @returns {Promise<any>}
*/
persistCozyData(data: any, forward: any): Promise<any>;
/**
* Reset the link data
*
* @returns {Promise<any>}
*/
reset(): Promise<any>;
}
export function chain(links: any): any;
1 change: 0 additions & 1 deletion packages/cozy-client/types/FlagshipLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export default class FlagshipLink extends CozyLink {
});
webviewIntent: import("cozy-intent").WebviewService;
registerClient(client: any): void;
reset(): void;
}
import CozyLink from "./CozyLink";
1 change: 0 additions & 1 deletion packages/cozy-client/types/StackLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default class StackLink extends CozyLink {
stackClient: any;
isOnline: any;
registerClient(client: any): void;
reset(): void;
/**
*
* @param {QueryDefinition} query - Query to execute
Expand Down
1 change: 0 additions & 1 deletion packages/cozy-pouch-link/types/CozyPouchLink.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ declare class PouchLink extends CozyLink {
}): Promise<void>;
onLogin(): Promise<void>;
pouches: PouchManager;
reset(): Promise<void>;
/**
* Receives PouchDB updates (documents grouped by doctype).
* Normalizes the data (.id -> ._id, .rev -> _rev).
Expand Down

0 comments on commit cba2711

Please sign in to comment.