@opencrvs/toolkit 1.9.2-rc.f89f02a → 1.9.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.
|
@@ -11,6 +11,22 @@ export type SystemVariables = {
|
|
|
11
11
|
province: string;
|
|
12
12
|
district: string;
|
|
13
13
|
};
|
|
14
|
+
$window: {
|
|
15
|
+
location: {
|
|
16
|
+
href: string;
|
|
17
|
+
pathname: string;
|
|
18
|
+
hostname: string;
|
|
19
|
+
originPathname: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resolves `window().location.get('href')` to `window.location.href` to allow us to 1) type check system variables 2) change the implementation later if needed
|
|
25
|
+
*/
|
|
26
|
+
export declare const window: () => {
|
|
27
|
+
location: {
|
|
28
|
+
get: (key: "href" | "pathname" | "hostname" | "originPathname") => string;
|
|
29
|
+
};
|
|
14
30
|
};
|
|
15
31
|
/**
|
|
16
32
|
* Recursively flatten the keys of an object. Used to limit types when configuring default values in country config.
|
package/dist/events/index.js
CHANGED
|
@@ -371,6 +371,7 @@ __export(events_exports, {
|
|
|
371
371
|
validate: () => validate,
|
|
372
372
|
validateFieldInput: () => validateFieldInput,
|
|
373
373
|
validateValue: () => validateValue,
|
|
374
|
+
window: () => window2,
|
|
374
375
|
workqueueActions: () => workqueueActions,
|
|
375
376
|
writeActions: () => writeActions
|
|
376
377
|
});
|
|
@@ -8499,6 +8500,13 @@ var generateWorkqueues = (slug = "all-events") => defineWorkqueues([
|
|
|
8499
8500
|
]);
|
|
8500
8501
|
|
|
8501
8502
|
// ../commons/src/events/TemplateConfig.ts
|
|
8503
|
+
var window2 = () => ({
|
|
8504
|
+
location: {
|
|
8505
|
+
get: (key) => {
|
|
8506
|
+
return `$window.location.${key}`;
|
|
8507
|
+
}
|
|
8508
|
+
}
|
|
8509
|
+
});
|
|
8502
8510
|
function isTemplateVariable(value) {
|
|
8503
8511
|
return typeof value === "string" && value.startsWith("$");
|
|
8504
8512
|
}
|