@rljson/rljson 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.architecture.md +119 -54
- package/dist/README.architecture.md +119 -54
- package/dist/content/buffet.d.ts +6 -6
- package/dist/content/cake.d.ts +17 -16
- package/dist/content/ingredients.d.ts +16 -0
- package/dist/content/layer.d.ts +44 -0
- package/dist/content/slice-ids.d.ts +32 -0
- package/dist/content/table-cfg.d.ts +1 -1
- package/dist/example/bakery-example.d.ts +10 -10
- package/dist/example.d.ts +7 -7
- package/dist/index.d.ts +3 -3
- package/dist/rljson.d.ts +6 -6
- package/dist/rljson.js +208 -208
- package/dist/src/example.ts +59 -59
- package/dist/typedefs.d.ts +7 -7
- package/dist/validate/base-validator.d.ts +9 -9
- package/package.json +7 -7
- package/dist/content/collection.d.ts +0 -44
- package/dist/content/id-set.d.ts +0 -33
- package/dist/content/properties.d.ts +0 -16
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Json } from '@rljson/json';
|
|
2
|
+
import { RljsonTable } from '../rljson.ts';
|
|
3
|
+
import { Ref, SliceId } from '../typedefs.ts';
|
|
4
|
+
/**
|
|
5
|
+
* An SliceIdsRef is a hash pointing to an Ids
|
|
6
|
+
*/
|
|
7
|
+
export type SliceIdsRef = Ref;
|
|
8
|
+
/**
|
|
9
|
+
* A list of slice ids
|
|
10
|
+
*/
|
|
11
|
+
export interface SliceIds extends Json {
|
|
12
|
+
/**
|
|
13
|
+
* The base list of slice ids
|
|
14
|
+
*/
|
|
15
|
+
base?: SliceIdsRef;
|
|
16
|
+
/**
|
|
17
|
+
* The slice ids added to base
|
|
18
|
+
*/
|
|
19
|
+
add: SliceId[];
|
|
20
|
+
/**
|
|
21
|
+
* The slice ids removed from base
|
|
22
|
+
*/
|
|
23
|
+
remove?: SliceId[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A table containing slice ids
|
|
27
|
+
*/
|
|
28
|
+
export type SliceIdsTable = RljsonTable<SliceIds, 'sliceIds'>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns one of the layers of the example cake
|
|
31
|
+
*/
|
|
32
|
+
export declare const exampleSliceIdsTable: () => SliceIdsTable;
|
|
@@ -47,7 +47,7 @@ export interface TableCfg extends Json {
|
|
|
47
47
|
/**
|
|
48
48
|
* A table containing columns
|
|
49
49
|
*/
|
|
50
|
-
export type TablesCfgTable = RljsonTable<TableCfg, '
|
|
50
|
+
export type TablesCfgTable = RljsonTable<TableCfg, 'ingredients'>;
|
|
51
51
|
/**
|
|
52
52
|
* Example matching allTypesRow
|
|
53
53
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Json } from '@rljson/json';
|
|
2
|
-
import { IdSetsTable } from '../../dist/content/id-set.ts';
|
|
3
2
|
import { BuffetsTable } from '../content/buffet.ts';
|
|
4
3
|
import { CakesTable } from '../content/cake.ts';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { IngredientsTable } from '../content/ingredients.ts';
|
|
5
|
+
import { LayersTable } from '../content/layer.ts';
|
|
6
|
+
import { SliceIdsTable } from '../content/slice-ids.ts';
|
|
7
7
|
import { Rljson } from '../rljson.ts';
|
|
8
8
|
import { Ref } from '../typedefs.ts';
|
|
9
9
|
export interface Ingredient extends Json {
|
|
@@ -15,7 +15,7 @@ export interface RecipeIngredient extends Json {
|
|
|
15
15
|
ingredientsRef: string;
|
|
16
16
|
quantity: number;
|
|
17
17
|
}
|
|
18
|
-
export type IngredientsTypeTable =
|
|
18
|
+
export type IngredientsTypeTable = IngredientsTable<Ingredient>;
|
|
19
19
|
export interface NutritionalValues extends Json {
|
|
20
20
|
energy: number;
|
|
21
21
|
fat: number;
|
|
@@ -25,11 +25,11 @@ export interface NutritionalValues extends Json {
|
|
|
25
25
|
export interface Bakery extends Rljson {
|
|
26
26
|
buffets: BuffetsTable;
|
|
27
27
|
cakes: CakesTable;
|
|
28
|
-
slices:
|
|
29
|
-
layers:
|
|
30
|
-
recipes:
|
|
31
|
-
recipeIngredients:
|
|
32
|
-
ingredients:
|
|
33
|
-
nutritionalValues:
|
|
28
|
+
slices: SliceIdsTable;
|
|
29
|
+
layers: LayersTable;
|
|
30
|
+
recipes: LayersTable;
|
|
31
|
+
recipeIngredients: IngredientsTable<RecipeIngredient>;
|
|
32
|
+
ingredients: IngredientsTable<Ingredient>;
|
|
33
|
+
nutritionalValues: IngredientsTable<NutritionalValues>;
|
|
34
34
|
}
|
|
35
35
|
export declare const bakeryExample: () => Bakery;
|
package/dist/example.d.ts
CHANGED
|
@@ -25,16 +25,16 @@ export declare class Example {
|
|
|
25
25
|
tableCfg: {
|
|
26
26
|
wrongType: () => import('@rljson/hash').Hashed<Rljson>;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
layers: {
|
|
29
29
|
missingBase: () => Rljson;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
missingSliceIdSet: () => Rljson;
|
|
31
|
+
missingAssignedIngredientTable: () => Rljson;
|
|
32
|
+
missingAssignedIngredient: () => Rljson;
|
|
33
33
|
};
|
|
34
34
|
cakes: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
missingSliceIdSet: () => Rljson;
|
|
36
|
+
missingLayersTable: () => Rljson;
|
|
37
|
+
missingCakeLayer: () => Rljson;
|
|
38
38
|
};
|
|
39
39
|
buffets: {
|
|
40
40
|
missingTable: () => Rljson;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './content/buffet.ts';
|
|
2
2
|
export * from './content/cake.ts';
|
|
3
|
-
export * from './content/
|
|
4
|
-
export * from './content/
|
|
5
|
-
export * from './content/
|
|
3
|
+
export * from './content/ingredients.ts';
|
|
4
|
+
export * from './content/layer.ts';
|
|
5
|
+
export * from './content/slice-ids.ts';
|
|
6
6
|
export * from './content/table-cfg.ts';
|
|
7
7
|
export * from './example.ts';
|
|
8
8
|
export * from './example/bakery-example.ts';
|
package/dist/rljson.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Json } from '@rljson/json';
|
|
2
2
|
import { BuffetsTable } from './content/buffet.ts';
|
|
3
3
|
import { CakesTable } from './content/cake.ts';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { IngredientsTable } from './content/ingredients.ts';
|
|
5
|
+
import { LayersTable } from './content/layer.ts';
|
|
6
|
+
import { SliceIdsTable } from './content/slice-ids.ts';
|
|
7
7
|
import { TableCfgRef, TablesCfgTable } from './content/table-cfg.ts';
|
|
8
8
|
import { ContentType, Ref, TableKey } from './typedefs.ts';
|
|
9
9
|
export declare const reservedFieldNames: string[];
|
|
@@ -11,7 +11,7 @@ export declare const reservedTableKeys: string[];
|
|
|
11
11
|
/**
|
|
12
12
|
* One of the supported Rljson table types
|
|
13
13
|
*/
|
|
14
|
-
export type TableType = BuffetsTable |
|
|
14
|
+
export type TableType = BuffetsTable | IngredientsTable<any> | LayersTable | SliceIdsTable | CakesTable;
|
|
15
15
|
/** The rljson data format */
|
|
16
16
|
export interface Rljson extends Json {
|
|
17
17
|
[tableId: TableKey]: TableType;
|
|
@@ -27,7 +27,7 @@ export type RljsonPrivate = {
|
|
|
27
27
|
/**
|
|
28
28
|
* Contains id sets used accross the Rljson object
|
|
29
29
|
*/
|
|
30
|
-
_idSet?:
|
|
30
|
+
_idSet?: SliceIdsTable;
|
|
31
31
|
/**
|
|
32
32
|
* References that are not part of the Rljson object
|
|
33
33
|
*/
|
|
@@ -47,7 +47,7 @@ export declare const exampleRljson: () => Rljson;
|
|
|
47
47
|
export interface RljsonTable<Data extends Json, Type extends ContentType> extends Json {
|
|
48
48
|
/** The data rows of the table */
|
|
49
49
|
_data: Data[];
|
|
50
|
-
/** The type of the table. If not set, the type is "
|
|
50
|
+
/** The type of the table. If not set, the type is "ingredients" */
|
|
51
51
|
_type: Type;
|
|
52
52
|
/** The columns configuration of the table */
|
|
53
53
|
_tableCfg?: TableCfgRef;
|