UNPKG

3.16 kBTypeScriptView Raw
1import { _SPQueryable, ISPQueryable, _SPCollection, _SPInstance, ISPInstance } from "../spqueryable.js";
2export declare class _LimitedWebPartManager extends _SPQueryable implements ILimitedWebPartManager {
3 get scope(): ISPQueryable;
4 get webparts(): IWebPartDefinitions;
5 export(id: string): Promise<string>;
6 import(xml: string): Promise<any>;
7}
8export interface ILimitedWebPartManager {
9 /**
10 * Gets the scope of this web part manager (User = 0 or Shared = 1)
11 */
12 readonly scope: ISPQueryable;
13 /**
14 * Gets the set of web part definitions contained by this web part manager
15 */
16 readonly webparts: IWebPartDefinitions;
17 /**
18 * Exports a webpart definition
19 *
20 * @param id the GUID id of the definition to export
21 */
22 export(id: string): Promise<string>;
23 /**
24 * Imports a webpart
25 *
26 * @param xml webpart definition which must be valid XML in the .dwp or .webpart format
27 */
28 import(xml: string): Promise<any>;
29}
30export declare const LimitedWebPartManager: (baseUrl: string | ISPQueryable, path?: string) => ILimitedWebPartManager;
31export declare class _WebPartDefinitions extends _SPCollection {
32 /**
33 * Gets a web part definition from the collection by id
34 *
35 * @param id The storage ID of the SPWebPartDefinition to retrieve
36 */
37 getById(id: string): IWebPartDefinition;
38 /**
39 * Gets a web part definition from the collection by storage id
40 *
41 * @param id The WebPart.ID of the SPWebPartDefinition to retrieve
42 */
43 getByControlId(id: string): IWebPartDefinition;
44}
45export interface IWebPartDefinitions extends _WebPartDefinitions {
46}
47export declare const WebPartDefinitions: import("../spqueryable.js").ISPInvokableFactory<IWebPartDefinitions>;
48export declare class _WebPartDefinition extends _SPInstance {
49 /**
50 * Gets the webpart information associated with this definition
51 */
52 get webpart(): ISPInstance;
53 /**
54 * Saves changes to the Web Part made using other properties and methods on the SPWebPartDefinition object
55 */
56 saveChanges(): Promise<any>;
57 /**
58 * Moves the Web Part to a different location on a Web Part Page
59 *
60 * @param zoneId The ID of the Web Part Zone to which to move the Web Part
61 * @param zoneIndex A Web Part zone index that specifies the position at which the Web Part is to be moved within the destination Web Part zone
62 */
63 moveTo(zoneId: string, zoneIndex: number): Promise<void>;
64 /**
65 * Closes the Web Part. If the Web Part is already closed, this method does nothing
66 */
67 close(): Promise<void>;
68 /**
69 * Opens the Web Part. If the Web Part is already closed, this method does nothing
70 */
71 open(): Promise<void>;
72 /**
73 * Removes a webpart from a page, all settings will be lost
74 */
75 delete(): Promise<void>;
76}
77export interface IWebPartDefinition extends _WebPartDefinition {
78}
79export declare const WebPartDefinition: import("../spqueryable.js").ISPInvokableFactory<IWebPartDefinition>;
80export declare enum WebPartsPersonalizationScope {
81 User = 0,
82 Shared = 1
83}
84//# sourceMappingURL=types.d.ts.map
\No newline at end of file