wedance-shared 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wedance-shared",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "This repository contains shared TypeScript types and interfaces used across multiple WeDance applications:",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "format": "prettier --write \"src/**/*.ts\"",
13
13
  "check-format": "prettier --check \"src/**/*.ts\"",
14
14
  "test": "echo \"Error: no test specified\" && exit 1",
15
- "publish": "npm publish"
15
+ "publish": "npm publish --access public"
16
16
  },
17
17
  "keywords": [],
18
18
  "author": "",
package/src/city.ts CHANGED
@@ -1,43 +1,69 @@
1
- export const LIST_CITIES = [
1
+ type CityData =
2
+ | {
3
+ city: "helsinki";
4
+ country: "fi";
5
+ coordinates: [60.1695, 24.9354];
6
+ }
7
+ | {
8
+ city: "tampere";
9
+ country: "fi";
10
+ coordinates: [61.4978, 23.761];
11
+ }
12
+ | {
13
+ city: "oslo";
14
+ country: "no";
15
+ coordinates: [59.9139, 10.7522];
16
+ }
17
+ | {
18
+ city: "tallinn";
19
+ country: "ee";
20
+ coordinates: [59.437, 24.7536];
21
+ }
22
+ | {
23
+ city: "copenhagen";
24
+ country: "dk";
25
+ coordinates: [55.6761, 12.5683];
26
+ };
27
+
28
+ export const LIST_CITIES: CityData[] = [
2
29
  {
3
- city: 'helsinki',
4
- country: 'fi',
5
- coordinates: [60.1695, 24.9354] as const
30
+ city: "helsinki",
31
+ country: "fi",
32
+ coordinates: [60.1695, 24.9354],
6
33
  },
7
34
  {
8
- city: 'tampere',
9
- country: 'fi',
10
- coordinates: [61.4978, 23.761] as const
35
+ city: "tampere",
36
+ country: "fi",
37
+ coordinates: [61.4978, 23.761],
11
38
  },
12
-
13
39
  {
14
- city: 'oslo',
15
- country: 'no',
16
- coordinates: [59.9139, 10.7522] as const
40
+ city: "oslo",
41
+ country: "no",
42
+ coordinates: [59.9139, 10.7522],
17
43
  },
18
44
  // {
19
45
  // city: 'stockholm',
20
46
  // country: 'se',
21
47
  // },
22
48
  {
23
- city: 'tallinn',
24
- country: 'ee',
25
- coordinates: [59.437, 24.7536] as const
49
+ city: "tallinn",
50
+ country: "ee",
51
+ coordinates: [59.437, 24.7536],
26
52
  },
27
53
  {
28
- city: 'copenhagen',
29
- country: 'dk',
30
- coordinates: [55.6761, 12.5683] as const
31
- }
32
- ] as const
54
+ city: "copenhagen",
55
+ country: "dk",
56
+ coordinates: [55.6761, 12.5683],
57
+ },
58
+ ];
33
59
 
34
- export type City = (typeof LIST_CITIES)[number]
35
- export type CityName = City['city']
36
- export type CountryCode = City['country']
60
+ export type City = CityData;
61
+ export type CityName = CityData["city"];
62
+ export type CountryCode = CityData["country"];
37
63
 
38
64
  export enum Timezone {
39
- FINLAND = 'Europe/Helsinki',
40
- DENMARK = 'Europe/Copenhagen',
41
- SWEDEN = 'Europe/Stockholm',
42
- NORWAY = 'Europe/Oslo'
65
+ FINLAND = "Europe/Helsinki",
66
+ DENMARK = "Europe/Copenhagen",
67
+ SWEDEN = "Europe/Stockholm",
68
+ NORWAY = "Europe/Oslo",
43
69
  }
package/tsconfig.json CHANGED
@@ -11,7 +11,7 @@
11
11
  // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
12
 
13
13
  /* Language and Environment */
14
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
14
+ "target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
15
  // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
16
  // "jsx": "preserve", /* Specify what JSX code is generated. */
17
17
  // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */