@rljson/rljson 0.0.30 → 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.
@@ -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, 'properties'>;
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 { CollectionsTable } from '../content/collection.ts';
6
- import { PropertiesTable } from '../content/properties.ts';
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 = PropertiesTable<Ingredient>;
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: IdSetsTable;
29
- layers: CollectionsTable;
30
- recipes: CollectionsTable;
31
- recipeIngredients: PropertiesTable<RecipeIngredient>;
32
- ingredients: PropertiesTable<Ingredient>;
33
- nutritionalValues: PropertiesTable<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
- collections: {
28
+ layers: {
29
29
  missingBase: () => Rljson;
30
- missingIdSet: () => Rljson;
31
- missingAssignedPropertyTable: () => Rljson;
32
- missingAssignedProperty: () => Rljson;
30
+ missingSliceIdSet: () => Rljson;
31
+ missingAssignedIngredientTable: () => Rljson;
32
+ missingAssignedIngredient: () => Rljson;
33
33
  };
34
34
  cakes: {
35
- missingIdSet: () => Rljson;
36
- missingCollectionsTable: () => Rljson;
37
- missingLayerCollection: () => Rljson;
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/collection.ts';
4
- export * from './content/id-set.ts';
5
- export * from './content/properties.ts';
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 { CollectionsTable } from './content/collection.ts';
5
- import { IdSetsTable } from './content/id-set.ts';
6
- import { PropertiesTable } from './content/properties.ts';
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 | PropertiesTable<any> | CollectionsTable | IdSetsTable | CakesTable;
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?: IdSetsTable;
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 "properties" */
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;