-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add generated types and documentation for new exported helpers
- Loading branch information
1 parent
6c8adf4
commit a6b74bd
Showing
5 changed files
with
196 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
[cozy-client](../README.md) / [models](models.md) / paper | ||
|
||
# Namespace: paper | ||
|
||
[models](models.md).paper | ||
|
||
## Type aliases | ||
|
||
### IOCozyFile | ||
|
||
Ƭ **IOCozyFile**<>: `IOCozyFile` | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:5](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L5) | ||
|
||
## Functions | ||
|
||
### computeExpirationDate | ||
|
||
▸ **computeExpirationDate**(`file`): `Date` | ||
|
||
**`description`** Computes et returns the expiration date of the given file, or null if it is not expiring | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`Date` | ||
|
||
Expiration date | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:85](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L85) | ||
|
||
*** | ||
|
||
### computeExpirationNoticeDate | ||
|
||
▸ **computeExpirationNoticeDate**(`file`): `Date` | ||
|
||
**`description`** Computes et returns the expiration notice date of the given file, or null if it is not expiring | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`Date` | ||
|
||
Expiration notice date | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:121](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L121) | ||
|
||
*** | ||
|
||
### computeExpirationNoticeLink | ||
|
||
▸ **computeExpirationNoticeLink**(`file`): `string` | ||
|
||
**`description`** Computes et returns the expiration notice link of the given file, or null if it has none or it is not expiring | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`string` | ||
|
||
Expiration notice link | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:140](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L140) | ||
|
||
*** | ||
|
||
### isExpired | ||
|
||
▸ **isExpired**(`file`): `boolean` | ||
|
||
**`description`** Tells if the given file is expiring and if today is after its expiration date | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`boolean` | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:155](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L155) | ||
|
||
*** | ||
|
||
### isExpiring | ||
|
||
▸ **isExpiring**(`file`): `boolean` | ||
|
||
**`description`** Tells if a given file matches one of the known types of expiring papers | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`boolean` | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:67](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L67) | ||
|
||
*** | ||
|
||
### isExpiringSoon | ||
|
||
▸ **isExpiringSoon**(`file`): `boolean` | ||
|
||
**`description`** Tells if the given file is expiring and if today is between its expiration notice date and its expiration date | ||
|
||
*Parameters* | ||
|
||
| Name | Type | Description | | ||
| :------ | :------ | :------ | | ||
| `file` | `IOCozyFile` | io.cozy.files document | | ||
|
||
*Returns* | ||
|
||
`boolean` | ||
|
||
*Defined in* | ||
|
||
[packages/cozy-client/src/models/paper.js:167](https://github.com/cozy/cozy-client/blob/master/packages/cozy-client/src/models/paper.js#L167) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function isExpiring(file: IOCozyFile): boolean; | ||
export function computeExpirationDate(file: IOCozyFile): Date | null; | ||
export function computeExpirationNoticeDate(file: IOCozyFile): Date | null; | ||
export function computeExpirationNoticeLink(file: IOCozyFile): string | null; | ||
export function isExpired(file: IOCozyFile): boolean; | ||
export function isExpiringSoon(file: IOCozyFile): boolean; | ||
export type IOCozyFile = import("../types").CozyClientDocument & import("../types").FileDocument; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters