Skip to content

Commit cba2711

Browse files
committed
docs: Update types and documentation
1 parent b5a5a6f commit cba2711

File tree

8 files changed

+86
-24
lines changed

8 files changed

+86
-24
lines changed

docs/api/cozy-client/classes/CozyLink.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,61 @@
3131

3232
### persistCozyData
3333

34-
**persistCozyData**(`data`, `forward`): `void`
34+
**persistCozyData**(`data`, `forward`): `Promise`<`any`>
35+
36+
Persist the given data into the links storage
3537

3638
*Parameters*
3739

38-
| Name | Type |
39-
| :------ | :------ |
40-
| `data` | `any` |
41-
| `forward` | `any` |
40+
| Name | Type | Description |
41+
| :------ | :------ | :------ |
42+
| `data` | `any` | The document to persist |
43+
| `forward` | `any` | The next persistCozyData of the chain |
4244

4345
*Returns*
4446

45-
`void`
47+
`Promise`<`any`>
4648

4749
*Defined in*
4850

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

5153
***
5254

5355
### request
5456

55-
**request**(`operation`, `result`, `forward`): `void`
57+
**request**(`operation`, `result`, `forward`): `Promise`<`any`>
58+
59+
Request the given operation from the link
5660

5761
*Parameters*
5862

59-
| Name | Type |
60-
| :------ | :------ |
61-
| `operation` | `any` |
62-
| `result` | `any` |
63-
| `forward` | `any` |
63+
| Name | Type | Description |
64+
| :------ | :------ | :------ |
65+
| `operation` | `any` | The operation to request |
66+
| `result` | `any` | The result from the previous request of the chain |
67+
| `forward` | `any` | The next request of the chain |
68+
69+
*Returns*
70+
71+
`Promise`<`any`>
72+
73+
*Defined in*
74+
75+
[packages/cozy-client/src/CozyLink.js:20](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L20)
76+
77+
***
78+
79+
### reset
80+
81+
**reset**(): `Promise`<`any`>
82+
83+
Reset the link data
6484

6585
*Returns*
6686

67-
`void`
87+
`Promise`<`any`>
6888

6989
*Defined in*
7090

71-
[packages/cozy-client/src/CozyLink.js:12](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L12)
91+
[packages/cozy-client/src/CozyLink.js:40](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/CozyLink.js#L40)

docs/api/cozy-client/classes/FlagshipLink.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545

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

48+
Persist the given data into the links storage
49+
4850
*Parameters*
4951

5052
| Name | Type |
@@ -90,6 +92,8 @@
9092

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

95+
Request the given operation from the link
96+
9397
*Parameters*
9498

9599
| Name | Type |
@@ -114,11 +118,17 @@
114118

115119
### reset
116120

117-
**reset**(): `void`
121+
**reset**(): `Promise`<`void`>
122+
123+
Reset the link data
118124

119125
*Returns*
120126

121-
`void`
127+
`Promise`<`void`>
128+
129+
*Overrides*
130+
131+
[CozyLink](CozyLink.md).[reset](CozyLink.md#reset)
122132

123133
*Defined in*
124134

docs/api/cozy-client/classes/StackLink.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Transfers queries and mutations to a remote stack
9898

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

101+
Persist the given data into the links storage
102+
101103
*Parameters*
102104

103105
| Name | Type |
@@ -143,6 +145,8 @@ Transfers queries and mutations to a remote stack
143145

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

148+
Request the given operation from the link
149+
146150
*Parameters*
147151

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

168172
### reset
169173

170-
**reset**(): `void`
174+
**reset**(): `Promise`<`void`>
175+
176+
Reset the link data
171177

172178
*Returns*
173179

174-
`void`
180+
`Promise`<`void`>
181+
182+
*Overrides*
183+
184+
[CozyLink](CozyLink.md).[reset](CozyLink.md#reset)
175185

176186
*Defined in*
177187

docs/api/cozy-pouch-link/classes/PouchLink.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,10 @@ CozyLink.request
603603

604604
`Promise`<`void`>
605605

606+
*Overrides*
607+
608+
CozyLink.reset
609+
606610
*Defined in*
607611

608612
[CozyPouchLink.js:229](https://github.com/cozy/cozy-client/blob/master/packages/cozy-pouch-link/src/CozyPouchLink.js#L229)
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
export default class CozyLink {
22
constructor(requestHandler: any, persistHandler: any);
3-
request(operation: any, result: any, forward: any): void;
4-
persistCozyData(data: any, forward: any): void;
3+
/**
4+
* Request the given operation from the link
5+
*
6+
* @param {any} operation - The operation to request
7+
* @param {any} result - The result from the previous request of the chain
8+
* @param {any} forward - The next request of the chain
9+
* @returns {Promise<any>}
10+
*/
11+
request(operation: any, result: any, forward: any): Promise<any>;
12+
/**
13+
* Persist the given data into the links storage
14+
*
15+
* @param {any} data - The document to persist
16+
* @param {any} forward - The next persistCozyData of the chain
17+
* @returns {Promise<any>}
18+
*/
19+
persistCozyData(data: any, forward: any): Promise<any>;
20+
/**
21+
* Reset the link data
22+
*
23+
* @returns {Promise<any>}
24+
*/
25+
reset(): Promise<any>;
526
}
627
export function chain(links: any): any;

packages/cozy-client/types/FlagshipLink.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ export default class FlagshipLink extends CozyLink {
88
});
99
webviewIntent: import("cozy-intent").WebviewService;
1010
registerClient(client: any): void;
11-
reset(): void;
1211
}
1312
import CozyLink from "./CozyLink";

packages/cozy-client/types/StackLink.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default class StackLink extends CozyLink {
1818
stackClient: any;
1919
isOnline: any;
2020
registerClient(client: any): void;
21-
reset(): void;
2221
/**
2322
*
2423
* @param {QueryDefinition} query - Query to execute

packages/cozy-pouch-link/types/CozyPouchLink.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ declare class PouchLink extends CozyLink {
9696
}): Promise<void>;
9797
onLogin(): Promise<void>;
9898
pouches: PouchManager;
99-
reset(): Promise<void>;
10099
/**
101100
* Receives PouchDB updates (documents grouped by doctype).
102101
* Normalizes the data (.id -> ._id, .rev -> _rev).

0 commit comments

Comments
 (0)