@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.
- package/dist/edit/edit.d.ts +23 -0
- package/dist/edit/route.d.ts +6 -0
- package/dist/example/bakery-example.d.ts +2 -0
- package/dist/example.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/rljson.d.ts +2 -1
- package/dist/rljson.js +550 -486
- package/dist/src/example.ts +25 -1
- package/dist/typedefs.d.ts +1 -1
- package/package.json +23 -15
|
@@ -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>;
|
|
@@ -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
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;
|