@shakerquiz/utilities 0.4.5 → 0.4.8

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": "@shakerquiz/utilities",
3
- "version": "0.4.5",
3
+ "version": "0.4.8",
4
4
  "author": "yurkimus <yurkimus@gmail.com>",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  export const Domains: readonly ["Asset", "User", "Role", "City", "Venue", "Theme", "ThemeAsset", "Game", "GameAsset", "Registration", "Mailing"];
2
2
  /**
3
- * @type {Record<Domains[number], Icon>}
3
+ * @type {Record<Domain, Icon>}
4
4
  */
5
- export const DomainIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
5
+ export const DomainIcon: Record<Domain, Icon>;
6
6
  export namespace DomainKindPathname {
7
7
  namespace User {
8
8
  let Unit: "/user/:user?";
@@ -53,9 +53,9 @@ export namespace DomainKindPathname {
53
53
  }
54
54
  export const Procedures: readonly ["Checkin", "Redirect"];
55
55
  /**
56
- * @type {Record<Procedures[number], Icon>}
56
+ * @type {Record<Procedure, Icon>}
57
57
  */
58
- export const ProcedureIcon: Record<"Checkin" | "Redirect", Icon>;
58
+ export const ProcedureIcon: Record<Procedure, Icon>;
59
59
  export namespace ProcedureKindPathname {
60
60
  namespace Checkin {
61
61
  let Unit_8: "/checkin";
@@ -70,11 +70,14 @@ export namespace ProcedureKindPathname {
70
70
  export { Set_9 as Set };
71
71
  }
72
72
  }
73
- export const Features: ("Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing")[];
74
73
  /**
75
- * @type {Record<Features[number], Icon>}
74
+ * @type {Array<Domain | Procedure>}
76
75
  */
77
- export const FeatureIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
76
+ export const Features: Array<Domain | Procedure>;
77
+ /**
78
+ * @type {Record<Feature, Icon>}
79
+ */
80
+ export const FeatureIcon: Record<Feature, Icon>;
78
81
  export namespace FeatureKindPathname {
79
82
  export namespace Checkin_1 { }
80
83
  export { Checkin_1 as Checkin };
@@ -98,6 +101,10 @@ export namespace FeatureKindPathname {
98
101
  export { Mailing_1 as Mailing };
99
102
  }
100
103
  /**
101
- * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
104
+ * @type {Array<[feature: Feature, kind: Kind, pathname: string]>}
105
+ */
106
+ export const FeatureKindPathnames: Array<[feature: Feature, kind: Kind, pathname: string]>;
107
+ /**
108
+ * @type {Array<[feature: Feature, kind: Kind, pattern: URLPattern]>}
102
109
  */
103
- export const FeatureKindPathnames: Array<[feature: "Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", kind: Kind, pathname: string]>;
110
+ export const FeatureKindPatterns: Array<[feature: Feature, kind: Kind, pattern: URLPattern]>;
@@ -13,7 +13,7 @@ export var Domains = /** @type {const} */ ([
13
13
  ])
14
14
 
15
15
  /**
16
- * @type {Record<Domains[number], Icon>}
16
+ * @type {Record<Domain, Icon>}
17
17
  */
18
18
  export var DomainIcon = {
19
19
  'User': 'users',
@@ -27,7 +27,7 @@ export var DomainIcon = {
27
27
  }
28
28
 
29
29
  /**
30
- * @satisfies {Record<Domains[number], Record<Kind, string>>}
30
+ * @satisfies {Record<Domain, Record<Kind, string>>}
31
31
  */
32
32
  export var DomainKindPathname = /** @type {const} */ ({
33
33
  'User': {
@@ -77,7 +77,7 @@ export var Procedures = /** @type {const} */ ([
77
77
  ])
78
78
 
79
79
  /**
80
- * @type {Record<Procedures[number], Icon>}
80
+ * @type {Record<Procedure, Icon>}
81
81
  */
82
82
  export var ProcedureIcon = {
83
83
  'Checkin': 'arrow-right-end-on-rectangle',
@@ -85,7 +85,7 @@ export var ProcedureIcon = {
85
85
  }
86
86
 
87
87
  /**
88
- * @satisfies {Record<Procedures[number], Record<Kind, string>>}
88
+ * @satisfies {Record<Procedure, Record<Kind, string>>}
89
89
  */
90
90
  export var ProcedureKindPathname = /** @type {const} */ ({
91
91
  'Checkin': {
@@ -99,10 +99,13 @@ export var ProcedureKindPathname = /** @type {const} */ ({
99
99
  },
100
100
  })
101
101
 
102
+ /**
103
+ * @type {Array<Domain | Procedure>}
104
+ */
102
105
  export var Features = Domains.concat(Procedures)
103
106
 
104
107
  /**
105
- * @type {Record<Features[number], Icon>}
108
+ * @type {Record<Feature, Icon>}
106
109
  */
107
110
  export var FeatureIcon = {
108
111
  ...DomainIcon,
@@ -110,7 +113,7 @@ export var FeatureIcon = {
110
113
  }
111
114
 
112
115
  /**
113
- * @satisfies {Record<Features[number], Record<Kind, string>>}
116
+ * @satisfies {Record<Feature, Record<Kind, string>>}
114
117
  */
115
118
  export var FeatureKindPathname = {
116
119
  ...DomainKindPathname,
@@ -118,7 +121,7 @@ export var FeatureKindPathname = {
118
121
  }
119
122
 
120
123
  /**
121
- * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
124
+ * @type {Array<[feature: Feature, kind: Kind, pathname: string]>}
122
125
  */
123
126
  export var FeatureKindPathnames = Object
124
127
  .keys(FeatureKindPathname)
@@ -127,3 +130,13 @@ export var FeatureKindPathnames = Object
127
130
  .keys(FeatureKindPathname[feature])
128
131
  .map(kind => [feature, kind, FeatureKindPathname[feature][kind]])
129
132
  )
133
+
134
+ /**
135
+ * @type {Array<[feature: Feature, kind: Kind, pattern: URLPattern]>}
136
+ */
137
+ export var FeatureKindPatterns = FeatureKindPathnames
138
+ .map(([feature, kind, pathname]) => [
139
+ feature,
140
+ kind,
141
+ new URLPattern({ pathname }),
142
+ ])
@@ -13,51 +13,53 @@ interface RequestInit {
13
13
  * React
14
14
  */
15
15
 
16
- type UseState<Type> = [
17
- Type,
18
- import('react').Dispatch<import('react').SetStateAction<Type>>,
16
+ type UseState<T> = [
17
+ T,
18
+ import('react').Dispatch<import('react').SetStateAction<T>>,
19
19
  ]
20
20
 
21
21
  /**
22
22
  * Core
23
23
  */
24
24
 
25
- type Method = typeof import('./enumerations/core/methods.js').Methods[number]
25
+ type Method = (typeof import('./enumerations/core/methods.js').Methods)[number]
26
26
 
27
- type Domain = typeof import('./enumerations/core/features.js').Domains[number]
27
+ type Domain = (typeof import('./enumerations/core/features.js').Domains)[number]
28
28
 
29
29
  type Procedure =
30
- typeof import('./enumerations/core/features.js').Procedures[number]
30
+ (typeof import('./enumerations/core/features.js').Procedures)[number]
31
31
 
32
32
  type Feature = Domain | Procedure
33
33
 
34
- type Kind = typeof import('./enumerations/core/kinds.js').Kinds[number]
34
+ type Kind = (typeof import('./enumerations/core/kinds.js').Kinds)[number]
35
35
 
36
36
  type Scope = `${Method}/${Feature}/${Kind}`
37
37
 
38
- type Requirement =
39
- typeof import('./enumerations/misc/requirements.js').Requirements[number]
40
-
41
- type Role = keyof typeof import('./enumerations/entities/roles.js').Roles
38
+ type Role = (typeof import('./enumerations/entities/roles.js').Roles)[number]
42
39
 
43
40
  type GameStatus =
44
- keyof typeof import('./enumerations/entities/game-statuses.js').GameStatuses
41
+ (typeof import('./enumerations/entities/game-statuses.js').GameStatuses)[
42
+ number
43
+ ]
45
44
 
46
45
  type RegistrationStatus =
47
- keyof typeof import('./enumerations/entities/registration-statuses.js').RegistrationStatuses
46
+ (typeof import('./enumerations/entities/registration-statuses.js').RegistrationStatuses)[
47
+ number
48
+ ]
48
49
 
49
- type Lineup = keyof typeof import('./enumerations/entities/lineups.js').Lineups
50
+ type Lineup =
51
+ (typeof import('./enumerations/entities/lineups.js').Lineups)[number]
50
52
 
51
53
  type Affilation =
52
- keyof typeof import('./enumerations/entities/affilations.js').Affilations
54
+ (typeof import('./enumerations/entities/affilations.js').Affilations)[number]
53
55
 
54
56
  /**
55
57
  * Misc
56
58
  */
57
59
 
58
- type Icon = typeof import('./enumerations/misc/icons.js').Icons[number]
60
+ type Icon = (typeof import('./enumerations/misc/icons.js').Icons)[number]
59
61
 
60
- type Phase = typeof import('./enumerations/misc/phases.js').Phases[number]
62
+ type Phase = (typeof import('./enumerations/misc/phases.js').Phases)[number]
61
63
 
62
64
  /**
63
65
  * Products
package/source/index.d.ts CHANGED
@@ -19,7 +19,6 @@ export * from './enumerations/misc/cookies.js'
19
19
  export * from './enumerations/misc/icons.js'
20
20
  export * from './enumerations/misc/phases.js'
21
21
  export * from './enumerations/misc/regexps.js'
22
- export * from './enumerations/misc/requirements.js'
23
22
 
24
23
  export * from './enumerations/entities/affilations.js'
25
24
  export * from './enumerations/entities/game-statuses.js'
package/source/index.js CHANGED
@@ -19,7 +19,6 @@ export * from './enumerations/misc/cookies.js'
19
19
  export * from './enumerations/misc/icons.js'
20
20
  export * from './enumerations/misc/phases.js'
21
21
  export * from './enumerations/misc/regexps.js'
22
- export * from './enumerations/misc/requirements.js'
23
22
 
24
23
  export * from './enumerations/entities/affilations.js'
25
24
  export * from './enumerations/entities/game-statuses.js'
@@ -1 +0,0 @@
1
- export const Requirements: readonly ["Checkin", "Body"];
@@ -1,4 +0,0 @@
1
- export var Requirements = /** @type {const} */ ([
2
- 'Checkin',
3
- 'Body',
4
- ])