Skip to content

Commit 7fa688b

Browse files
authored
Merge pull request #5 from devrnt/docs/types
Docs/types
2 parents e78e815 + e001514 commit 7fa688b

File tree

4 files changed

+54
-5
lines changed

4 files changed

+54
-5
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ module.exports = {
33
'react-app',
44
'prettier/@typescript-eslint',
55
'plugin:prettier/recommended',
6+
'plugin:jsdoc/recommended',
67
],
7-
plugins: ['simple-import-sort'],
8+
plugins: ['simple-import-sort', 'jsdoc'],
89
settings: {
910
react: {
1011
version: 'detect',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"@testing-library/react-hooks": "^3.7.0",
5656
"@types/react": "^17.0.0",
5757
"@types/react-dom": "^17.0.0",
58+
"eslint-plugin-jsdoc": "^30.7.9",
5859
"eslint-plugin-simple-import-sort": "^7.0.0",
5960
"husky": "^4.3.6",
6061
"react": "^17.0.1",

src/types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
export type Handler = (() => Promise<void>) | (() => void) | null;
22

33
export type WizardProps = {
4+
/** Optional header that is shown above the active step */
45
header?: React.ReactNode;
6+
/** Optional footer that is shown below the active step */
57
footer?: React.ReactNode;
68
};
79

810
export type WizardValues = {
11+
/** Go to the next step */
912
nextStep: () => Promise<void>;
13+
/** Go to the previous step */
1014
previousStep: () => void;
15+
/**
16+
* Connect a callback that will be called when calling `nextStep()`
17+
*
18+
* @param handler Can be either sync or async
19+
*
20+
*/
1121
handleStep: (handler: Handler) => void;
22+
/**
23+
* Indicate the current state of the handler
24+
*
25+
* Will reflect the handler promise state: will be `true` if the handler promise is pending and
26+
* `false` when the handler is either fulfilled or rejected
27+
*/
1228
isLoading: boolean;
29+
/** The urrent active step of the wizard */
1330
activeStep: number;
31+
/** Indicate if the current step is the first step (aka no previous step) */
1432
isFirstStep: boolean;
33+
/** Indicate if the current step is the last step (aka no next step) */
1534
isLastStep: boolean;
1635
} | null;

yarn.lock

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,6 +2666,11 @@ commander@^2.18.0, commander@^2.20.0:
26662666
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
26672667
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
26682668

2669+
comment-parser@^0.7.6:
2670+
version "0.7.6"
2671+
resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-0.7.6.tgz#0e743a53c8e646c899a1323db31f6cd337b10f12"
2672+
integrity sha512-GKNxVA7/iuTnAqGADlTWX4tkhzxZKXp5fLJqKTlQLHkE65XDUKutZ3BHaJC5IGcper2tT3QRD1xr4o3jNpgXXg==
2673+
26692674
commondir@^1.0.1:
26702675
version "1.0.1"
26712676
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
@@ -3096,7 +3101,7 @@ [email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
30963101
dependencies:
30973102
ms "2.0.0"
30983103

3099-
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
3104+
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1:
31003105
version "4.3.1"
31013106
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
31023107
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
@@ -3540,6 +3545,19 @@ eslint-plugin-import@^2.18.2:
35403545
resolve "^1.17.0"
35413546
tsconfig-paths "^3.9.0"
35423547

3548+
eslint-plugin-jsdoc@^30.7.9:
3549+
version "30.7.9"
3550+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-30.7.9.tgz#b0a9881990edc1bc8a635467bad9edfae9ecbaaf"
3551+
integrity sha512-qMM0fNx7/6OCnIh3jRpIrEBAhTG1THNXXbr3yfJ8yqLrDbzJR98xsstX25xt9GCPlrjNc/bBpTHfJQOvn7nVMA==
3552+
dependencies:
3553+
comment-parser "^0.7.6"
3554+
debug "^4.3.1"
3555+
jsdoctypeparser "^9.0.0"
3556+
lodash "^4.17.20"
3557+
regextras "^0.7.1"
3558+
semver "^7.3.4"
3559+
spdx-expression-parse "^3.0.1"
3560+
35433561
eslint-plugin-jsx-a11y@^6.2.3:
35443562
version "6.4.1"
35453563
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd"
@@ -5440,6 +5458,11 @@ jsbn@~0.1.0:
54405458
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
54415459
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
54425460

5461+
jsdoctypeparser@^9.0.0:
5462+
version "9.0.0"
5463+
resolved "https://registry.yarnpkg.com/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz#8c97e2fb69315eb274b0f01377eaa5c940bd7b26"
5464+
integrity sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==
5465+
54435466
jsdom@^15.2.1:
54445467
version "15.2.1"
54455468
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5"
@@ -5713,7 +5736,7 @@ lodash.uniq@^4.5.0:
57135736
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
57145737
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
57155738

5716-
lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.5:
5739+
lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5:
57175740
version "4.17.20"
57185741
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
57195742
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
@@ -7412,6 +7435,11 @@ regexpu-core@^4.7.1:
74127435
unicode-match-property-ecmascript "^1.0.4"
74137436
unicode-match-property-value-ecmascript "^1.2.0"
74147437

7438+
regextras@^0.7.1:
7439+
version "0.7.1"
7440+
resolved "https://registry.yarnpkg.com/regextras/-/regextras-0.7.1.tgz#be95719d5f43f9ef0b9fa07ad89b7c606995a3b2"
7441+
integrity sha512-9YXf6xtW+qzQ+hcMQXx95MOvfqXFgsKDZodX3qZB0x2n5Z94ioetIITsBtvJbiOyxa/6s9AtyweBLCdPmPko/w==
7442+
74157443
regjsgen@^0.5.1:
74167444
version "0.5.2"
74177445
resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733"
@@ -7785,7 +7813,7 @@ [email protected]:
77857813
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
77867814
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
77877815

7788-
[email protected], semver@^7.1.1, semver@^7.3.2:
7816+
[email protected], semver@^7.1.1, semver@^7.3.2, semver@^7.3.4:
77897817
version "7.3.4"
77907818
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97"
77917819
integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==
@@ -8053,7 +8081,7 @@ spdx-exceptions@^2.1.0:
80538081
resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d"
80548082
integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==
80558083

8056-
spdx-expression-parse@^3.0.0:
8084+
spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1:
80578085
version "3.0.1"
80588086
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679"
80598087
integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==

0 commit comments

Comments
 (0)