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 11v1.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 11# json-schema-js-gui-model
22
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
44characteristics, want to be in charge of how exactly your UI form should present itself, want to
55pick your own web framework for the UI, and want to use a json schema to drive the UI forms
66but 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
1515fundamental and general project.
1616
1717This 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.
1919
2020## Getting started
2121
@@ -24,7 +24,7 @@ and with a modern es6 capable browser.
2424Schemas can be translated using the exported GuiModelMapper class or by the the command line
2525command * mapToGuiModel* when the library is installed with -g option by npm.
2626
27- Code:
27+ Code (typescript example) :
2828``` typescript
2929import { GuiModelMapper , GuiModel , JsonSchema } from ' json-schema-js-gui-model' ;
3030
Original file line number Diff line number Diff line change 11{
22 "name" : " json-schema-js-gui-model" ,
3- "version" : " 2.0.0 " ,
3+ "version" : " 2.0.1 " ,
44 "description" : " Handy gui model and associated translator that is useful when constructing javascript UI forms from json-schemas" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
4242 "homepage" : " https://github.com/mmc41/json-schema-js-gui-model#readme" ,
4343 "devDependencies" : {
4444 "@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 " ,
4848 "chai" : " 3.5.0" ,
49- "ghooks" : " ^1.3.2 " ,
50- "mocha" : " 3.1.2 " ,
49+ "ghooks" : " ^2.0.0 " ,
50+ "mocha" : " 3.2.0 " ,
5151 "nodemon" : " 1.11.0" ,
52- "npm-run-all" : " 3.1 .1" ,
52+ "npm-run-all" : " 4.0 .1" ,
5353 "rimraf" : " 2.5.4" ,
5454 "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 "
5757 },
5858 "engines" : {
5959 "node" : " >=6.0.0" ,
Original file line number Diff line number Diff line change @@ -74,15 +74,15 @@ export interface FieldBase extends GuiElementBase {
7474
7575export interface TypedField < T > extends FieldBase {
7676 readonly defaultValue : T ;
77- readonly values ?: T [ ] ;
77+ readonly values ?: ReadonlyArray < T > ;
7878}
7979
8080/**
8181 * A containers for other gui elements.
8282 */
8383export interface Group extends GuiElementBase {
8484 readonly kind : 'group' ;
85- readonly elements : GuiElement [ ] ;
85+ readonly elements : ReadonlyArray < GuiElement > ;
8686}
8787
8888export interface TranslationError {
@@ -94,7 +94,7 @@ export interface TranslationError {
9494 * Represents a full gui model. Essentially a group but with an extra errors field.
9595 */
9696export interface GuiModel extends Group {
97- readonly errors : TranslationError [ ] ;
97+ readonly errors : ReadonlyArray < TranslationError > ;
9898}
9999
100100export type Field = TypedField < string > | TypedField < number > | TypedField < boolean > ;
You can’t perform that action at this time.
0 commit comments