@rljson/rljson 0.0.55 → 0.0.58

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,23 @@
1
+ import { Json, JsonH, JsonValueH } from '@rljson/json';
2
+ import { Ingredient } from '../example/bakery-example.ts';
3
+ import { RljsonTable } from '../rljson.ts';
4
+ import { Ref } from '../typedefs.ts';
5
+ /**
6
+ * A reference to a Edit row in a Edit table
7
+ */
8
+ export type EditRef = Ref;
9
+ export type Edit<T extends Json> = {
10
+ value: T & JsonValueH;
11
+ route: string;
12
+ origin?: Ref;
13
+ previous?: EditRef;
14
+ acknowledged?: boolean;
15
+ } & JsonH;
16
+ /**
17
+ * A table containing components
18
+ */
19
+ export type EditsTable<T extends Json> = RljsonTable<Edit<T>, 'edits'>;
20
+ /**
21
+ * Provides an example Edits table for test purposes
22
+ */
23
+ export declare const exampleEditsTable: () => EditsTable<Ingredient>;
@@ -0,0 +1,6 @@
1
+ export declare class Route {
2
+ private segments;
3
+ constructor(segments: string[]);
4
+ static fromFlat(route: string): Route;
5
+ get flat(): string;
6
+ }
@@ -4,6 +4,7 @@ import { CakesTable } from '../content/cake.ts';
4
4
  import { ComponentsTable } from '../content/components.ts';
5
5
  import { LayersTable } from '../content/layer.ts';
6
6
  import { SliceIdsTable } from '../content/slice-ids.ts';
7
+ import { EditsTable } from '../edit/edit.ts';
7
8
  import { Rljson } from '../rljson.ts';
8
9
  import { Ref } from '../typedefs.ts';
9
10
  export interface Ingredient extends Json {
@@ -31,5 +32,6 @@ export interface Bakery extends Rljson {
31
32
  recipeIngredients: ComponentsTable<RecipIngredient>;
32
33
  ingredients: ComponentsTable<Ingredient>;
33
34
  nutritionalValues: ComponentsTable<NutritionalValues>;
35
+ ingredientsEdits: EditsTable<Ingredient>;
34
36
  }
35
37
  export declare const bakeryExample: () => Bakery;
package/dist/example.d.ts CHANGED
@@ -8,6 +8,7 @@ export declare class Example {
8
8
  multipleRows: () => Rljson;
9
9
  singleRef: () => Rljson;
10
10
  singleSliceIdRef: () => Rljson;
11
+ multiSliceIdRef: () => Rljson;
11
12
  singleNamedRef: () => Rljson;
12
13
  multiRef: () => Rljson;
13
14
  multiMixedRef: () => Rljson;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './content/layer.ts';
5
5
  export * from './content/revision.ts';
6
6
  export * from './content/slice-ids.ts';
7
7
  export * from './content/table-cfg.ts';
8
+ export * from './edit/edit.ts';
8
9
  export * from './example.ts';
9
10
  export * from './example/bakery-example.ts';
10
11
  export * from './rljson.ts';
package/dist/rljson.d.ts CHANGED
@@ -6,13 +6,14 @@ import { LayersTable } from './content/layer.ts';
6
6
  import { RevisionsTable } from './content/revision.ts';
7
7
  import { SliceIdsTable } from './content/slice-ids.ts';
8
8
  import { TableCfgRef, TablesCfgTable } from './content/table-cfg.ts';
9
+ import { EditsTable } from './edit/edit.ts';
9
10
  import { ContentType, Ref, TableKey } from './typedefs.ts';
10
11
  export declare const reservedFieldNames: string[];
11
12
  export declare const reservedTableKeys: string[];
12
13
  /**
13
14
  * One of the supported Rljson table types
14
15
  */
15
- export type TableType = BuffetsTable | ComponentsTable<any> | LayersTable | SliceIdsTable | CakesTable | RevisionsTable | TablesCfgTable;
16
+ export type TableType = BuffetsTable | ComponentsTable<any> | LayersTable | SliceIdsTable | CakesTable | RevisionsTable | TablesCfgTable | EditsTable<any>;
16
17
  /** The rljson data format */
17
18
  export interface Rljson extends Json {
18
19
  [tableId: TableKey]: TableType;