This repository was archived by the owner on Mar 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +19
-17
lines changed Expand file tree Collapse file tree 4 files changed +19
-17
lines changed Original file line number Diff line number Diff line change 1
1
v1.0.0 Initial stable release
2
- v2.0.0 ES5 retargeting.
3
- Removed isRoot.
2
+ v2.0.0 ES5 retargeting for easier browser compatibility.
3
+ Removed isRoot.
4
+ v2.0.1 Updated dependencies to latest versions, incl. typescript to 2.1.5
5
+ Arrays in model are now declared as ReadOnly.
Original file line number Diff line number Diff line change 1
1
# json-schema-js-gui-model
2
2
3
- Use this library when you need to construct many different custom UI forms that shares common
3
+ Use this library typescript/javascript library when you need to construct many different custom UI forms that shares common
4
4
characteristics, want to be in charge of how exactly your UI form should present itself, want to
5
5
pick your own web framework for the UI, and want to use a json schema to drive the UI forms
6
6
but finds json schema complex to process and lacking of UI information.
@@ -15,7 +15,7 @@ different depending on the exact web framework used and this out of scope of thi
15
15
fundamental and general project.
16
16
17
17
This library is on purpose keept small with few runtime-dependencies. It can be used from both nodejs v6+
18
- and with a modern es6 capable browser.
18
+ and with a es5 capable browser.
19
19
20
20
## Getting started
21
21
@@ -24,7 +24,7 @@ and with a modern es6 capable browser.
24
24
Schemas can be translated using the exported GuiModelMapper class or by the the command line
25
25
command * mapToGuiModel* when the library is installed with -g option by npm.
26
26
27
- Code:
27
+ Code (typescript example) :
28
28
``` typescript
29
29
import { GuiModelMapper , GuiModel , JsonSchema } from ' json-schema-js-gui-model' ;
30
30
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-schema-js-gui-model" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " Handy gui model and associated translator that is useful when constructing javascript UI forms from json-schemas" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
42
42
"homepage" : " https://github.com/mmc41/json-schema-js-gui-model#readme" ,
43
43
"devDependencies" : {
44
44
"@types/chai" : " 3.4.34" ,
45
- "@types/core-js" : " 0.9.34 " ,
46
- "@types/mocha" : " 2.2.32 " ,
47
- "@types/node" : " 6 .0.46 " ,
45
+ "@types/core-js" : " 0.9.35 " ,
46
+ "@types/mocha" : " 2.2.38 " ,
47
+ "@types/node" : " 7 .0.0 " ,
48
48
"chai" : " 3.5.0" ,
49
- "ghooks" : " ^1.3.2 " ,
50
- "mocha" : " 3.1.2 " ,
49
+ "ghooks" : " ^2.0.0 " ,
50
+ "mocha" : " 3.2.0 " ,
51
51
"nodemon" : " 1.11.0" ,
52
- "npm-run-all" : " 3.1 .1" ,
52
+ "npm-run-all" : " 4.0 .1" ,
53
53
"rimraf" : " 2.5.4" ,
54
54
"ts-npm-lint" : " 0.1.0" ,
55
- "tslint" : " 3.15 .1" ,
56
- "typescript" : " 2.0.9 "
55
+ "tslint" : " 4.3 .1" ,
56
+ "typescript" : " 2.1.5 "
57
57
},
58
58
"engines" : {
59
59
"node" : " >=6.0.0" ,
Original file line number Diff line number Diff line change @@ -74,15 +74,15 @@ export interface FieldBase extends GuiElementBase {
74
74
75
75
export interface TypedField < T > extends FieldBase {
76
76
readonly defaultValue : T ;
77
- readonly values ?: T [ ] ;
77
+ readonly values ?: ReadonlyArray < T > ;
78
78
}
79
79
80
80
/**
81
81
* A containers for other gui elements.
82
82
*/
83
83
export interface Group extends GuiElementBase {
84
84
readonly kind : 'group' ;
85
- readonly elements : GuiElement [ ] ;
85
+ readonly elements : ReadonlyArray < GuiElement > ;
86
86
}
87
87
88
88
export interface TranslationError {
@@ -94,7 +94,7 @@ export interface TranslationError {
94
94
* Represents a full gui model. Essentially a group but with an extra errors field.
95
95
*/
96
96
export interface GuiModel extends Group {
97
- readonly errors : TranslationError [ ] ;
97
+ readonly errors : ReadonlyArray < TranslationError > ;
98
98
}
99
99
100
100
export type Field = TypedField < string > | TypedField < number > | TypedField < boolean > ;
You can’t perform that action at this time.
0 commit comments