pareto-core-shorthands 0.2.13 → 0.2.15

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.
@@ -4,20 +4,22 @@ export type Raw_Or_Normal_Dictionary<T> = {
4
4
  } | _pi.Dictionary<T>;
5
5
  export type Raw_Or_Normal_List<T> = T[] | _pi.List<T>;
6
6
  export type Raw_Optional<T> = null | undefined | T;
7
- export type Reference<G_Source, T_Dictionary_Entry> = {
8
- readonly 'l id': string;
9
- readonly 'l location': G_Source;
10
- };
11
- export type Stack_Reference<G_Source, T_Dictionary_Entry> = {
12
- readonly 'l id': string;
13
- readonly 'l location': G_Source;
7
+ export type Component<T> = {
8
+ readonly 'l location': _pi.Deprecated_Source_Location;
9
+ readonly 'l component': T;
14
10
  };
15
11
  export type Dictionary<G_Source, T_D> = {
12
+ readonly 'l location': G_Source;
16
13
  readonly 'l dictionary': _pi.Dictionary<{
17
14
  readonly 'l entry': T_D;
18
15
  readonly 'l location': G_Source;
19
16
  }>;
20
- readonly 'l location': G_Source;
17
+ };
18
+ export type Group<T extends {
19
+ [id: string]: any;
20
+ }> = {
21
+ readonly 'l location': _pi.Deprecated_Source_Location;
22
+ readonly 'l group': T;
21
23
  };
22
24
  export type List<G_Source, T_L> = {
23
25
  readonly 'l list': _pi.List<{
@@ -26,18 +28,41 @@ export type List<G_Source, T_L> = {
26
28
  }>;
27
29
  readonly 'l location': G_Source;
28
30
  };
31
+ export type Nothing<G_Source> = {
32
+ readonly 'l location': G_Source;
33
+ readonly 'l nothing': null;
34
+ };
35
+ export type Number<G_Source> = {
36
+ readonly 'l location': G_Source;
37
+ readonly 'l number': number;
38
+ };
39
+ export type Reference<G_Source> = {
40
+ readonly 'l location': G_Source;
41
+ readonly 'l reference': string;
42
+ };
29
43
  export type State<X> = {
30
44
  readonly 'l location': _pi.Deprecated_Source_Location;
31
45
  readonly 'l state': X;
32
46
  };
33
- export declare namespace optional {
47
+ export type Text<G_Source> = {
48
+ readonly 'l location': G_Source;
49
+ readonly 'l text': string;
50
+ };
51
+ export declare namespace optionalx {
34
52
  const set: typeof import("pareto-core/dist/__internals/sync/expression/literals/optional").set;
35
53
  const not_set: typeof import("pareto-core/dist/__internals/sync/expression/literals/optional").not_set;
36
54
  const literal: <T>($: Raw_Optional<T>) => _pi.Optional_Value<T>;
37
55
  }
38
- export declare const wrap_dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<_pi.Deprecated_Source_Location, T>;
39
- export declare const wrap_list: <T>($: Raw_Or_Normal_List<T>) => List<_pi.Deprecated_Source_Location, T>;
40
- export declare const wrap_state: <T extends readonly [string, any]>($: T) => State<T>;
41
- export declare const wrap_optional: <T>($: T | null | undefined) => _pi.Optional_Value<T>;
42
- export declare const wrap_reference: <T>($: string) => Reference<_pi.Deprecated_Source_Location, T>;
43
- export declare const wrap_stack_reference: <T>(name: string) => Stack_Reference<_pi.Deprecated_Source_Location, T>;
56
+ export declare const component: <T>($: T) => Component<T>;
57
+ export declare const dictionary: <T>($: Raw_Or_Normal_Dictionary<T>) => Dictionary<_pi.Deprecated_Source_Location, T>;
58
+ export declare const group: <T>($: T) => {
59
+ readonly "l location": _pi.Deprecated_Source_Location;
60
+ readonly "l value": T;
61
+ };
62
+ export declare const list: <T>($: Raw_Or_Normal_List<T>) => List<_pi.Deprecated_Source_Location, T>;
63
+ export declare const nothing: () => Nothing<_pi.Deprecated_Source_Location>;
64
+ export declare const number: ($: number) => Number<_pi.Deprecated_Source_Location>;
65
+ export declare const optional: <T>($: T | null | undefined) => _pi.Optional_Value<T>;
66
+ export declare const reference: <T>($: string) => Reference<_pi.Deprecated_Source_Location>;
67
+ export declare const state: <T extends readonly [string, any]>($: T) => State<T>;
68
+ export declare const text: ($: string) => Text<_pi.Deprecated_Source_Location>;
@@ -33,25 +33,32 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.wrap_stack_reference = exports.wrap_reference = exports.wrap_optional = exports.wrap_state = exports.wrap_list = exports.wrap_dictionary = exports.optional = void 0;
36
+ exports.text = exports.state = exports.reference = exports.optional = exports.number = exports.nothing = exports.list = exports.group = exports.dictionary = exports.component = exports.optionalx = void 0;
37
37
  const _pinternals = __importStar(require("pareto-core/dist/__internals/sync/expression/initialize"));
38
38
  const get_location_info_1 = require("pareto-core/dist/__internals/sync/get_location_info");
39
39
  //implementations
40
40
  const depth = 1;
41
- var optional;
42
- (function (optional) {
43
- optional.set = _pinternals.optional.set;
44
- optional.not_set = _pinternals.optional.not_set;
45
- optional.literal = ($) => {
41
+ var optionalx;
42
+ (function (optionalx) {
43
+ optionalx.set = _pinternals.optional.set;
44
+ optionalx.not_set = _pinternals.optional.not_set;
45
+ optionalx.literal = ($) => {
46
46
  if ($ === null || $ === undefined) {
47
- return optional.not_set();
47
+ return optionalx.not_set();
48
48
  }
49
49
  else {
50
- return optional.set($);
50
+ return optionalx.set($);
51
51
  }
52
52
  };
53
- })(optional || (exports.optional = optional = {}));
54
- const wrap_dictionary = ($) => {
53
+ })(optionalx || (exports.optionalx = optionalx = {}));
54
+ const component = ($) => {
55
+ return {
56
+ 'l location': (0, get_location_info_1.$$)(depth + 1),
57
+ 'l component': $,
58
+ };
59
+ };
60
+ exports.component = component;
61
+ const dictionary = ($) => {
55
62
  const location = (0, get_location_info_1.$$)(depth + 1);
56
63
  function is_normal($) {
57
64
  return $.__get_number_of_entries !== undefined && typeof $.__get_number_of_entries === "function";
@@ -75,14 +82,21 @@ const wrap_dictionary = ($) => {
75
82
  };
76
83
  }
77
84
  };
78
- exports.wrap_dictionary = wrap_dictionary;
79
- const wrap_list = ($) => {
85
+ exports.dictionary = dictionary;
86
+ const group = ($) => {
87
+ return {
88
+ 'l location': (0, get_location_info_1.$$)(depth + 1),
89
+ 'l value': $,
90
+ };
91
+ };
92
+ exports.group = group;
93
+ const list = ($) => {
80
94
  const location = (0, get_location_info_1.$$)(depth + 1);
81
95
  const decorated = $ instanceof Array
82
96
  ? _pinternals.list.literal($)
83
97
  : $;
84
98
  if (!(decorated.__for_each instanceof Function)) {
85
- throw new Error("invalid input in 'wrap_list'");
99
+ throw new Error("invalid input in 'list'");
86
100
  }
87
101
  return {
88
102
  'l location': location,
@@ -92,15 +106,22 @@ const wrap_list = ($) => {
92
106
  }))
93
107
  };
94
108
  };
95
- exports.wrap_list = wrap_list;
96
- const wrap_state = ($) => {
109
+ exports.list = list;
110
+ const nothing = () => {
97
111
  return {
98
112
  'l location': (0, get_location_info_1.$$)(depth + 1),
99
- 'l state': $,
113
+ 'l nothing': null,
100
114
  };
101
115
  };
102
- exports.wrap_state = wrap_state;
103
- const wrap_optional = ($) => {
116
+ exports.nothing = nothing;
117
+ const number = ($) => {
118
+ return {
119
+ 'l location': (0, get_location_info_1.$$)(depth + 1),
120
+ 'l number': $,
121
+ };
122
+ };
123
+ exports.number = number;
124
+ const optional = ($) => {
104
125
  if ($ === null || $ === undefined) {
105
126
  return _pinternals.optional.not_set();
106
127
  }
@@ -108,18 +129,25 @@ const wrap_optional = ($) => {
108
129
  return _pinternals.optional.set($);
109
130
  }
110
131
  };
111
- exports.wrap_optional = wrap_optional;
112
- const wrap_reference = ($) => {
132
+ exports.optional = optional;
133
+ const reference = ($) => {
113
134
  return {
114
135
  'l location': (0, get_location_info_1.$$)(depth + 1),
115
- 'l id': $,
136
+ 'l reference': $,
137
+ };
138
+ };
139
+ exports.reference = reference;
140
+ const state = ($) => {
141
+ return {
142
+ 'l location': (0, get_location_info_1.$$)(depth + 1),
143
+ 'l state': $,
116
144
  };
117
145
  };
118
- exports.wrap_reference = wrap_reference;
119
- const wrap_stack_reference = (name) => {
146
+ exports.state = state;
147
+ const text = ($) => {
120
148
  return {
121
149
  'l location': (0, get_location_info_1.$$)(depth + 1),
122
- 'l id': name,
150
+ 'l text': $,
123
151
  };
124
152
  };
125
- exports.wrap_stack_reference = wrap_stack_reference;
153
+ exports.text = text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pareto-core-shorthands",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "license": "ISC",
5
5
  "description": "the pareto package used for building datasets",
6
6
  "author": "Corno",
@@ -23,6 +23,6 @@
23
23
  "url": "git+https://github.com/corno/pareto-core-shorthands.git"
24
24
  },
25
25
  "dependencies": {
26
- "pareto-core": "^0.1.16"
26
+ "pareto-core": "^0.1.21"
27
27
  }
28
28
  }