UNPKG

3.35 kBTypeScriptView Raw
1import { _SPCollection, _SPInstance, IDeleteable } from "../spqueryable.js";
2import { ISiteGroups } from "../site-groups/types.js";
3import { PrincipalType } from "../types.js";
4export declare class _SiteUsers extends _SPCollection<ISiteUserInfo[]> {
5 /**
6 * Gets a user from the collection by id
7 *
8 * @param id The id of the user to retrieve
9 */
10 getById(id: number): ISiteUser;
11 /**
12 * Gets a user from the collection by email
13 *
14 * @param email The email address of the user to retrieve
15 */
16 getByEmail(email: string): ISiteUser;
17 /**
18 * Gets a user from the collection by login name
19 *
20 * @param loginName The login name of the user to retrieve
21 */
22 getByLoginName(loginName: string): ISiteUser;
23 /**
24 * Removes a user from the collection by id
25 *
26 * @param id The id of the user to remove
27 */
28 removeById(id: number): Promise<any>;
29 /**
30 * Removes a user from the collection by login name
31 *
32 * @param loginName The login name of the user to remove
33 */
34 removeByLoginName(loginName: string): Promise<any>;
35 /**
36 * Adds a user to a site collection
37 *
38 * @param loginName The login name of the user to add to a site collection
39 *
40 */
41 add(loginName: string): Promise<ISiteUser>;
42}
43export interface ISiteUsers extends _SiteUsers {
44}
45export declare const SiteUsers: import("../spqueryable.js").ISPInvokableFactory<ISiteUsers>;
46/**
47 * Describes a single user
48 *
49 */
50export declare class _SiteUser extends _SPInstance<ISiteUserInfo> {
51 delete: (this: import("../spqueryable.js").ISPQueryable<any>) => Promise<void>;
52 /**
53 * Gets the groups for this user
54 *
55 */
56 get groups(): ISiteGroups;
57 /**
58 * Updates this user
59 *
60 * @param props Group properties to update
61 */
62 update(props: Partial<ISiteUserInfo>): Promise<IUserUpdateResult>;
63}
64export interface ISiteUser extends _SiteUser, IDeleteable {
65}
66export declare const SiteUser: import("../spqueryable.js").ISPInvokableFactory<ISiteUser>;
67export interface ISiteUserInfo extends ISiteUserProps {
68 Expiration: string;
69 IsEmailAuthenticationGuestUser: boolean;
70 UserId: {
71 NameId: string;
72 NameIdIssuer: string;
73 };
74 UserPrincipalName: string | null;
75}
76/**
77 * Describes a single user properties
78 *
79 */
80export interface ISiteUserProps {
81 /**
82 * Contains Site user email
83 *
84 */
85 Email: string;
86 /**
87 * Contains Site user Id
88 *
89 */
90 Id: number;
91 /**
92 * Site user IsHiddenInUI
93 *
94 */
95 IsHiddenInUI: boolean;
96 /**
97 * Site user IsShareByEmailGuestUser
98 *
99 */
100 IsShareByEmailGuestUser: boolean;
101 /**
102 * Describes if Site user Is Site Admin
103 *
104 */
105 IsSiteAdmin: boolean;
106 /**
107 * Site user LoginName
108 *
109 */
110 LoginName: string;
111 /**
112 * Site user Principal type
113 *
114 */
115 PrincipalType: number | PrincipalType;
116 /**
117 * Site user Title
118 *
119 */
120 Title: string;
121}
122/**
123 * Properties that provide both a getter, and a setter.
124 *
125 */
126export interface IUserUpdateResult {
127 user: ISiteUser;
128 data: any;
129}
130/**
131 * Result from ensuring a user
132 *
133 */
134export interface IWebEnsureUserResult {
135 data: ISiteUserProps;
136 user: ISiteUser;
137}
138//# sourceMappingURL=types.d.ts.map
\No newline at end of file