roamjs-components 0.54.2 → 0.54.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +95 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "roamjs-components",
3
3
  "description": "Description for roamjs-components",
4
- "version": "0.54.2",
4
+ "version": "0.54.3",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
package/types/index.d.ts CHANGED
@@ -1,5 +1,98 @@
1
1
  /// <reference types="react" />
2
2
  import { Condition as QueryBuilderCondition, Selection as QueryBuilderSelection, Result as QueryBuilderResult } from "./query-builder";
3
+ export declare type DatalogFnArg = DatalogSrcVar | DatalogVariable | DatalogConstant;
4
+ export declare type DatalogSrcVar = {
5
+ type: "srcvar";
6
+ value: string;
7
+ };
8
+ export declare type DatalogVariable = {
9
+ type: "variable";
10
+ value: string;
11
+ };
12
+ export declare type DatalogAndClause = {
13
+ type: "and-clause";
14
+ clauses: DatalogClause[];
15
+ };
16
+ export declare type DatalogExpressionClause = DatalogDataPattern | DatalogPredExpr | DatalogFnExpr | DatalogRuleExpr;
17
+ export declare type DatalogRuleExpr = {
18
+ type: "rule-expr";
19
+ srcVar?: DatalogSrcVar;
20
+ ruleName: DatalogRuleName;
21
+ arguments: DatalogArgument[];
22
+ };
23
+ export declare type DatalogNotClause = {
24
+ type: "not-clause";
25
+ srcVar?: DatalogSrcVar;
26
+ clauses: DatalogClause[];
27
+ };
28
+ export declare type DatalogNotJoinClause = {
29
+ type: "not-join-clause";
30
+ srcVar?: DatalogSrcVar;
31
+ variables: DatalogVariable[];
32
+ clauses: DatalogClause[];
33
+ };
34
+ export declare type DatalogOrClause = {
35
+ type: "or-clause";
36
+ srcVar?: DatalogSrcVar;
37
+ clauses: (DatalogClause | DatalogAndClause)[];
38
+ };
39
+ export declare type DatalogOrJoinClause = {
40
+ type: "or-join-clause";
41
+ srcVar?: DatalogSrcVar;
42
+ variables: DatalogVariable[];
43
+ clauses: (DatalogClause | DatalogAndClause)[];
44
+ };
45
+ export declare type DatalogClause = DatalogNotClause | DatalogOrJoinClause | DatalogExpressionClause | DatalogOrClause | DatalogNotJoinClause;
46
+ export declare type DatalogDataPattern = {
47
+ type: "data-pattern";
48
+ srcVar?: DatalogSrcVar;
49
+ arguments: DatalogArgument[];
50
+ };
51
+ export declare type DatalogArgument = DatalogVariable | DatalogConstant | DatalogUnderscore;
52
+ export declare type DatalogConstant = {
53
+ type: "constant";
54
+ value: string;
55
+ };
56
+ export declare type DatalogPredExpr = {
57
+ type: "pred-expr";
58
+ pred: "re-matches" | "clojure.string/includes?";
59
+ arguments: DatalogFnArg[];
60
+ };
61
+ export declare type DatalogFnExpr = {
62
+ type: "fn-expr";
63
+ fn: DatalogFn;
64
+ arguments: DatalogFnArg[];
65
+ binding: DatalogBinding;
66
+ };
67
+ export declare type DatalogBinding = DatalogBindScalar | DatalogBindTuple | DatalogBindColl | DatalogBindRel;
68
+ export declare type DatalogBindScalar = {
69
+ type: "bind-scalar";
70
+ variable: DatalogVariable;
71
+ };
72
+ export declare type DatalogBindTuple = {
73
+ type: "bind-tuple";
74
+ args: (DatalogVariable | DatalogUnderscore)[];
75
+ };
76
+ export declare type DatalogBindColl = {
77
+ type: "bind-col";
78
+ variable: DatalogVariable;
79
+ };
80
+ export declare type DatalogBindRel = {
81
+ type: "bind-rel";
82
+ args: (DatalogVariable | DatalogUnderscore)[];
83
+ };
84
+ export declare type DatalogFn = {
85
+ type: "fn";
86
+ value: string;
87
+ };
88
+ export declare type DatalogUnderscore = {
89
+ type: "underscore";
90
+ value: "_";
91
+ };
92
+ export declare type DatalogRuleName = {
93
+ type: "rulename";
94
+ value: string;
95
+ };
3
96
  export declare type RoamBasicBlock = {
4
97
  string: string;
5
98
  uid: string;
@@ -426,15 +519,14 @@ declare global {
426
519
  conditionNodes: QueryBuilderCondition[];
427
520
  selectionNodes: QueryBuilderSelection[];
428
521
  };
429
- conditionToDatalog: (condition: QueryBuilderCondition) => string;
522
+ conditionToDatalog: (condition: QueryBuilderCondition) => DatalogClause[];
430
523
  registerDatalogTranslator: (args: {
431
524
  key: string;
432
525
  callback: (args: {
433
- freeVar: (s: string) => string;
434
526
  source: string;
435
527
  target: string;
436
528
  uid: string;
437
- }) => string;
529
+ }) => DatalogClause[];
438
530
  }) => void;
439
531
  unregisterDatalogTranslator: (args: {
440
532
  key: string;