@limetech/lime-web-components 5.14.0 → 5.15.0

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,58 @@
1
+ /**
2
+ * This interface defines callbacks intended to be registered to the {@link Condition} registry
3
+ *
4
+ * @alpha
5
+ * @group Conditions
6
+ */
7
+ export type Condition<T = unknown> = {
8
+ /**
9
+ * The condition type, describing what to evaluate the condition for, for example "limeobject"
10
+ */
11
+ type: string;
12
+ evaluate: (subject: T, params: any) => boolean;
13
+ id: string;
14
+ };
15
+ /**
16
+ * Service for adding and retrieving, and checking {@link Condition}s to and from the condition registry
17
+ *
18
+ * @alpha
19
+ * @group Conditions
20
+ */
21
+ export interface ConditionRegistry {
22
+ /**
23
+ * Add a {@link Condition} to the registry
24
+ *
25
+ * @param condition - the condition to pass to the registry
26
+ * @throws error if the id already exists in the registry
27
+ */
28
+ addCondition(condition: Condition): any;
29
+ /**
30
+ * Remove a {@link Condition} from the registry
31
+ *
32
+ * @param condition - the condition to remove
33
+ * @throws error if the id does not exist in the registry
34
+ */
35
+ removeCondition(condition: Condition): any;
36
+ /**
37
+ * Checks if a {@link Condition} exists on the registry
38
+ *
39
+ * @param id - id of the condition
40
+ * @returns true if it exists, false otherwise
41
+ */
42
+ hasCondition(id: string): boolean;
43
+ /**
44
+ * Gets all {@link Condition}s
45
+ *
46
+ * @returns a list of all existing conditions
47
+ */
48
+ getConditions(): Condition[];
49
+ /**
50
+ * Gets a {@link Condition} by id
51
+ *
52
+ * @param id - id of the condition
53
+ * @throws error if no condition was found with the specified id
54
+ * @returns the condition with the specified id
55
+ */
56
+ getCondition(id: string): Condition;
57
+ }
58
+ //# sourceMappingURL=conditionregistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditionregistry.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/conditionregistry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAWb,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC;IAK/C,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS,OAAE;IAEnC;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,OAAE;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;;;OAIG;IACH,aAAa,IAAI,SAAS,EAAE,CAAC;IAE7B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './conditionregistry';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './conditionregistry';
2
+ export * from './types';
@@ -0,0 +1,15 @@
1
+ import { ConditionRegistry as Service } from './conditionregistry';
2
+ declare const SERVICE_NAME = "conditionRegistry";
3
+ declare module '../core/platform' {
4
+ interface PlatformServiceNameType {
5
+ /**
6
+ * @see {@link Service | ConditionRegistry}
7
+ */
8
+ ConditionRegistry: typeof SERVICE_NAME;
9
+ }
10
+ interface LimeWebComponentPlatform {
11
+ get(name: PlatformServiceNameType['ConditionRegistry']): Service;
12
+ }
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/conditionregistry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnE,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IACD,UAAU,wBAAwB;QAC9B,GAAG,CAAC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC;KACpE;CACJ"}
@@ -0,0 +1,3 @@
1
+ import { PlatformServiceName } from '../core/platform';
2
+ const SERVICE_NAME = 'conditionRegistry';
3
+ PlatformServiceName.ConditionRegistry = SERVICE_NAME;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./conditionregistry"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var platform_1 = require("../core/platform");
4
+ var SERVICE_NAME = 'conditionRegistry';
5
+ platform_1.PlatformServiceName.ConditionRegistry = SERVICE_NAME;
package/dist/es5/index.js CHANGED
@@ -22,3 +22,4 @@ tslib_1.__exportStar(require("./userdata"), exports);
22
22
  tslib_1.__exportStar(require("./application"), exports);
23
23
  tslib_1.__exportStar(require("./userpreferences"), exports);
24
24
  tslib_1.__exportStar(require("./datetimeformatter"), exports);
25
+ tslib_1.__exportStar(require("./conditionregistry"), exports);
package/dist/index.d.ts CHANGED
@@ -41,4 +41,5 @@ export * from './userdata';
41
41
  export * from './application';
42
42
  export * from './userpreferences';
43
43
  export * from './datetimeformatter';
44
+ export * from './conditionregistry';
44
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -41,3 +41,4 @@ export * from './userdata';
41
41
  export * from './application';
42
42
  export * from './userpreferences';
43
43
  export * from './datetimeformatter';
44
+ export * from './conditionregistry';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.14.0",
3
+ "version": "5.15.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",