Gustav Hansen 5dc153dcb7 chore(admin): convert utils to TS
Co-authored-by: Josh Ellis <josh.ellis@strapi.io>
2023-10-19 13:58:54 +01:00

34 lines
754 B
TypeScript

import type { Entity as TEntity } from '@strapi/types';
export interface Entity {
id: TEntity.ID;
createdAt: string;
updatedAt: string;
}
/**
* TODO: is there a way to infer this from the content-type schema?
* TODO: define content-type schema for a role.
*/
export interface RoleEntity extends Entity {
name: string;
code: string;
description?: string;
usersCount?: number;
}
/**
* TODO: is there a way to infer this from the content-type schema?
* TODO: define content-type schema for a user.
*/
export interface UserEntity extends Entity {
firstname: string;
lastname?: string;
username?: null | string;
email: string;
isActive: boolean;
blocked: boolean;
preferedLanguage: null | string;
roles: RoleEntity[];
}