Skip to content

Commit c1e53d2

Browse files
committed
chore: force Permissions store type
1 parent 7de0991 commit c1e53d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import type { IPermission } from '@rocket.chat/core-typings';
2+
import type { StoreApi, UseBoundStore } from 'zustand';
23

34
import { PrivateCachedCollection } from '../../../../client/lib/cachedCollections';
5+
import type { IDocumentMapStore } from '../../../../client/lib/cachedCollections/DocumentMapStore';
6+
7+
type PermissionsStore = {
8+
use: UseBoundStore<StoreApi<IDocumentMapStore<IPermission>>>;
9+
readonly state: IDocumentMapStore<IPermission>;
10+
};
411

512
export const AuthzCachedCollection = new PrivateCachedCollection<IPermission>({
613
name: 'permissions',
714
eventType: 'notify-logged',
815
});
916

10-
export const Permissions = AuthzCachedCollection.collection;
17+
// We are restricting the type of the collection, removing Minimongo methods to avoid further usage, until full conversion to zustand store
18+
export const Permissions = AuthzCachedCollection.collection as PermissionsStore;

0 commit comments

Comments
 (0)