@dra2020/dra-types 1.8.147 → 1.8.149

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/lib/all.ts CHANGED
@@ -4,3 +4,5 @@ import * as PF from './packedfields';
4
4
  export { PF }
5
5
  import * as CM from './colormgr';
6
6
  export { CM }
7
+ import * as DX from './datasource';
8
+ export { DX }
@@ -0,0 +1,74 @@
1
+ export function dxBaseCycle(dx: string): string
2
+ {
3
+ return dx === '2016_BG' ? '2010_VD' : dx
4
+ }
5
+
6
+ export function dxValid(dx: string): string
7
+ {
8
+ switch (dx)
9
+ {
10
+ case '2010_VD':
11
+ case '2016_BG':
12
+ case '2020_VD':
13
+ case '2030_VD':
14
+ return dx;
15
+ default:
16
+ return '';
17
+ }
18
+ }
19
+
20
+ export interface SupportMap
21
+ {
22
+ dataset: boolean,
23
+ blockediting: boolean,
24
+ citypainting: boolean,
25
+ }
26
+
27
+ export const Support: { [dx: string]: SupportMap } =
28
+ {
29
+ ['2010_VD']:
30
+ {
31
+ dataset: false,
32
+ blockediting: false,
33
+ citypainting: false,
34
+ },
35
+ ['2016_BG']:
36
+ {
37
+ dataset: false,
38
+ blockediting: false,
39
+ citypainting: false,
40
+ },
41
+ ['2020_VD']:
42
+ {
43
+ dataset: true,
44
+ blockediting: true,
45
+ citypainting: true,
46
+ },
47
+ ['2030_VD']:
48
+ {
49
+ dataset: true,
50
+ blockediting: true,
51
+ citypainting: true,
52
+ },
53
+ ['']:
54
+ {
55
+ dataset: false,
56
+ blockediting: false,
57
+ citypainting: false,
58
+ },
59
+ };
60
+
61
+ export function dxSupportsDataset(dx: string): boolean
62
+ {
63
+ return Support[dxValid(dx)].dataset
64
+ }
65
+
66
+ export function dxSupportsBlockediting(dx: string): boolean
67
+ {
68
+ return Support[dxValid(dx)].blockediting
69
+ }
70
+
71
+ export function dxSupportsCitypainting(dx: string): boolean
72
+ {
73
+ return Support[dxValid(dx)].citypainting
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/dra-types",
3
- "version": "1.8.147",
3
+ "version": "1.8.149",
4
4
  "description": "Shared types used between client, server and tools.",
5
5
  "main": "dist/dra-types.js",
6
6
  "types": "./dist/all.d.ts",
@@ -36,7 +36,7 @@
36
36
  "webpack-cli": "^5.1.4"
37
37
  },
38
38
  "dependencies": {
39
- "@dra2020/baseclient": "^1.0.164",
39
+ "@dra2020/baseclient": "^1.0.166",
40
40
  "geojson": "^0.5.0",
41
41
  "object-hash": "^3.0.0"
42
42
  }