UNPKG

6.07 kBTypeScriptView Raw
1import { _SPInstance, SPInit } from "../spqueryable.js";
2import { IWeb } from "../webs/types.js";
3import { IChangeQuery } from "../types.js";
4export declare class _Site extends _SPInstance {
5 constructor(base: SPInit, path?: string);
6 /**
7 * Gets the root web of the site collection
8 *
9 */
10 get rootWeb(): IWeb;
11 /**
12 * Returns the collection of changes from the change log that have occurred within the list, based on the specified query
13 *
14 * @param query The change query
15 */
16 getChanges(query: IChangeQuery): Promise<any>;
17 /**
18 * Opens a web by id (using POST)
19 *
20 * @param webId The GUID id of the web to open
21 */
22 openWebById(webId: string): Promise<IOpenWebByIdResult>;
23 /**
24 * Gets a Web instance representing the root web of the site collection
25 * correctly setup for chaining within the library
26 */
27 getRootWeb(): Promise<IWeb>;
28 /**
29 * Gets the context information for this site collection
30 */
31 getContextInfo(): Promise<IContextInfo>;
32 /**
33 * Deletes the current site
34 *
35 */
36 delete(): Promise<void>;
37 /**
38 * Gets the document libraries on a site. Static method. (SharePoint Online only)
39 *
40 * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
41 */
42 getDocumentLibraries(absoluteWebUrl: string): Promise<IDocumentLibraryInformation[]>;
43 /**
44 * Gets the site url from a page url
45 *
46 * @param absolutePageUrl The absolute url of the page
47 */
48 getWebUrlFromPageUrl(absolutePageUrl: string): Promise<string>;
49 /**
50 * Creates a Modern communication site.
51 *
52 * @param title The title of the site to create
53 * @param lcid The language to use for the site. If not specified will default to 1033 (English).
54 * @param shareByEmailEnabled If set to true, it will enable sharing files via Email. By default it is set to false
55 * @param url The fully qualified URL (e.g. https://yourtenant.sharepoint.com/sites/mysitecollection) of the site.
56 * @param description The description of the communication site.
57 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
58 * @param siteDesignId The Guid of the site design to be used.
59 * You can use the below default OOTB GUIDs:
60 * Topic: 00000000-0000-0000-0000-000000000000
61 * Showcase: 6142d2a0-63a5-4ba0-aede-d9fefca2c767
62 * Blank: f6cc5403-0d63-442e-96c0-285923709ffc
63 * @param hubSiteId The id of the hub site to which the new site should be associated
64 * @param owner Optional owner value, required if executing the method in app only mode
65 */
66 createCommunicationSite(title: string, lcid: number, shareByEmailEnabled: boolean, url: string, description?: string, classification?: string, siteDesignId?: string, hubSiteId?: string, owner?: string): Promise<ISiteCreationResponse>;
67 createCommunicationSiteFromProps(props: ICreateCommSiteProps): Promise<ISiteCreationResponse>;
68 /**
69 *
70 * @param url Site Url that you want to check if exists
71 */
72 exists(url: string): Promise<boolean>;
73 /**
74 * Creates a Modern team site backed by Office 365 group. For use in SP Online only. This will not work with App-only tokens
75 *
76 * @param displayName The title or display name of the Modern team site to be created
77 * @param alias Alias of the underlying Office 365 Group
78 * @param isPublic Defines whether the Office 365 Group will be public (default), or private.
79 * @param lcid The language to use for the site. If not specified will default to English (1033).
80 * @param description The description of the site to be created.
81 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
82 * @param owners The Owners of the site to be created
83 */
84 createModernTeamSite(displayName: string, alias: string, isPublic?: boolean, lcid?: number, description?: string, classification?: string, owners?: string[], hubSiteId?: string, siteDesignId?: string): Promise<ISiteCreationResponse>;
85 createModernTeamSiteFromProps(props: ICreateTeamSiteProps): Promise<ISiteCreationResponse>;
86}
87export interface ISite extends _Site {
88}
89export declare const Site: import("../spqueryable.js").ISPInvokableFactory<ISite>;
90/**
91 * The result of opening a web by id: contains the data returned as well as a chainable web instance
92 */
93export interface IOpenWebByIdResult {
94 data: any;
95 web: IWeb;
96}
97/**
98 * This is the interface to expose data i.e. context information of a site
99 */
100export interface IContextInfo {
101 FormDigestTimeoutSeconds?: number;
102 FormDigestValue?: number;
103 LibraryVersion?: string;
104 SiteFullUrl?: string;
105 SupportedSchemaVersions?: string[];
106 WebFullUrl?: string;
107}
108/**
109 * This is the interface to expose data for Document Library
110 */
111export interface IDocumentLibraryInformation {
112 AbsoluteUrl?: string;
113 Modified?: Date;
114 ModifiedFriendlyDisplay?: string;
115 ServerRelativeUrl?: string;
116 Title?: string;
117}
118export interface ICreateCommSiteProps {
119 Classification?: string;
120 Description?: string;
121 HubSiteId?: string;
122 Lcid?: number;
123 Owner?: string;
124 ShareByEmailEnabled?: boolean;
125 SiteDesignId?: string;
126 Title: string;
127 Url: string;
128 WebTemplate?: "SITEPAGEPUBLISHING#0" | "STS#3";
129 WebTemplateExtensionId?: string;
130}
131export interface ICreateTeamSiteProps {
132 displayName: string;
133 alias: string;
134 isPublic?: boolean;
135 lcid?: number;
136 description?: string;
137 classification?: string;
138 owners?: string[];
139 hubSiteId?: string;
140 siteDesignId?: string;
141}
142export interface ISiteCreationResponse {
143 "SiteId": string;
144 "SiteStatus": 0 | 1 | 2 | 3;
145 "SiteUrl": string;
146}
147//# sourceMappingURL=types.d.ts.map
\No newline at end of file