UNPKG

2.65 kBTypeScriptView Raw
1import { _SPCollection, _SPInstance } from "../spqueryable.js";
2import { ISiteUsers } from "../site-users/types.js";
3export declare class _SiteGroups extends _SPCollection<ISiteGroupInfo[]> {
4 /**
5 * Gets a group from the collection by id
6 *
7 * @param id The id of the group to retrieve
8 */
9 getById(id: number): ISiteGroup;
10 /**
11 * Adds a new group to the site collection
12 *
13 * @param properties The group properties object of property names and values to be set for the group
14 */
15 add(properties: Partial<ISiteGroupInfo>): Promise<IGroupAddResult>;
16 /**
17 * Gets a group from the collection by name
18 *
19 * @param groupName The name of the group to retrieve
20 */
21 getByName(groupName: string): ISiteGroup;
22 /**
23 * Removes the group with the specified member id from the collection
24 *
25 * @param id The id of the group to remove
26 */
27 removeById(id: number): Promise<void>;
28 /**
29 * Removes the cross-site group with the specified name from the collection
30 *
31 * @param loginName The name of the group to remove
32 */
33 removeByLoginName(loginName: string): Promise<any>;
34}
35export interface ISiteGroups extends _SiteGroups {
36}
37export declare const SiteGroups: import("../spqueryable.js").ISPInvokableFactory<ISiteGroups>;
38export declare class _SiteGroup extends _SPInstance<ISiteGroupInfo> {
39 /**
40 * Gets the users for this group
41 *
42 */
43 get users(): ISiteUsers;
44 /**
45 * @param props Group properties to update
46 */
47 update(props: Partial<ISiteGroupInfo>): Promise<IGroupUpdateResult>;
48 /**
49 * Set the owner of a group using a user id
50 * @param userId the id of the user that will be set as the owner of the current group
51 */
52 setUserAsOwner(userId: number): Promise<any>;
53}
54export interface ISiteGroup extends _SiteGroup {
55}
56export declare const SiteGroup: import("../spqueryable.js").ISPInvokableFactory<ISiteGroup>;
57/**
58 * Result from updating a group
59 *
60 */
61export interface IGroupUpdateResult {
62 group: ISiteGroup;
63 data: any;
64}
65/**
66 * Results from adding a group
67 *
68 */
69export interface IGroupAddResult {
70 group: ISiteGroup;
71 data: any;
72}
73export interface ISiteGroupInfo {
74 AllowMembersEditMembership: boolean;
75 AllowRequestToJoinLeave: boolean;
76 AutoAcceptRequestToJoinLeave: boolean;
77 Description: string;
78 Id: number;
79 IsHiddenInUI: boolean;
80 LoginName: string;
81 OnlyAllowMembersViewMembership: boolean;
82 OwnerTitle: string;
83 PrincipalType: number;
84 RequestToJoinLeaveEmailSetting: string | null;
85 Title: string;
86}
87//# sourceMappingURL=types.d.ts.map
\No newline at end of file