chore: move types to @roleypoly/types package

This commit is contained in:
41666 2021-03-12 16:22:56 -05:00
parent 38ee680a33
commit a374030438
46 changed files with 244 additions and 59 deletions

37
packages/types/Role.ts Normal file
View file

@ -0,0 +1,37 @@
export enum RoleSafety {
Safe = 0,
HigherThanBot = 1 << 1,
DangerousPermissions = 1 << 2,
ManagedRole = 1 << 3,
}
export type Role = {
id: string;
name: string;
color: number;
managed: boolean;
position: number;
safety: RoleSafety;
/** Permissions is should be used as a BigInt, NOT a number. */
permissions: string;
};
export type OwnRoleInfo = {
highestRolePosition: number;
};
export enum TransactionType {
None = 0,
Remove = 1 << 1,
Add = 1 << 2,
}
export type RoleTransaction = {
id: string;
action: TransactionType;
};
export type RoleUpdate = {
knownState: Role['id'][];
transactions: RoleTransaction[];
};