Skip to content

Commit 791754d

Browse files
committed
update docs
1 parent f0b789c commit 791754d

10 files changed

+77
-77
lines changed

docs/README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
Ƭ **FieldsArray**: *[ComposibleValidatable](interfaces/composiblevalidatable.md)‹any›[]*
4949

50-
*Defined in [formState.ts:9](https://github.com/qiniu/formstate-x/blob/4d17690/src/formState.ts#L9)*
50+
*Defined in [formState.ts:9](https://github.com/qiniu/formstate-x/blob/f0b789c/src/formState.ts#L9)*
5151

5252
Mode: array
5353

@@ -57,7 +57,7 @@ ___
5757

5858
Ƭ **FieldsObject**: *object*
5959

60-
*Defined in [formState.ts:7](https://github.com/qiniu/formstate-x/blob/4d17690/src/formState.ts#L7)*
60+
*Defined in [formState.ts:7](https://github.com/qiniu/formstate-x/blob/f0b789c/src/formState.ts#L7)*
6161

6262
Mode: object
6363

@@ -71,7 +71,7 @@ ___
7171

7272
Ƭ **ValidatableFields**: *[FieldsObject](README.md#fieldsobject) | [FieldsArray](README.md#fieldsarray)*
7373

74-
*Defined in [formState.ts:11](https://github.com/qiniu/formstate-x/blob/4d17690/src/formState.ts#L11)*
74+
*Defined in [formState.ts:11](https://github.com/qiniu/formstate-x/blob/f0b789c/src/formState.ts#L11)*
7575

7676
Each key of the object is a validatable
7777

@@ -81,7 +81,7 @@ ___
8181

8282
Ƭ **Validated**: *object*
8383

84-
*Defined in [types.ts:16](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L16)*
84+
*Defined in [types.ts:16](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L16)*
8585

8686
#### Type declaration:
8787

@@ -91,7 +91,7 @@ ___
9191

9292
Ƭ **ValidationResponse**: *string | null | undefined | false*
9393

94-
*Defined in [types.ts:5](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L5)*
94+
*Defined in [types.ts:5](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L5)*
9595

9696
A truthy string or falsy values.
9797

@@ -101,7 +101,7 @@ ___
101101

102102
Ƭ **ValidatorResponse**: *[ValidationResponse](README.md#validationresponse) | Promise‹[ValidationResponse](README.md#validationresponse)*
103103

104-
*Defined in [types.ts:12](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L12)*
104+
*Defined in [types.ts:12](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L12)*
105105

106106
The return value of a validator.
107107

@@ -111,7 +111,7 @@ ___
111111

112112
Ƭ **ValueOf**: *State extends FormState<infer Fields, infer Fields extends { [key: string]: ComposibleValidatable<any, any>; } ? ValueOfObjectFields<infer Fields> : infer Fields extends (infer Field)[] ? ValueArrayOf<Field> : never> ? Fields extends { ...; } ? ValueOfObjectFields<...> : Fields extends (infer Field)[] ? ValueArrayOf...*
113113

114-
*Defined in [types.ts:90](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L90)*
114+
*Defined in [types.ts:90](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L90)*
115115

116116
Value of state (`FormState` or `FieldState`)
117117

@@ -121,7 +121,7 @@ ___
121121

122122
Ƭ **ValueOfArrayFields**: *Fields extends (infer Field)[] ? ValueArrayOf<Field> : never*
123123

124-
*Defined in [types.ts:76](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L76)*
124+
*Defined in [types.ts:76](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L76)*
125125

126126
Value of array-fields.
127127

@@ -131,7 +131,7 @@ ___
131131

132132
Ƭ **ValueOfFieldState**: *State extends FieldState<infer FieldType> ? FieldType : never*
133133

134-
*Defined in [types.ts:59](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L59)*
134+
*Defined in [types.ts:59](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L59)*
135135

136136
Value of `FieldState`.
137137

@@ -141,7 +141,7 @@ ___
141141

142142
Ƭ **ValueOfFields**: *Fields extends { [key: string]: ComposibleValidatable<any, any>; } ? ValueOfObjectFields<Fields> : Fields extends (infer Field)[] ? ValueArrayOf<Field> : never*
143143

144-
*Defined in [types.ts:83](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L83)*
144+
*Defined in [types.ts:83](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L83)*
145145

146146
Value of fields.
147147

@@ -151,7 +151,7 @@ ___
151151

152152
Ƭ **ValueOfObjectFields**: *object*
153153

154-
*Defined in [types.ts:71](https://github.com/qiniu/formstate-x/blob/4d17690/src/types.ts#L71)*
154+
*Defined in [types.ts:71](https://github.com/qiniu/formstate-x/blob/f0b789c/src/types.ts#L71)*
155155

156156
Value of object-fields.
157157

@@ -163,7 +163,7 @@ Value of object-fields.
163163

164164
**bindInput**<**T**>(`state`: [FieldState](classes/fieldstate.md)‹T›): *[InputBindings](interfaces/inputbindings.md)‹T›*
165165

166-
*Defined in [bind.ts:16](https://github.com/qiniu/formstate-x/blob/4d17690/src/bind.ts#L16)*
166+
*Defined in [bind.ts:16](https://github.com/qiniu/formstate-x/blob/f0b789c/src/bind.ts#L16)*
167167

168168
Helper method to bind state to your input component.
169169
You can define your own bindInput by specifying `getValue`.
@@ -182,7 +182,7 @@ Name | Type |
182182

183183
**bindInput**<**T**, **E**>(`state`: [FieldState](classes/fieldstate.md)‹T›, `getValue`: function): *[InputBindings](interfaces/inputbindings.md)‹T, E›*
184184

185-
*Defined in [bind.ts:17](https://github.com/qiniu/formstate-x/blob/4d17690/src/bind.ts#L17)*
185+
*Defined in [bind.ts:17](https://github.com/qiniu/formstate-x/blob/f0b789c/src/bind.ts#L17)*
186186

187187
**Type parameters:**
188188

docs/classes/disposable.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Class that collects side-effects and dispose them on demand.
2828

2929
\+ **new Disposable**(): *[Disposable](disposable.md)*
3030

31-
*Defined in [disposable.ts:28](https://github.com/qiniu/formstate-x/blob/4d17690/src/disposable.ts#L28)*
31+
*Defined in [disposable.ts:28](https://github.com/qiniu/formstate-x/blob/f0b789c/src/disposable.ts#L28)*
3232

3333
**Returns:** *[Disposable](disposable.md)*
3434

@@ -38,7 +38,7 @@ Class that collects side-effects and dispose them on demand.
3838

3939
**dispose**(): *void*
4040

41-
*Defined in [disposable.ts:23](https://github.com/qiniu/formstate-x/blob/4d17690/src/disposable.ts#L23)*
41+
*Defined in [disposable.ts:23](https://github.com/qiniu/formstate-x/blob/f0b789c/src/disposable.ts#L23)*
4242

4343
Do dispose by calling all disposer functions.
4444

docs/classes/fieldstate.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The state for a field.
6060

6161
*Overrides [Disposable](disposable.md).[constructor](disposable.md#constructor)*
6262

63-
*Defined in [fieldState.ts:230](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L230)*
63+
*Defined in [fieldState.ts:230](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L230)*
6464

6565
**Parameters:**
6666

@@ -79,7 +79,7 @@ Name | Type | Default |
7979

8080
*Implementation of [ComposibleValidatable](../interfaces/composiblevalidatable.md).[$](../interfaces/composiblevalidatable.md#$)*
8181

82-
*Defined in [fieldState.ts:39](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L39)*
82+
*Defined in [fieldState.ts:39](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L39)*
8383

8484
Value that has bean validated with no error, AKA "safe".
8585

@@ -91,7 +91,7 @@ ___
9191

9292
*Implementation of [ComposibleValidatable](../interfaces/composiblevalidatable.md).[_activated](../interfaces/composiblevalidatable.md#_activated)*
9393

94-
*Defined in [fieldState.ts:15](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L15)*
94+
*Defined in [fieldState.ts:15](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L15)*
9595

9696
If activated (with auto validation).
9797
Field will only be activated when `validate()` or `onChange()` called.
@@ -102,7 +102,7 @@ ___
102102

103103
**_error**? : *undefined | string*
104104

105-
*Defined in [fieldState.ts:64](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L64)*
105+
*Defined in [fieldState.ts:64](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L64)*
106106

107107
The original error info of validation.
108108

@@ -114,7 +114,7 @@ ___
114114

115115
*Implementation of [ComposibleValidatable](../interfaces/composiblevalidatable.md).[_validateStatus](../interfaces/composiblevalidatable.md#_validatestatus)*
116116

117-
*Defined in [fieldState.ts:52](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L52)*
117+
*Defined in [fieldState.ts:52](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L52)*
118118

119119
The validate status.
120120

@@ -124,7 +124,7 @@ ___
124124

125125
**_value**: *TValue*
126126

127-
*Defined in [fieldState.ts:28](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L28)*
127+
*Defined in [fieldState.ts:28](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L28)*
128128

129129
Value that reacts to `onChange` immediately.
130130
You should only use it to bind with UI input componnet.
@@ -137,7 +137,7 @@ ___
137137

138138
*Implementation of [ComposibleValidatable](../interfaces/composiblevalidatable.md).[value](../interfaces/composiblevalidatable.md#value)*
139139

140-
*Defined in [fieldState.ts:34](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L34)*
140+
*Defined in [fieldState.ts:34](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L34)*
141141

142142
Value that can be consumed by your code.
143143
It's synced from `_value` with debounce of 200ms.
@@ -148,7 +148,7 @@ It's synced from `_value` with debounce of 200ms.
148148

149149
**get dirty**(): *boolean*
150150

151-
*Defined in [fieldState.ts:20](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L20)*
151+
*Defined in [fieldState.ts:20](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L20)*
152152

153153
If value has been touched (different with `initialValue`)
154154

@@ -160,7 +160,7 @@ ___
160160

161161
**get error**(): *undefined | string*
162162

163-
*Defined in [fieldState.ts:69](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L69)*
163+
*Defined in [fieldState.ts:69](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L69)*
164164

165165
The error info of validation.
166166

@@ -172,7 +172,7 @@ ___
172172

173173
**get hasError**(): *boolean*
174174

175-
*Defined in [fieldState.ts:76](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L76)*
175+
*Defined in [fieldState.ts:76](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L76)*
176176

177177
If the state contains error.
178178

@@ -184,7 +184,7 @@ ___
184184

185185
**get validated**(): *boolean*
186186

187-
*Defined in [fieldState.ts:84](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L84)*
187+
*Defined in [fieldState.ts:84](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L84)*
188188

189189
If the validation has been done.
190190
It does not means validation passed.
@@ -197,7 +197,7 @@ ___
197197

198198
**get validating**(): *boolean*
199199

200-
*Defined in [fieldState.ts:57](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L57)*
200+
*Defined in [fieldState.ts:57](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L57)*
201201

202202
If the state is doing a validation.
203203

@@ -209,7 +209,7 @@ If the state is doing a validation.
209209

210210
**disableValidationWhen**(`predict`: function): *this*
211211

212-
*Defined in [fieldState.ts:199](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L199)*
212+
*Defined in [fieldState.ts:199](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L199)*
213213

214214
Configure when to disable validation.
215215

@@ -229,7 +229,7 @@ ___
229229

230230
*Inherited from [Disposable](disposable.md).[dispose](disposable.md#dispose)*
231231

232-
*Defined in [disposable.ts:23](https://github.com/qiniu/formstate-x/blob/4d17690/src/disposable.ts#L23)*
232+
*Defined in [disposable.ts:23](https://github.com/qiniu/formstate-x/blob/f0b789c/src/disposable.ts#L23)*
233233

234234
Do dispose by calling all disposer functions.
235235

@@ -241,7 +241,7 @@ ___
241241

242242
**onChange**(`value`: TValue): *void*
243243

244-
*Defined in [fieldState.ts:119](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L119)*
244+
*Defined in [fieldState.ts:119](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L119)*
245245

246246
Set `_value` on change event.
247247

@@ -259,7 +259,7 @@ ___
259259

260260
**reset**(): *void*
261261

262-
*Defined in [fieldState.ts:134](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L134)*
262+
*Defined in [fieldState.ts:134](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L134)*
263263

264264
Reset to initial status.
265265

@@ -271,7 +271,7 @@ ___
271271

272272
**set**(`value`: TValue): *void*
273273

274-
*Defined in [fieldState.ts:126](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L126)*
274+
*Defined in [fieldState.ts:126](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L126)*
275275

276276
Set `value` (& `_value`) synchronously.
277277

@@ -289,7 +289,7 @@ ___
289289

290290
**setError**(`error`: [ValidationResponse](../README.md#validationresponse)): *void*
291291

292-
*Defined in [fieldState.ts:91](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L91)*
292+
*Defined in [fieldState.ts:91](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L91)*
293293

294294
Set error info.
295295

@@ -309,7 +309,7 @@ ___
309309

310310
*Implementation of [ComposibleValidatable](../interfaces/composiblevalidatable.md)*
311311

312-
*Defined in [fieldState.ts:171](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L171)*
312+
*Defined in [fieldState.ts:171](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L171)*
313313

314314
Fire a validation behavior.
315315

@@ -321,7 +321,7 @@ ___
321321

322322
**validators**(...`validators`: [Validator](../interfaces/validator.md)‹TValue›[]): *this*
323323

324-
*Defined in [fieldState.ts:103](https://github.com/qiniu/formstate-x/blob/4d17690/src/fieldState.ts#L103)*
324+
*Defined in [fieldState.ts:103](https://github.com/qiniu/formstate-x/blob/f0b789c/src/fieldState.ts#L103)*
325325

326326
Add validator function.
327327

0 commit comments

Comments
 (0)