UNPKG

1.15 kBTypeScriptView Raw
1import { ISiteUsers, ISiteUser, IWebEnsureUserResult } from "./types.js";
2declare module "../webs/types" {
3 interface _Web {
4 readonly siteUsers: ISiteUsers;
5 readonly currentUser: ISiteUser;
6 ensureUser(loginName: string): Promise<IWebEnsureUserResult>;
7 getUserById(id: number): ISiteUser;
8 }
9 interface IWeb {
10 /**
11 * The site users
12 */
13 readonly siteUsers: ISiteUsers;
14 /**
15 * Information on the current user
16 */
17 readonly currentUser: ISiteUser;
18 /**
19 * Checks whether the specified login name belongs to a valid user in the web. If the user doesn't exist, adds the user to the web.
20 *
21 * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)
22 */
23 ensureUser(loginName: string): Promise<IWebEnsureUserResult>;
24 /**
25 * Returns the user corresponding to the specified member identifier for the current site
26 *
27 * @param id The id of the user
28 */
29 getUserById(id: number): ISiteUser;
30 }
31}
32//# sourceMappingURL=web.d.ts.map
\No newline at end of file