UNPKG

5.64 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 * Deletes the current site
30 *
31 */
32 delete(): Promise<void>;
33 /**
34 * Gets the document libraries on a site. Static method. (SharePoint Online only)
35 *
36 * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
37 */
38 getDocumentLibraries(absoluteWebUrl: string): Promise<IDocumentLibraryInformation[]>;
39 /**
40 * Gets the site url from a page url
41 *
42 * @param absolutePageUrl The absolute url of the page
43 */
44 getWebUrlFromPageUrl(absolutePageUrl: string): Promise<string>;
45 /**
46 * Creates a Modern communication site.
47 *
48 * @param title The title of the site to create
49 * @param lcid The language to use for the site. If not specified will default to 1033 (English).
50 * @param shareByEmailEnabled If set to true, it will enable sharing files via Email. By default it is set to false
51 * @param url The fully qualified URL (e.g. https://yourtenant.sharepoint.com/sites/mysitecollection) of the site.
52 * @param description The description of the communication site.
53 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
54 * @param siteDesignId The Guid of the site design to be used.
55 * You can use the below default OOTB GUIDs:
56 * Topic: 00000000-0000-0000-0000-000000000000
57 * Showcase: 6142d2a0-63a5-4ba0-aede-d9fefca2c767
58 * Blank: f6cc5403-0d63-442e-96c0-285923709ffc
59 * @param hubSiteId The id of the hub site to which the new site should be associated
60 * @param owner Optional owner value, required if executing the method in app only mode
61 */
62 createCommunicationSite(title: string, lcid: number, shareByEmailEnabled: boolean, url: string, description?: string, classification?: string, siteDesignId?: string, hubSiteId?: string, owner?: string): Promise<ISiteCreationResponse>;
63 createCommunicationSiteFromProps(props: ICreateCommSiteProps): Promise<ISiteCreationResponse>;
64 /**
65 *
66 * @param url Site Url that you want to check if exists
67 */
68 exists(url: string): Promise<boolean>;
69 /**
70 * Creates a Modern team site backed by Office 365 group. For use in SP Online only. This will not work with App-only tokens
71 *
72 * @param displayName The title or display name of the Modern team site to be created
73 * @param alias Alias of the underlying Office 365 Group
74 * @param isPublic Defines whether the Office 365 Group will be public (default), or private.
75 * @param lcid The language to use for the site. If not specified will default to English (1033).
76 * @param description The description of the site to be created.
77 * @param classification The Site classification to use. For instance 'Contoso Classified'. See https://www.youtube.com/watch?v=E-8Z2ggHcS0 for more information
78 * @param owners The Owners of the site to be created
79 */
80 createModernTeamSite(displayName: string, alias: string, isPublic?: boolean, lcid?: number, description?: string, classification?: string, owners?: string[], hubSiteId?: string, siteDesignId?: string): Promise<ISiteCreationResponse>;
81 createModernTeamSiteFromProps(props: ICreateTeamSiteProps): Promise<ISiteCreationResponse>;
82}
83export interface ISite extends _Site {
84}
85export declare const Site: import("../spqueryable.js").ISPInvokableFactory<ISite>;
86/**
87 * The result of opening a web by id: contains the data returned as well as a chainable web instance
88 */
89export interface IOpenWebByIdResult {
90 data: any;
91 web: IWeb;
92}
93/**
94 * This is the interface to expose data for Document Library
95 */
96export interface IDocumentLibraryInformation {
97 AbsoluteUrl?: string;
98 Modified?: Date;
99 ModifiedFriendlyDisplay?: string;
100 ServerRelativeUrl?: string;
101 Title?: string;
102}
103export interface ICreateCommSiteProps {
104 Classification?: string;
105 Description?: string;
106 HubSiteId?: string;
107 Lcid?: number;
108 Owner?: string;
109 ShareByEmailEnabled?: boolean;
110 SiteDesignId?: string;
111 Title: string;
112 Url: string;
113 WebTemplate?: "SITEPAGEPUBLISHING#0" | "STS#3";
114 WebTemplateExtensionId?: string;
115}
116export interface ICreateTeamSiteProps {
117 displayName: string;
118 alias: string;
119 isPublic?: boolean;
120 lcid?: number;
121 description?: string;
122 classification?: string;
123 owners?: string[];
124 hubSiteId?: string;
125 siteDesignId?: string;
126}
127export interface ISiteCreationResponse {
128 "SiteId": string;
129 "SiteStatus": 0 | 1 | 2 | 3;
130 "SiteUrl": string;
131}
132//# sourceMappingURL=types.d.ts.map
\No newline at end of file