@dcupl/common 1.1.1 → 1.1.2
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/lib-cjs/cache.controller.d.ts +2 -1
- package/dist/lib-cjs/cache.controller.js +6 -1
- package/dist/lib-cjs/cache.controller.js.map +1 -1
- package/dist/lib-cjs/changeDetection.d.ts +7 -2
- package/dist/lib-cjs/changeDetection.js +7 -5
- package/dist/lib-cjs/changeDetection.js.map +1 -1
- package/dist/lib-cjs/types/dcupl.types.d.ts +9 -8
- package/dist/lib-cjs/types/index.d.ts +0 -2
- package/dist/lib-cjs/types/index.js +0 -2
- package/dist/lib-cjs/types/index.js.map +1 -1
- package/dist/lib-esm/cache.controller.d.ts +2 -1
- package/dist/lib-esm/cache.controller.js +6 -1
- package/dist/lib-esm/cache.controller.js.map +1 -1
- package/dist/lib-esm/changeDetection.d.ts +7 -2
- package/dist/lib-esm/changeDetection.js +7 -5
- package/dist/lib-esm/changeDetection.js.map +1 -1
- package/dist/lib-esm/types/dcupl.types.d.ts +9 -8
- package/dist/lib-esm/types/index.d.ts +0 -2
- package/dist/lib-esm/types/index.js +0 -2
- package/dist/lib-esm/types/index.js.map +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/lib-cjs/types/global.types.d.ts +0 -1
- package/dist/lib-cjs/types/global.types.js +0 -5
- package/dist/lib-cjs/types/global.types.js.map +0 -1
- package/dist/lib-cjs/types/selection.types.d.ts +0 -14
- package/dist/lib-cjs/types/selection.types.js +0 -3
- package/dist/lib-cjs/types/selection.types.js.map +0 -1
- package/dist/lib-esm/types/global.types.d.ts +0 -1
- package/dist/lib-esm/types/global.types.js +0 -2
- package/dist/lib-esm/types/global.types.js.map +0 -1
- package/dist/lib-esm/types/selection.types.d.ts +0 -14
- package/dist/lib-esm/types/selection.types.js +0 -2
- package/dist/lib-esm/types/selection.types.js.map +0 -1
|
@@ -6,13 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CacheController = void 0;
|
|
7
7
|
var object_hash_1 = __importDefault(require("object-hash"));
|
|
8
8
|
var CacheController = /** @class */ (function () {
|
|
9
|
-
function CacheController() {
|
|
9
|
+
function CacheController(enabled) {
|
|
10
|
+
this.enabled = enabled;
|
|
10
11
|
this.cache = new Map();
|
|
11
12
|
}
|
|
12
13
|
CacheController.prototype.get = function (key, context) {
|
|
14
|
+
if (!this.enabled)
|
|
15
|
+
return undefined;
|
|
13
16
|
return this.cache.get(this.getCacheName(key, context));
|
|
14
17
|
};
|
|
15
18
|
CacheController.prototype.set = function (key, context, value) {
|
|
19
|
+
if (!this.enabled)
|
|
20
|
+
return undefined;
|
|
16
21
|
this.cache.set(this.getCacheName(key, context), value);
|
|
17
22
|
};
|
|
18
23
|
CacheController.prototype.has = function (key, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.controller.js","sourceRoot":"","sources":["../../src/cache.controller.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAqC;AAErC;IAGE;
|
|
1
|
+
{"version":3,"file":"cache.controller.js","sourceRoot":"","sources":["../../src/cache.controller.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAqC;AAErC;IAGE,yBAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY;QAClC,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY,EAAE,KAAU;QAC9C,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,+BAAK,GAAZ;QACE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAEM,sCAAY,GAAnB,UAAoB,GAAW,EAAE,OAAY;QAC3C,IAAM,IAAI,GAAG,IAAA,qBAAU,EAAC,OAAO,CAAC,CAAC;QACjC,OAAO,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1B,CAAC;IACH,sBAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BY,0CAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallbackFunction } from './types';
|
|
1
|
+
import { CallbackFunction, DcuplInitOptions } from './types';
|
|
2
2
|
export type DcuplUpdateScope = 'all' | 'global' | 'list' | 'list$';
|
|
3
3
|
export type DcuplUpdateTrigger = 'user' | 'loader';
|
|
4
4
|
export type DcuplUpdateType = 'loader_fetch_finished' | 'file_loaded' | 'file_processed' | 'dcupl_initialized' | 'dcupl_updated_manually' | 'data_reprocessed_manually' | 'result_updated' | 'filter_applied' | 'global_triggered_update';
|
|
@@ -19,10 +19,15 @@ export type DcuplUpdateMessage = {
|
|
|
19
19
|
export declare class ChangeDetector {
|
|
20
20
|
key: string;
|
|
21
21
|
protected parentCd: ChangeDetector | undefined;
|
|
22
|
+
dcuplInitOptions: DcuplInitOptions;
|
|
22
23
|
private off;
|
|
23
24
|
private updateListener;
|
|
24
25
|
constructor();
|
|
25
|
-
_init(
|
|
26
|
+
_init(options: {
|
|
27
|
+
cdRefKey: string;
|
|
28
|
+
dcuplInitOptions: DcuplInitOptions;
|
|
29
|
+
parentCd?: ChangeDetector;
|
|
30
|
+
}): void;
|
|
26
31
|
destroy(): void;
|
|
27
32
|
trigger(msg: DcuplUpdateMessage): void;
|
|
28
33
|
on(cb: CallbackFunction): () => void;
|
|
@@ -10,10 +10,11 @@ var ChangeDetector = /** @class */ (function () {
|
|
|
10
10
|
function ChangeDetector() {
|
|
11
11
|
this.updateListener = new Set();
|
|
12
12
|
}
|
|
13
|
-
ChangeDetector.prototype._init = function (
|
|
13
|
+
ChangeDetector.prototype._init = function (options) {
|
|
14
14
|
var _this = this;
|
|
15
|
-
this.key = cdRefKey;
|
|
16
|
-
this.parentCd = parentCd;
|
|
15
|
+
this.key = options.cdRefKey;
|
|
16
|
+
this.parentCd = options.parentCd;
|
|
17
|
+
this.dcuplInitOptions = options.dcuplInitOptions;
|
|
17
18
|
if (this.parentCd) {
|
|
18
19
|
this.off = this.parentCd.on(function (msg) {
|
|
19
20
|
var _a;
|
|
@@ -62,7 +63,7 @@ var trigger = function (msg) {
|
|
|
62
63
|
var log = function (_target, _propertyKey, descriptor) {
|
|
63
64
|
var originalMethod = descriptor.value;
|
|
64
65
|
descriptor.value = function () {
|
|
65
|
-
var _a;
|
|
66
|
+
var _a, _b, _c;
|
|
66
67
|
var args = [];
|
|
67
68
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
68
69
|
args[_i] = arguments[_i];
|
|
@@ -100,8 +101,9 @@ var trigger = function (msg) {
|
|
|
100
101
|
var end = performance_1.perf.now();
|
|
101
102
|
msg.duration = end - start;
|
|
102
103
|
cdRef === null || cdRef === void 0 ? void 0 : cdRef.trigger(msg);
|
|
104
|
+
var shouldClone = !!((_c = (_b = cdRef.dcuplInitOptions.performance) === null || _b === void 0 ? void 0 : _b.clone) === null || _c === void 0 ? void 0 : _c.enabled) && !!msg.cloneResult;
|
|
103
105
|
try {
|
|
104
|
-
return (0, exports.clone)(result,
|
|
106
|
+
return (0, exports.clone)(result, shouldClone);
|
|
105
107
|
}
|
|
106
108
|
catch (err) {
|
|
107
109
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeDetection.js","sourceRoot":"","sources":["../../src/changeDetection.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyC;AAEzC,6CAAqC;AAgCrC;
|
|
1
|
+
{"version":3,"file":"changeDetection.js","sourceRoot":"","sources":["../../src/changeDetection.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyC;AAEzC,6CAAqC;AAgCrC;IASE;QAFQ,mBAAc,GAA0B,IAAI,GAAG,EAAE,CAAC;IAE3C,CAAC;IAET,8BAAK,GAAZ,UAAa,OAA4F;QAAzG,iBAcC;QAbC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;QAE5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAEjC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAEjD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAC,GAAuB;;gBAClD,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,cAAc,MAAK,MAAA,KAAI,CAAC,QAAQ,0CAAE,GAAG,CAAA,EAAE;oBACxE,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;iBACnB;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,gCAAO,GAAd;QACE,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAEM,gCAAO,GAAd,UAAe,GAAuB;QACpC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE;YACvB,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC;SAC/B;QAED,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AC,MAAM,EAAE,WAAW,CAAC,CAAC;iBACnC;gBAAC,OAAO,GAAG,EAAE;oBACZ,OAAO,MAAM,CAAC;iBACf;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,GAAG,CAAC;aACX;QACH,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AA5DW,QAAA,OAAO,WA4DlB"}
|
|
@@ -2,17 +2,18 @@ import { DcuplUpdateMessage } from '../changeDetection';
|
|
|
2
2
|
import { DcuplItemsOptions } from './list.types';
|
|
3
3
|
export type DcuplInitOptions = {
|
|
4
4
|
config?: DcuplInitConfig;
|
|
5
|
-
logs?: DcuplInitLoggingConfig;
|
|
6
5
|
errorTracking?: DcuplInitErrorTrackingConfig;
|
|
7
|
-
|
|
6
|
+
performance?: DcuplInitPerformanceConfig;
|
|
8
7
|
};
|
|
9
|
-
export type
|
|
10
|
-
|
|
8
|
+
export type DcuplInitPerformanceConfig = {
|
|
9
|
+
cache?: {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
clone?: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
12
|
-
export type
|
|
13
|
-
baseUrl: string;
|
|
14
|
-
};
|
|
15
|
-
export type DcuplInitLoggingConfig = {
|
|
16
|
+
export type DcuplInitErrorTrackingConfig = {
|
|
16
17
|
enabled: boolean;
|
|
17
18
|
};
|
|
18
19
|
export type DcuplInitConfig = {
|
|
@@ -3,7 +3,6 @@ export * from './data.types';
|
|
|
3
3
|
export * from './dcupl.types';
|
|
4
4
|
export * from './facets.types';
|
|
5
5
|
export * from './filter.types';
|
|
6
|
-
export * from './global.types';
|
|
7
6
|
export * from './group-by.types';
|
|
8
7
|
export * from './internal.types';
|
|
9
8
|
export * from './list.types';
|
|
@@ -11,5 +10,4 @@ export * from './model.types';
|
|
|
11
10
|
export * from './projection.types';
|
|
12
11
|
export * from './query.types';
|
|
13
12
|
export * from './section.types';
|
|
14
|
-
export * from './selection.types';
|
|
15
13
|
export * from './suggestion.types';
|
|
@@ -19,7 +19,6 @@ __exportStar(require("./data.types"), exports);
|
|
|
19
19
|
__exportStar(require("./dcupl.types"), exports);
|
|
20
20
|
__exportStar(require("./facets.types"), exports);
|
|
21
21
|
__exportStar(require("./filter.types"), exports);
|
|
22
|
-
__exportStar(require("./global.types"), exports);
|
|
23
22
|
__exportStar(require("./group-by.types"), exports);
|
|
24
23
|
__exportStar(require("./internal.types"), exports);
|
|
25
24
|
__exportStar(require("./list.types"), exports);
|
|
@@ -27,6 +26,5 @@ __exportStar(require("./model.types"), exports);
|
|
|
27
26
|
__exportStar(require("./projection.types"), exports);
|
|
28
27
|
__exportStar(require("./query.types"), exports);
|
|
29
28
|
__exportStar(require("./section.types"), exports);
|
|
30
|
-
__exportStar(require("./selection.types"), exports);
|
|
31
29
|
__exportStar(require("./suggestion.types"), exports);
|
|
32
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+CAA6B;AAC7B,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,+CAA6B;AAC7B,gDAA8B;AAC9B,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import objectHash from 'object-hash';
|
|
2
2
|
var CacheController = /** @class */ (function () {
|
|
3
|
-
function CacheController() {
|
|
3
|
+
function CacheController(enabled) {
|
|
4
|
+
this.enabled = enabled;
|
|
4
5
|
this.cache = new Map();
|
|
5
6
|
}
|
|
6
7
|
CacheController.prototype.get = function (key, context) {
|
|
8
|
+
if (!this.enabled)
|
|
9
|
+
return undefined;
|
|
7
10
|
return this.cache.get(this.getCacheName(key, context));
|
|
8
11
|
};
|
|
9
12
|
CacheController.prototype.set = function (key, context, value) {
|
|
13
|
+
if (!this.enabled)
|
|
14
|
+
return undefined;
|
|
10
15
|
this.cache.set(this.getCacheName(key, context), value);
|
|
11
16
|
};
|
|
12
17
|
CacheController.prototype.has = function (key, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.controller.js","sourceRoot":"","sources":["../../src/cache.controller.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;IAGE;
|
|
1
|
+
{"version":3,"file":"cache.controller.js","sourceRoot":"","sources":["../../src/cache.controller.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;IAGE,yBAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IACzB,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY;QAClC,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY,EAAE,KAAU;QAC9C,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAEM,6BAAG,GAAV,UAAW,GAAW,EAAE,OAAY;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,+BAAK,GAAZ;QACE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAEM,sCAAY,GAAnB,UAAoB,GAAW,EAAE,OAAY;QAC3C,IAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1B,CAAC;IACH,sBAAC;AAAD,CAAC,AA7BD,IA6BC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallbackFunction } from './types';
|
|
1
|
+
import { CallbackFunction, DcuplInitOptions } from './types';
|
|
2
2
|
export type DcuplUpdateScope = 'all' | 'global' | 'list' | 'list$';
|
|
3
3
|
export type DcuplUpdateTrigger = 'user' | 'loader';
|
|
4
4
|
export type DcuplUpdateType = 'loader_fetch_finished' | 'file_loaded' | 'file_processed' | 'dcupl_initialized' | 'dcupl_updated_manually' | 'data_reprocessed_manually' | 'result_updated' | 'filter_applied' | 'global_triggered_update';
|
|
@@ -19,10 +19,15 @@ export type DcuplUpdateMessage = {
|
|
|
19
19
|
export declare class ChangeDetector {
|
|
20
20
|
key: string;
|
|
21
21
|
protected parentCd: ChangeDetector | undefined;
|
|
22
|
+
dcuplInitOptions: DcuplInitOptions;
|
|
22
23
|
private off;
|
|
23
24
|
private updateListener;
|
|
24
25
|
constructor();
|
|
25
|
-
_init(
|
|
26
|
+
_init(options: {
|
|
27
|
+
cdRefKey: string;
|
|
28
|
+
dcuplInitOptions: DcuplInitOptions;
|
|
29
|
+
parentCd?: ChangeDetector;
|
|
30
|
+
}): void;
|
|
26
31
|
destroy(): void;
|
|
27
32
|
trigger(msg: DcuplUpdateMessage): void;
|
|
28
33
|
on(cb: CallbackFunction): () => void;
|
|
@@ -4,10 +4,11 @@ var ChangeDetector = /** @class */ (function () {
|
|
|
4
4
|
function ChangeDetector() {
|
|
5
5
|
this.updateListener = new Set();
|
|
6
6
|
}
|
|
7
|
-
ChangeDetector.prototype._init = function (
|
|
7
|
+
ChangeDetector.prototype._init = function (options) {
|
|
8
8
|
var _this = this;
|
|
9
|
-
this.key = cdRefKey;
|
|
10
|
-
this.parentCd = parentCd;
|
|
9
|
+
this.key = options.cdRefKey;
|
|
10
|
+
this.parentCd = options.parentCd;
|
|
11
|
+
this.dcuplInitOptions = options.dcuplInitOptions;
|
|
11
12
|
if (this.parentCd) {
|
|
12
13
|
this.off = this.parentCd.on(function (msg) {
|
|
13
14
|
var _a;
|
|
@@ -55,7 +56,7 @@ export var trigger = function (msg) {
|
|
|
55
56
|
var log = function (_target, _propertyKey, descriptor) {
|
|
56
57
|
var originalMethod = descriptor.value;
|
|
57
58
|
descriptor.value = function () {
|
|
58
|
-
var _a;
|
|
59
|
+
var _a, _b, _c;
|
|
59
60
|
var args = [];
|
|
60
61
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
61
62
|
args[_i] = arguments[_i];
|
|
@@ -93,8 +94,9 @@ export var trigger = function (msg) {
|
|
|
93
94
|
var end = perf.now();
|
|
94
95
|
msg.duration = end - start;
|
|
95
96
|
cdRef === null || cdRef === void 0 ? void 0 : cdRef.trigger(msg);
|
|
97
|
+
var shouldClone = !!((_c = (_b = cdRef.dcuplInitOptions.performance) === null || _b === void 0 ? void 0 : _b.clone) === null || _c === void 0 ? void 0 : _c.enabled) && !!msg.cloneResult;
|
|
96
98
|
try {
|
|
97
|
-
return clone(result,
|
|
99
|
+
return clone(result, shouldClone);
|
|
98
100
|
}
|
|
99
101
|
catch (err) {
|
|
100
102
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeDetection.js","sourceRoot":"","sources":["../../src/changeDetection.ts"],"names":[],"mappings":"AAAA,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Z,MAAM,GAAG,CAAC;aACX;QACH,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -2,17 +2,18 @@ import { DcuplUpdateMessage } from '../changeDetection';
|
|
|
2
2
|
import { DcuplItemsOptions } from './list.types';
|
|
3
3
|
export type DcuplInitOptions = {
|
|
4
4
|
config?: DcuplInitConfig;
|
|
5
|
-
logs?: DcuplInitLoggingConfig;
|
|
6
5
|
errorTracking?: DcuplInitErrorTrackingConfig;
|
|
7
|
-
|
|
6
|
+
performance?: DcuplInitPerformanceConfig;
|
|
8
7
|
};
|
|
9
|
-
export type
|
|
10
|
-
|
|
8
|
+
export type DcuplInitPerformanceConfig = {
|
|
9
|
+
cache?: {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
clone?: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
12
|
-
export type
|
|
13
|
-
baseUrl: string;
|
|
14
|
-
};
|
|
15
|
-
export type DcuplInitLoggingConfig = {
|
|
16
|
+
export type DcuplInitErrorTrackingConfig = {
|
|
16
17
|
enabled: boolean;
|
|
17
18
|
};
|
|
18
19
|
export type DcuplInitConfig = {
|
|
@@ -3,7 +3,6 @@ export * from './data.types';
|
|
|
3
3
|
export * from './dcupl.types';
|
|
4
4
|
export * from './facets.types';
|
|
5
5
|
export * from './filter.types';
|
|
6
|
-
export * from './global.types';
|
|
7
6
|
export * from './group-by.types';
|
|
8
7
|
export * from './internal.types';
|
|
9
8
|
export * from './list.types';
|
|
@@ -11,5 +10,4 @@ export * from './model.types';
|
|
|
11
10
|
export * from './projection.types';
|
|
12
11
|
export * from './query.types';
|
|
13
12
|
export * from './section.types';
|
|
14
|
-
export * from './selection.types';
|
|
15
13
|
export * from './suggestion.types';
|
|
@@ -3,7 +3,6 @@ export * from './data.types';
|
|
|
3
3
|
export * from './dcupl.types';
|
|
4
4
|
export * from './facets.types';
|
|
5
5
|
export * from './filter.types';
|
|
6
|
-
export * from './global.types';
|
|
7
6
|
export * from './group-by.types';
|
|
8
7
|
export * from './internal.types';
|
|
9
8
|
export * from './list.types';
|
|
@@ -11,6 +10,5 @@ export * from './model.types';
|
|
|
11
10
|
export * from './projection.types';
|
|
12
11
|
export * from './query.types';
|
|
13
12
|
export * from './section.types';
|
|
14
|
-
export * from './selection.types';
|
|
15
13
|
export * from './suggestion.types';
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|