@quenty/grouputils 10.10.1 → 10.10.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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.10.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/grouputils@10.10.1...@quenty/grouputils@10.10.2) (2025-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [10.10.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/grouputils@10.10.0...@quenty/grouputils@10.10.1) (2025-03-21)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/grouputils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/grouputils",
3
- "version": "10.10.1",
3
+ "version": "10.10.2",
4
4
  "description": "Group utility functions for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,11 +26,11 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/loader": "^10.8.0",
30
- "@quenty/promise": "^10.10.1"
29
+ "@quenty/loader": "^10.8.1",
30
+ "@quenty/promise": "^10.10.2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
35
+ "gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
36
36
  }
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  Helpful functions involving Roblox groups.
3
4
  @class GroupUtils
@@ -18,7 +19,7 @@ local GroupUtils = {}
18
19
  @param groupId number
19
20
  @return Promise<number> -- Generally from 0 to 255
20
21
  ]=]
21
- function GroupUtils.promiseRankInGroup(player, groupId)
22
+ function GroupUtils.promiseRankInGroup(player: Player, groupId: number): Promise.Promise<number>
22
23
  assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
23
24
  assert(type(groupId) == "number", "Bad groupId")
24
25
 
@@ -47,7 +48,7 @@ end
47
48
  @param groupId number
48
49
  @return Promise<string>
49
50
  ]=]
50
- function GroupUtils.promiseRoleInGroup(player, groupId)
51
+ function GroupUtils.promiseRoleInGroup(player: Player, groupId: number): Promise.Promise<string>
51
52
  assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
52
53
  assert(type(groupId) == "number", "Bad groupId")
53
54
 
@@ -69,13 +70,30 @@ function GroupUtils.promiseRoleInGroup(player, groupId)
69
70
  end)
70
71
  end
71
72
 
73
+ export type GroupRoleInfo = {
74
+ Name: string,
75
+ Rank: number,
76
+ }
77
+
78
+ export type GroupInfo = {
79
+ Name: string,
80
+ Id: number,
81
+ Owner: {
82
+ Name: string,
83
+ Id: number,
84
+ },
85
+ EmblemUrl: string,
86
+ Description: string,
87
+ Roles: { GroupRoleInfo },
88
+ }
89
+
72
90
  --[=[
73
91
  Retrieves groupInfo about a group.
74
92
 
75
93
  @param groupId number
76
94
  @return Promise<table>
77
95
  ]=]
78
- function GroupUtils.promiseGroupInfo(groupId)
96
+ function GroupUtils.promiseGroupInfo(groupId: number): Promise.Promise<GroupInfo>
79
97
  assert(groupId, "Bad groupId")
80
98
 
81
99
  return Promise.spawn(function(resolve, reject)
@@ -103,7 +121,7 @@ end
103
121
  @param rankId number
104
122
  @return Promise<table>
105
123
  ]=]
106
- function GroupUtils.promiseGroupRoleInfo(groupId, rankId)
124
+ function GroupUtils.promiseGroupRoleInfo(groupId: number, rankId: number): Promise.Promise<GroupRoleInfo>
107
125
  assert(groupId, "Bad groupId")
108
126
  assert(rankId, "Bad rankId")
109
127
 
@@ -113,7 +131,7 @@ function GroupUtils.promiseGroupRoleInfo(groupId, rankId)
113
131
  return Promise.rejected("No Roles table")
114
132
  end
115
133
 
116
- for _, rankInfo in pairs(groupInfo.Roles) do
134
+ for _, rankInfo in groupInfo.Roles do
117
135
  if rankInfo.Rank == rankId then
118
136
  return rankInfo
119
137
  end