UNPKG

1.42 kBTypeScriptView Raw
1import type { DefaultElements, BasicMetaSysProps, MakeRequest } from '../common-types';
2export type UserProps = {
3 /**
4 * System metadata
5 */
6 sys: BasicMetaSysProps;
7 /**
8 * First name of the user
9 */
10 firstName: string;
11 /**
12 * Last name of the user
13 */
14 lastName: string;
15 /**
16 * Url to the users avatar
17 */
18 avatarUrl: string;
19 /**
20 * Email address of the user
21 */
22 email: string;
23 /**
24 * Activation flag
25 */
26 activated: boolean;
27 /**
28 * Number of sign ins
29 */
30 signInCount: number;
31 /**
32 * User confirmation flag
33 */
34 confirmed: boolean;
35 '2faEnabled': boolean;
36 cookieConsentData: string;
37};
38export interface User extends UserProps, DefaultElements<UserProps> {
39}
40/**
41 * @private
42 * @param makeRequest - function to make requests via an adapter
43 * @param data - Raw data
44 * @return Normalized user
45 */
46export declare function wrapUser<T = UserProps>(_makeRequest: MakeRequest, data: T): T & {
47 toPlainObject(): T;
48};
49/**
50 * @private
51 * @param makeRequest - function to make requests via an adapter
52 * @param data - Raw data collection
53 * @return Normalized user collection
54 */
55export declare const wrapUserCollection: <T = UserProps>(makeRequest: MakeRequest, data: import("../common-types").CollectionProp<T>) => import("../common-types").Collection<T & {
56 toPlainObject(): T;
57}, T>;