From b82c1a66a469d880936ac7fa4d30f9f0c729a116 Mon Sep 17 00:00:00 2001 From: Ldoppea Date: Fri, 26 Jul 2024 16:19:59 +0200 Subject: [PATCH] docs: Update types and documentation --- docs/api/cozy-client/README.md | 1 + docs/api/cozy-client/classes/CozyLink.md | 2 + docs/api/cozy-client/classes/FlagshipLink.md | 137 +++++++++++++++++++ packages/cozy-client/types/FlagshipLink.d.ts | 18 +++ packages/cozy-client/types/index.d.ts | 1 + 5 files changed, 159 insertions(+) create mode 100644 docs/api/cozy-client/classes/FlagshipLink.md create mode 100644 packages/cozy-client/types/FlagshipLink.d.ts diff --git a/docs/api/cozy-client/README.md b/docs/api/cozy-client/README.md index 39ae3f65a9..609dca81f5 100644 --- a/docs/api/cozy-client/README.md +++ b/docs/api/cozy-client/README.md @@ -16,6 +16,7 @@ cozy-client * [CozyClient](classes/CozyClient.md) * [CozyLink](classes/CozyLink.md) * [CozyProvider](classes/CozyProvider.md) +* [FlagshipLink](classes/FlagshipLink.md) * [HasMany](classes/HasMany.md) * [HasManyInPlace](classes/HasManyInPlace.md) * [HasManyTriggers](classes/HasManyTriggers.md) diff --git a/docs/api/cozy-client/classes/CozyLink.md b/docs/api/cozy-client/classes/CozyLink.md index 911ff17705..ce4ace3801 100644 --- a/docs/api/cozy-client/classes/CozyLink.md +++ b/docs/api/cozy-client/classes/CozyLink.md @@ -8,6 +8,8 @@ ↳ [`StackLink`](StackLink.md) + ↳ [`FlagshipLink`](FlagshipLink.md) + ## Constructors ### constructor diff --git a/docs/api/cozy-client/classes/FlagshipLink.md b/docs/api/cozy-client/classes/FlagshipLink.md new file mode 100644 index 0000000000..f45a9368f7 --- /dev/null +++ b/docs/api/cozy-client/classes/FlagshipLink.md @@ -0,0 +1,137 @@ +[cozy-client](../README.md) / FlagshipLink + +# Class: FlagshipLink + +## Hierarchy + +* [`CozyLink`](CozyLink.md) + + ↳ **`FlagshipLink`** + +## Constructors + +### constructor + +• **new FlagshipLink**(`[options]?`) + +*Parameters* + +| Name | Type | Description | +| :------ | :------ | :------ | +| `[options]` | `Object` | Options | +| `[options].client` | `any` | - | +| `[options].stackClient` | `any` | - | +| `[options].webviewIntent` | `WebviewService` | - | + +*Overrides* + +[CozyLink](CozyLink.md).[constructor](CozyLink.md#constructor) + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:11](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L11) + +## Properties + +### stackClient + +• **stackClient**: `any` + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:18](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L18) + +*** + +### webviewIntent + +• **webviewIntent**: `WebviewService` + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:19](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L19) + +## Methods + +### persistData + +▸ **persistData**(`data`, `forward`): `Promise`<`void`> + +*Parameters* + +| Name | Type | +| :------ | :------ | +| `data` | `any` | +| `forward` | `any` | + +*Returns* + +`Promise`<`void`> + +*Overrides* + +[CozyLink](CozyLink.md).[persistData](CozyLink.md#persistdata) + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:34](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L34) + +*** + +### registerClient + +▸ **registerClient**(`client`): `void` + +*Parameters* + +| Name | Type | +| :------ | :------ | +| `client` | `any` | + +*Returns* + +`void` + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:22](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L22) + +*** + +### request + +▸ **request**(`operation`, `result`, `forward`): `Promise`<`boolean`> + +*Parameters* + +| Name | Type | +| :------ | :------ | +| `operation` | `any` | +| `result` | `any` | +| `forward` | `any` | + +*Returns* + +`Promise`<`boolean`> + +*Overrides* + +[CozyLink](CozyLink.md).[request](CozyLink.md#request) + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:30](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L30) + +*** + +### reset + +▸ **reset**(): `void` + +*Returns* + +`void` + +*Defined in* + +[packages/cozy-client/src/FlagshipLink.js:26](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/FlagshipLink.js#L26) diff --git a/packages/cozy-client/types/FlagshipLink.d.ts b/packages/cozy-client/types/FlagshipLink.d.ts new file mode 100644 index 0000000000..4dfbc56053 --- /dev/null +++ b/packages/cozy-client/types/FlagshipLink.d.ts @@ -0,0 +1,18 @@ +export default class FlagshipLink extends CozyLink { + /** + * @param {object} [options] - Options + * @param {object} [options.stackClient] - A StackClient + * @param {object} [options.client] - A StackClient (deprecated) + * @param {import('cozy-intent').WebviewService} [options.webviewIntent] - The webview's intent reference + */ + constructor({ client, stackClient, webviewIntent }?: { + stackClient: object; + client: object; + webviewIntent: import('cozy-intent').WebviewService; + }); + stackClient: any; + webviewIntent: import("cozy-intent").WebviewService; + registerClient(client: any): void; + reset(): void; +} +import CozyLink from "./CozyLink"; diff --git a/packages/cozy-client/types/index.d.ts b/packages/cozy-client/types/index.d.ts index b3ac71ab58..399d4fe7b9 100644 --- a/packages/cozy-client/types/index.d.ts +++ b/packages/cozy-client/types/index.d.ts @@ -1,6 +1,7 @@ export { default } from "./CozyClient"; export { default as CozyLink } from "./CozyLink"; export { default as StackLink } from "./StackLink"; +export { default as FlagshipLink } from "./FlagshipLink"; export { default as compose } from "lodash/flow"; export { getQueryFromState } from "./store"; export { default as Registry } from "./registry";