declare module "collections/collections" { /** * Interface defining an object with a known property type */ export interface TypedHash { [key: string]: T; } /** * Generic dictionary */ export class Dictionary { private keys; private values; /** * Creates a new instance of the Dictionary class * * @constructor */ constructor(keys?: string[], values?: T[]); /** * Gets a value from the collection using the specified key * * @param key The key whose value we want to return, returns null if the key does not exist */ get(key: string): T; /** * Adds the supplied key and value to the dictionary * * @param key The key to add * @param o The value to add */ add(key: string, o: T): void; /** * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate. */ merge(source: TypedHash | Dictionary): void; /** * Removes a value from the dictionary * * @param key The key of the key/value pair to remove. Returns null if the key was not found. */ remove(key: string): T; /** * Returns all the keys currently in the dictionary as an array */ getKeys(): string[]; /** * Returns all the values currently in the dictionary as an array */ getValues(): T[]; /** * Clears the current dictionary */ clear(): void; /** * Gets a count of the items currently in the dictionary */ count(): number; } } declare module "utils/logging" { /** * A set of logging levels * */ export enum LogLevel { Verbose = 0, Info = 1, Warning = 2, Error = 3, Off = 99, } /** * Interface that defines a log entry * */ export interface LogEntry { /** * The main message to be logged */ message: string; /** * The level of information this message represents */ level: LogLevel; /** * Any associated data that a given logging listener may choose to log or ignore */ data?: any; } /** * Interface that defines a log listner * */ export interface LogListener { /** * Any associated data that a given logging listener may choose to log or ignore * * @param entry The information to be logged */ log(entry: LogEntry): void; } /** * Class used to subscribe ILogListener and log messages throughout an application * */ export class Logger { private static _instance; static activeLogLevel: LogLevel; private static readonly instance; /** * Adds ILogListener instances to the set of subscribed listeners * * @param listeners One or more listeners to subscribe to this log */ static subscribe(...listeners: LogListener[]): void; /** * Clears the subscribers collection, returning the collection before modifiction */ static clearSubscribers(): LogListener[]; /** * Gets the current subscriber count */ static readonly count: number; /** * Writes the supplied string to the subscribed listeners * * @param message The message to write * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) */ static write(message: string, level?: LogLevel): void; /** * Writes the supplied string to the subscribed listeners * * @param json The json object to stringify and write * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) */ static writeJSON(json: any, level?: LogLevel): void; /** * Logs the supplied entry to the subscribed listeners * * @param entry The message to log */ static log(entry: LogEntry): void; /** * Logs performance tracking data for the the execution duration of the supplied function using console.profile * * @param name The name of this profile boundary * @param f The function to execute and track within this performance boundary */ static measure(name: string, f: () => T): T; } /** * Implementation of ILogListener which logs to the browser console * */ export class ConsoleListener implements LogListener { /** * Any associated data that a given logging listener may choose to log or ignore * * @param entry The information to be logged */ log(entry: LogEntry): void; /** * Formats the message * * @param entry The information to format into a string */ private format(entry); } /** * Implementation of ILogListener which logs to the supplied function * */ export class FunctionListener implements LogListener { private method; /** * Creates a new instance of the FunctionListener class * * @constructor * @param method The method to which any logging data will be passed */ constructor(method: (entry: LogEntry) => void); /** * Any associated data that a given logging listener may choose to log or ignore * * @param entry The information to be logged */ log(entry: LogEntry): void; } } declare module "utils/exceptions" { /** * Represents an exception with an HttpClient request * */ export class ProcessHttpClientResponseException extends Error { readonly status: number; readonly statusText: string; readonly data: any; constructor(status: number, statusText: string, data: any); } export class NoCacheAvailableException extends Error { constructor(msg?: string); } export class APIUrlException extends Error { constructor(msg?: string); } export class AuthUrlException extends Error { constructor(data: any, msg?: string); } export class NodeFetchClientUnsupportedException extends Error { constructor(msg?: string); } export class SPRequestExecutorUndefinedException extends Error { constructor(); } export class MaxCommentLengthException extends Error { constructor(msg?: string); } export class NotSupportedInBatchException extends Error { constructor(operation?: string); } export class ODataIdException extends Error { constructor(data: any, msg?: string); } export class BatchParseException extends Error { constructor(msg: string); } export class AlreadyInBatchException extends Error { constructor(msg?: string); } export class FunctionExpectedException extends Error { constructor(msg?: string); } export class UrlException extends Error { constructor(msg: string); } } declare module "odata/core" { export interface ODataParser { hydrate?: (d: any) => T; parse(r: Response): Promise; } export abstract class ODataParserBase implements ODataParser { parse(r: Response): Promise; protected parseImpl(r: Response, resolve: (value?: T | PromiseLike) => void, reject: (value?: T | PromiseLike) => void): void; protected handleError(r: Response, reject: (reason?: any) => void): boolean; protected parseODataJSON(json: any): U; } } declare module "odata/parsers" { import { ODataParser, ODataParserBase } from "odata/core"; export class ODataDefaultParser extends ODataParserBase { } export function ODataValue(): ODataParser; export class ODataRawParserImpl extends ODataParserBase { protected parseImpl(r: Response, resolve: (value: any) => void): void; } export let ODataRaw: ODataRawParserImpl; export class TextFileParser extends ODataParserBase { protected parseImpl(r: Response, resolve: (value: any) => void): void; } export class BlobFileParser extends ODataParserBase { protected parseImpl(r: Response, resolve: (value: any) => void): void; } export class JSONFileParser extends ODataParserBase { protected parseImpl(r: Response, resolve: (value: any) => void): void; } export class BufferFileParser extends ODataParserBase { protected parseImpl(r: Response, resolve: (value: any) => void): void; } } declare module "net/digestcache" { import { Dictionary } from "collections/collections"; import { HttpClient } from "net/httpclient"; export class CachedDigest { expiration: Date; value: string; } export class DigestCache { private _httpClient; private _digests; constructor(_httpClient: HttpClient, _digests?: Dictionary); getDigest(webUrl: string): Promise; clear(): void; } } declare module "net/utils" { export interface ConfigOptions { headers?: string[][] | { [key: string]: string; }; mode?: "navigate" | "same-origin" | "no-cors" | "cors"; credentials?: "omit" | "same-origin" | "include"; cache?: "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached"; } export interface FetchOptions extends ConfigOptions { method?: string; body?: any; } export function mergeOptions(target: ConfigOptions, source: ConfigOptions): void; export function mergeHeaders(target: Headers, source: any): void; } declare module "request/requestclient" { import { FetchOptions } from "net/utils"; export interface RequestClient { fetch(url: string, options?: FetchOptions): Promise; fetchRaw(url: string, options?: FetchOptions): Promise; get(url: string, options?: FetchOptions): Promise; post(url: string, options?: FetchOptions): Promise; patch(url: string, options?: FetchOptions): Promise; delete(url: string, options?: FetchOptions): Promise; } } declare module "net/httpclient" { import { FetchOptions } from "net/utils"; import { RequestClient } from "request/requestclient"; export interface HttpClientImpl { fetch(url: string, options: FetchOptions): Promise; } export class HttpClient implements RequestClient { private _digestCache; private _impl; constructor(); fetch(url: string, options?: FetchOptions): Promise; fetchRaw(url: string, options?: FetchOptions): Promise; get(url: string, options?: FetchOptions): Promise; post(url: string, options?: FetchOptions): Promise; patch(url: string, options?: FetchOptions): Promise; delete(url: string, options?: FetchOptions): Promise; } } declare module "net/fetchclient" { import { HttpClientImpl } from "net/httpclient"; /** * Makes requests using the fetch API */ export class FetchClient implements HttpClientImpl { fetch(url: string, options: any): Promise; } } declare module "configuration/spfxContextInterface" { export interface SPFXContext { graphHttpClient: { fetch(url: string, configuration: any, options: any): Promise; }; pageContext: { web: { absoluteUrl: string; }; }; } } declare module "net/graphclient" { import { FetchOptions } from "net/utils"; import { RequestClient } from "request/requestclient"; export class GraphHttpClient implements RequestClient { private _impl; constructor(); fetch(url: string, options?: FetchOptions): Promise; fetchRaw(url: string, options?: FetchOptions): Promise; get(url: string, options?: FetchOptions): Promise; post(url: string, options?: FetchOptions): Promise; patch(url: string, options?: FetchOptions): Promise; delete(url: string, options?: FetchOptions): Promise; } export interface GraphHttpClientImpl { fetch(url: string, configuration: any, options: FetchOptions): Promise; } } declare module "configuration/pnplibconfig" { import { TypedHash } from "collections/collections"; import { HttpClientImpl } from "net/httpclient"; import { SPFXContext } from "configuration/spfxContextInterface"; import { GraphHttpClientImpl } from "net/graphclient"; export interface LibraryConfiguration { /** * Allows caching to be global disabled, default: false */ globalCacheDisable?: boolean; /** * Defines the default store used by the usingCaching method, default: session */ defaultCachingStore?: "session" | "local"; /** * Defines the default timeout in seconds used by the usingCaching method, default 30 */ defaultCachingTimeoutSeconds?: number; /** * If true a timeout expired items will be removed from the cache in intervals determined by cacheTimeoutInterval */ enableCacheExpiration?: boolean; /** * Determines the interval in milliseconds at which the cache is checked to see if items have expired (min: 100) */ cacheExpirationIntervalMilliseconds?: number; /** * SharePoint specific library settings */ sp?: { /** * Any headers to apply to all requests */ headers?: TypedHash; /** * Defines a factory method used to create fetch clients */ fetchClientFactory?: () => HttpClientImpl; /** * The base url used for all requests */ baseUrl?: string; }; /** * MS Graph specific library settings */ graph?: { /** * Any headers to apply to all requests */ headers?: TypedHash; /** * Defines a factory method used to create fetch clients */ fetchClientFactory?: () => GraphHttpClientImpl; }; /** * Used to supply the current context from an SPFx webpart to the library */ spfxContext?: any; } export class RuntimeConfigImpl { private _defaultCachingStore; private _defaultCachingTimeoutSeconds; private _globalCacheDisable; private _enableCacheExpiration; private _cacheExpirationIntervalMilliseconds; private _spfxContext; private _spFetchClientFactory; private _spBaseUrl; private _spHeaders; private _graphHeaders; private _graphFetchClientFactory; constructor(); set(config: LibraryConfiguration): void; readonly defaultCachingStore: "session" | "local"; readonly defaultCachingTimeoutSeconds: number; readonly globalCacheDisable: boolean; readonly spFetchClientFactory: () => HttpClientImpl; readonly spBaseUrl: string; readonly spHeaders: TypedHash; readonly enableCacheExpiration: boolean; readonly cacheExpirationIntervalMilliseconds: number; readonly spfxContext: SPFXContext; readonly graphFetchClientFactory: () => GraphHttpClientImpl; readonly graphHeaders: TypedHash; } export let RuntimeConfig: RuntimeConfigImpl; export function setRuntimeConfig(config: LibraryConfiguration): void; } declare module "utils/util" { import { TypedHash } from "collections/collections"; export function extractWebUrl(candidateUrl: string): string; export class Util { /** * Gets a callback function which will maintain context across async calls. * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...) * * @param context The object that will be the 'this' value in the callback * @param method The method to which we will apply the context and parameters * @param params Optional, additional arguments to supply to the wrapped method when it is invoked */ static getCtxCallback(context: any, method: Function, ...params: any[]): Function; /** * Tests if a url param exists * * @param name The name of the url paramter to check */ static urlParamExists(name: string): boolean; /** * Gets a url param value by name * * @param name The name of the paramter for which we want the value */ static getUrlParamByName(name: string): string; /** * Gets a url param by name and attempts to parse a bool value * * @param name The name of the paramter for which we want the boolean value */ static getUrlParamBoolByName(name: string): boolean; /** * Inserts the string s into the string target as the index specified by index * * @param target The string into which we will insert s * @param index The location in target to insert s (zero based) * @param s The string to insert into target at position index */ static stringInsert(target: string, index: number, s: string): string; /** * Adds a value to a date * * @param date The date to which we will add units, done in local time * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second'] * @param units The amount to add to date of the given interval * * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object */ static dateAdd(date: Date, interval: string, units: number): Date; /** * Loads a stylesheet into the current page * * @param path The url to the stylesheet * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues */ static loadStylesheet(path: string, avoidCache: boolean): void; /** * Combines an arbitrary set of paths ensuring that the slashes are normalized * * @param paths 0 to n path parts to combine */ static combinePaths(...paths: string[]): string; /** * Gets a random string of chars length * * @param chars The length of the random string to generate */ static getRandomString(chars: number): string; /** * Gets a random GUID value * * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript */ static getGUID(): string; /** * Determines if a given value is a function * * @param candidateFunction The thing to test for being a function */ static isFunction(candidateFunction: any): boolean; /** * @returns whether the provided parameter is a JavaScript Array or not. */ static isArray(array: any): boolean; /** * Determines if a string is null or empty or undefined * * @param s The string to test */ static stringIsNullOrEmpty(s: string): boolean; /** * Provides functionality to extend the given object by doing a shallow copy * * @param target The object to which properties will be copied * @param source The source object from which properties will be copied * @param noOverwrite If true existing properties on the target are not overwritten from the source * */ static extend(target: any, source: TypedHash, noOverwrite?: boolean): any; /** * Determines if a given url is absolute * * @param url The url to check to see if it is absolute */ static isUrlAbsolute(url: string): boolean; /** * Ensures that a given url is absolute for the current web based on context * * @param candidateUrl The url to make absolute * */ static toAbsoluteUrl(candidateUrl: string): Promise; } } declare module "utils/storage" { /** * A wrapper class to provide a consistent interface to browser based storage * */ export class PnPClientStorageWrapper implements PnPClientStore { private store; defaultTimeoutMinutes: number; /** * True if the wrapped storage is available; otherwise, false */ enabled: boolean; /** * Creates a new instance of the PnPClientStorageWrapper class * * @constructor */ constructor(store: Storage, defaultTimeoutMinutes?: number); /** * Get a value from storage, or null if that value does not exist * * @param key The key whose value we want to retrieve */ get(key: string): T; /** * Adds a value to the underlying storage * * @param key The key to use when storing the provided value * @param o The value to store * @param expire Optional, if provided the expiration of the item, otherwise the default is used */ put(key: string, o: any, expire?: Date): void; /** * Deletes a value from the underlying storage * * @param key The key of the pair we want to remove from storage */ delete(key: string): void; /** * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function * * @param key The key to use when storing the provided value * @param getter A function which will upon execution provide the desired value * @param expire Optional, if provided the expiration of the item, otherwise the default is used */ getOrPut(key: string, getter: () => Promise, expire?: Date): Promise; /** * Deletes any expired items placed in the store by the pnp library, leaves other items untouched */ deleteExpired(): Promise; /** * Used to determine if the wrapped storage is available currently */ private test(); /** * Creates the persistable to store */ private createPersistable(o, expire?); /** * Deletes expired items added by this library in this.store and sets a timeout to call itself */ private cacheExpirationHandler(); } /** * Interface which defines the operations provided by a client storage object */ export interface PnPClientStore { /** * True if the wrapped storage is available; otherwise, false */ enabled: boolean; /** * Get a value from storage, or null if that value does not exist * * @param key The key whose value we want to retrieve */ get(key: string): any; /** * Adds a value to the underlying storage * * @param key The key to use when storing the provided value * @param o The value to store * @param expire Optional, if provided the expiration of the item, otherwise the default is used */ put(key: string, o: any, expire?: Date): void; /** * Deletes a value from the underlying storage * * @param key The key of the pair we want to remove from storage */ delete(key: string): void; /** * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function * * @param key The key to use when storing the provided value * @param getter A function which will upon execution provide the desired value * @param expire Optional, if provided the expiration of the item, otherwise the default is used */ getOrPut(key: string, getter: Function, expire?: Date): any; /** * Removes any expired items placed in the store by the pnp library, leaves other items untouched */ deleteExpired(): Promise; } /** * A class that will establish wrappers for both local and session storage */ export class PnPClientStorage { private _local; private _session; /** * Creates a new instance of the PnPClientStorage class * * @constructor */ constructor(_local?: PnPClientStore, _session?: PnPClientStore); /** * Provides access to the local storage of the browser */ readonly local: PnPClientStore; /** * Provides access to the session storage of the browser */ readonly session: PnPClientStore; } } declare module "configuration/configuration" { import { TypedHash } from "collections/collections"; /** * Interface for configuration providers * */ export interface IConfigurationProvider { /** * Gets the configuration from the provider */ getConfiguration(): Promise>; } /** * Class used to manage the current application settings * */ export class Settings { /** * The settings currently stored in this instance */ private _settings; /** * Creates a new instance of the settings class * * @constructor */ constructor(); /** * Adds a new single setting, or overwrites a previous setting with the same key * * @param {string} key The key used to store this setting * @param {string} value The setting value to store */ add(key: string, value: string): void; /** * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read * * @param {string} key The key used to store this setting * @param {any} value The setting value to store */ addJSON(key: string, value: any): void; /** * Applies the supplied hash to the setting collection overwriting any existing value, or created new values * * @param {TypedHash} hash The set of values to add */ apply(hash: TypedHash): Promise; /** * Loads configuration settings into the collection from the supplied provider and returns a Promise * * @param {IConfigurationProvider} provider The provider from which we will load the settings */ load(provider: IConfigurationProvider): Promise; /** * Gets a value from the configuration * * @param {string} key The key whose value we want to return. Returns null if the key does not exist * @return {string} string value from the configuration */ get(key: string): string; /** * Gets a JSON value, rehydrating the stored string to the original object * * @param {string} key The key whose value we want to return. Returns null if the key does not exist * @return {any} object from the configuration */ getJSON(key: string): any; } } declare module "sharepoint/batch" { import { ODataParser } from "odata/core"; /** * Manages a batch of OData operations */ export class ODataBatch { private baseUrl; private _batchId; private _dependencies; private _requests; /** * Parses the response from a batch request into an array of Response instances * * @param body Text body of the response from the batch request */ static ParseResponse(body: string): Promise; constructor(baseUrl: string, _batchId?: string); readonly batchId: string; /** * Adds a request to a batch (not designed for public use) * * @param url The full url of the request * @param method The http method GET, POST, etc * @param options Any options to include in the request * @param parser The parser that will hadle the results of the request */ add(url: string, method: string, options: any, parser: ODataParser): Promise; /** * Adds a dependency insuring that some set of actions will occur before a batch is processed. * MUST be cleared using the returned resolve delegate to allow batches to run */ addDependency(): () => void; /** * Execute the current batch and resolve the associated promises * * @returns A promise which will be resolved once all of the batch's child promises have resolved */ execute(): Promise; private executeImpl(); } } declare module "odata/caching" { import { ODataParser } from "odata/core"; import { PnPClientStore, PnPClientStorage } from "utils/storage"; export interface ICachingOptions { expiration?: Date; storeName?: "session" | "local"; key: string; } export class CachingOptions implements ICachingOptions { key: string; protected static storage: PnPClientStorage; expiration: Date; storeName: "session" | "local"; constructor(key: string); readonly store: PnPClientStore; } export class CachingParserWrapper implements ODataParser { private _parser; private _cacheOptions; constructor(_parser: ODataParser, _cacheOptions: CachingOptions); parse(response: Response): Promise; } } declare module "request/pipeline" { import { ODataParser } from "odata/core"; import { ODataBatch } from "sharepoint/batch"; import { ICachingOptions } from "odata/caching"; import { FetchOptions } from "net/utils"; import { RequestClient } from "request/requestclient"; /** * Defines the context for a given request to be processed in the pipeline */ export interface RequestContext { batch: ODataBatch; batchDependency: () => void; cachingOptions: ICachingOptions; hasResult?: boolean; isBatched: boolean; isCached: boolean; options: FetchOptions; parser: ODataParser; pipeline?: Array<(c: RequestContext) => Promise>>; requestAbsoluteUrl: string; requestId: string; result?: T; verb: string; clientFactory: () => RequestClient; } /** * Sets the result on the context */ export function setResult(context: RequestContext, value: any): Promise>; /** * Executes the current request context's pipeline * * @param context Current context */ export function pipe(context: RequestContext): Promise; /** * decorator factory applied to methods in the pipeline to control behavior */ export function requestPipelineMethod(alwaysRun?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; /** * Contains the methods used within the request pipeline */ export class PipelineMethods { /** * Logs the start of the request */ static logStart(context: RequestContext): Promise>; /** * Handles caching of the request */ static caching(context: RequestContext): Promise>; /** * Sends the request */ static send(context: RequestContext): Promise>; /** * Logs the end of the request */ static logEnd(context: RequestContext): Promise>; static readonly default: ((context: RequestContext) => Promise>)[]; } } declare module "odata/queryable" { import { Dictionary } from "collections/collections"; import { FetchOptions, ConfigOptions } from "net/utils"; import { ODataParser } from "odata/core"; import { ICachingOptions } from "odata/caching"; import { RequestContext } from "request/pipeline"; export abstract class ODataQueryable { /** * Additional options to be set before sending actual http request */ protected _options: ConfigOptions; /** * Tracks the query parts of the url */ protected _query: Dictionary; /** * Tracks the url as it is built */ protected _url: string; /** * Stores the parent url used to create this instance, for recursing back up the tree if needed */ protected _parentUrl: string; /** * Explicitly tracks if we are using caching for this request */ protected _useCaching: boolean; /** * Any options that were supplied when caching was enabled */ protected _cachingOptions: ICachingOptions; /** * Directly concatonates the supplied string to the current url, not normalizing "/" chars * * @param pathPart The string to concatonate to the url */ concat(pathPart: string): this; /** * Appends the given string and normalizes "/" chars * * @param pathPart The string to append */ protected append(pathPart: string): void; /** * Gets the parent url used when creating this instance * */ protected readonly parentUrl: string; /** * Provides access to the query builder for this url * */ readonly query: Dictionary; /** * Sets custom options for current object and all derived objects accessible via chaining * * @param options custom options */ configure(options: ConfigOptions): this; /** * Enables caching for this request * * @param options Defines the options used when caching this request */ usingCaching(options?: ICachingOptions): this; /** * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object * */ toUrl(): string; /** * Gets the full url with query information * */ abstract toUrlAndQuery(): string; /** * Executes the currently built request * * @param parser Allows you to specify a parser to handle the result * @param getOptions The options used for this request */ get(parser?: ODataParser, options?: FetchOptions): Promise; getAs(parser?: ODataParser, options?: FetchOptions): Promise; protected postCore(options?: FetchOptions, parser?: ODataParser): Promise; protected postAsCore(options?: FetchOptions, parser?: ODataParser): Promise; protected patchCore(options?: FetchOptions, parser?: ODataParser): Promise; protected deleteCore(options?: FetchOptions, parser?: ODataParser): Promise; /** * Converts the current instance to a request context * * @param verb The request verb * @param options The set of supplied request options * @param parser The supplied ODataParser instance * @param pipeline Optional request processing pipeline */ protected abstract toRequestContext(verb: string, options: FetchOptions, parser: ODataParser, pipeline: Array<(c: RequestContext) => Promise>>): Promise>; } } declare module "sharepoint/sharepointqueryable" { import { FetchOptions } from "net/utils"; import { ODataParser } from "odata/core"; import { ODataBatch } from "sharepoint/batch"; import { ODataQueryable } from "odata/queryable"; import { RequestContext } from "request/pipeline"; export interface SharePointQueryableConstructor { new (baseUrl: string | SharePointQueryable, path?: string): T; } /** * SharePointQueryable Base Class * */ export class SharePointQueryable extends ODataQueryable { /** * Tracks the batch of which this query may be part */ private _batch; /** * Blocks a batch call from occuring, MUST be cleared by calling the returned function */ protected addBatchDependency(): () => void; /** * Indicates if the current query has a batch associated * */ protected readonly hasBatch: boolean; /** * The batch currently associated with this query or null * */ protected readonly batch: ODataBatch; /** * Creates a new instance of the SharePointQueryable class * * @constructor * @param baseUrl A string or SharePointQueryable that should form the base part of the url * */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Creates a new instance of the supplied factory and extends this into that new instance * * @param factory constructor for the new SharePointQueryable */ as(factory: SharePointQueryableConstructor): T; /** * Adds this query to the supplied batch * * @example * ``` * * let b = pnp.sp.createBatch(); * pnp.sp.web.inBatch(b).get().then(...); * b.execute().then(...) * ``` */ inBatch(batch: ODataBatch): this; /** * Gets the full url with query information * */ toUrlAndQuery(): string; /** * Gets a parent for this instance as specified * * @param factory The contructor for the class to create */ protected getParent(factory: SharePointQueryableConstructor, baseUrl?: string | SharePointQueryable, path?: string, batch?: ODataBatch): T; /** * Clones this SharePointQueryable into a new SharePointQueryable instance of T * @param factory Constructor used to create the new instance * @param additionalPath Any additional path to include in the clone * @param includeBatch If true this instance's batch will be added to the cloned instance */ protected clone(factory: SharePointQueryableConstructor, additionalPath?: string, includeBatch?: boolean): T; /** * Converts the current instance to a request context * * @param verb The request verb * @param options The set of supplied request options * @param parser The supplied ODataParser instance * @param pipeline Optional request processing pipeline */ protected toRequestContext(verb: string, options: FetchOptions, parser: ODataParser, pipeline?: Array<(c: RequestContext) => Promise>>): Promise>; } /** * Represents a REST collection which can be filtered, paged, and selected * */ export class SharePointQueryableCollection extends SharePointQueryable { /** * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported) * * @param filter The string representing the filter query */ filter(filter: string): this; /** * Choose which fields to return * * @param selects One or more fields to return */ select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ expand(...expands: string[]): this; /** * Orders based on the supplied fields ascending * * @param orderby The name of the field to sort on * @param ascending If false DESC is appended, otherwise ASC (default) */ orderBy(orderBy: string, ascending?: boolean): this; /** * Skips the specified number of items * * @param skip The number of items to skip */ skip(skip: number): this; /** * Limits the query to only return the specified number of items * * @param top The query row limit */ top(top: number): this; } /** * Represents an instance that can be selected * */ export class SharePointQueryableInstance extends SharePointQueryable { /** * Choose which fields to return * * @param selects One or more fields to return */ select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ expand(...expands: string[]): this; } } declare module "sharepoint/search" { import { SharePointQueryable, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { Dictionary } from "collections/collections"; /** * Allows for the fluent construction of search queries */ export class SearchQueryBuilder { private _query; static create(queryText?: string, queryTemplate?: SearchQuery): SearchQueryBuilder; constructor(queryText?: string, _query?: {}); text(queryText: string): this; template(template: string): this; sourceId(id: string): this; readonly enableInterleaving: this; readonly enableStemming: this; readonly trimDuplicates: this; trimDuplicatesIncludeId(n: number): this; readonly enableNicknames: this; readonly enableFql: this; readonly enablePhonetic: this; readonly bypassResultTypes: this; readonly processBestBets: this; readonly enableQueryRules: this; readonly enableSorting: this; readonly generateBlockRankLog: this; rankingModelId(id: string): this; startRow(n: number): this; rowLimit(n: number): this; rowsPerPage(n: number): this; selectProperties(...properties: string[]): this; culture(culture: number): this; timeZoneId(id: number): this; refinementFilters(...filters: string[]): this; refiners(refiners: string): this; hiddenConstraints(constraints: string): this; sortList(...sorts: Sort[]): this; timeout(milliseconds: number): this; hithighlightedProperties(...properties: string[]): this; clientType(clientType: string): this; personalizationData(data: string): this; resultsURL(url: string): this; queryTag(...tags: string[]): this; properties(...properties: SearchProperty[]): this; readonly processPersonalFavorites: this; queryTemplatePropertiesUrl(url: string): this; reorderingRules(...rules: ReorderingRule[]): this; hitHighlightedMultivaluePropertyLimit(limit: number): this; readonly enableOrderingHitHighlightedProperty: this; collapseSpecification(spec: string): this; uiLanguage(lang: number): this; desiredSnippetLength(len: number): this; maxSnippetLength(len: number): this; summaryLength(len: number): this; toSearchQuery(): SearchQuery; private extendQuery(part); } /** * Describes the search API * */ export class Search extends SharePointQueryableInstance { /** * Creates a new instance of the Search class * * @param baseUrl The url for the search context * @param query The SearchQuery object to execute */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * ....... * @returns Promise */ execute(query: SearchQuery): Promise; /** * Fixes up properties that expect to consist of a "results" collection when needed * * @param prop property to fixup for container struct */ private fixupProp(prop); } /** * Describes the SearchResults class, which returns the formatted and raw version of the query response */ export class SearchResults { private _url; private _query; private _raw; private _primary; /** * Creates a new instance of the SearchResult class * */ constructor(rawResponse: any, _url: string, _query: SearchQuery, _raw?: SearchResponse, _primary?: SearchResult[]); readonly ElapsedTime: number; readonly RowCount: number; readonly TotalRows: number; readonly TotalRowsIncludingDuplicates: number; readonly RawSearchResults: SearchResponse; readonly PrimarySearchResults: SearchResult[]; /** * Gets a page of results * * @param pageNumber Index of the page to return. Used to determine StartRow * @param pageSize Optional, items per page (default = 10) */ getPage(pageNumber: number, pageSize?: number): Promise; /** * Formats a search results array * * @param rawResults The array to process */ protected formatSearchResults(rawResults: any): SearchResult[]; } /** * Describes the SearchQuery interface */ export interface SearchQuery { /** * A string that contains the text for the search query. */ Querytext?: string; /** * A string that contains the text that replaces the query text, as part of a query transform. */ QueryTemplate?: string; /** * A Boolean value that specifies whether the result tables that are returned for * the result block are mixed with the result tables that are returned for the original query. */ EnableInterleaving?: boolean; /** * A Boolean value that specifies whether stemming is enabled. */ EnableStemming?: boolean; /** * A Boolean value that specifies whether duplicate items are removed from the results. */ TrimDuplicates?: boolean; /** * A Boolean value that specifies whether the exact terms in the search query are used to find matches, or if nicknames are used also. */ EnableNicknames?: boolean; /** * A Boolean value that specifies whether the query uses the FAST Query Language (FQL). */ EnableFQL?: boolean; /** * A Boolean value that specifies whether the phonetic forms of the query terms are used to find matches. */ EnablePhonetic?: boolean; /** * A Boolean value that specifies whether to perform result type processing for the query. */ BypassResultTypes?: boolean; /** * A Boolean value that specifies whether to return best bet results for the query. * This parameter is used only when EnableQueryRules is set to true, otherwise it is ignored. */ ProcessBestBets?: boolean; /** * A Boolean value that specifies whether to enable query rules for the query. */ EnableQueryRules?: boolean; /** * A Boolean value that specifies whether to sort search results. */ EnableSorting?: boolean; /** * Specifies whether to return block rank log information in the BlockRankLog property of the interleaved result table. * A block rank log contains the textual information on the block score and the documents that were de-duplicated. */ GenerateBlockRankLog?: boolean; /** * The result source ID to use for executing the search query. */ SourceId?: string; /** * The ID of the ranking model to use for the query. */ RankingModelId?: string; /** * The first row that is included in the search results that are returned. * You use this parameter when you want to implement paging for search results. */ StartRow?: number; /** * The maximum number of rows overall that are returned in the search results. * Compared to RowsPerPage, RowLimit is the maximum number of rows returned overall. */ RowLimit?: number; /** * The maximum number of rows to return per page. * Compared to RowLimit, RowsPerPage refers to the maximum number of rows to return per page, * and is used primarily when you want to implement paging for search results. */ RowsPerPage?: number; /** * The managed properties to return in the search results. */ SelectProperties?: string[]; /** * The locale ID (LCID) for the query. */ Culture?: number; /** * The set of refinement filters used when issuing a refinement query (FQL) */ RefinementFilters?: string[]; /** * The set of refiners to return in a search result. */ Refiners?: string; /** * The additional query terms to append to the query. */ HiddenConstraints?: string; /** * The list of properties by which the search results are ordered. */ SortList?: Sort[]; /** * The amount of time in milliseconds before the query request times out. */ Timeout?: number; /** * The properties to highlight in the search result summary when the property value matches the search terms entered by the user. */ HitHighlightedProperties?: string[]; /** * The type of the client that issued the query. */ ClientType?: string; /** * The GUID for the user who submitted the search query. */ PersonalizationData?: string; /** * The URL for the search results page. */ ResultsUrl?: string; /** * Custom tags that identify the query. You can specify multiple query tags */ QueryTag?: string[]; /** * Properties to be used to configure the search query */ Properties?: SearchProperty[]; /** * A Boolean value that specifies whether to return personal favorites with the search results. */ ProcessPersonalFavorites?: boolean; /** * The location of the queryparametertemplate.xml file. This file is used to enable anonymous users to make Search REST queries. */ QueryTemplatePropertiesUrl?: string; /** * Special rules for reordering search results. * These rules can specify that documents matching certain conditions are ranked higher or lower in the results. * This property applies only when search results are sorted based on rank. */ ReorderingRules?: ReorderingRule[]; /** * The number of properties to show hit highlighting for in the search results. */ HitHighlightedMultivaluePropertyLimit?: number; /** * A Boolean value that specifies whether the hit highlighted properties can be ordered. */ EnableOrderingHitHighlightedProperty?: boolean; /** * The managed properties that are used to determine how to collapse individual search results. * Results are collapsed into one or a specified number of results if they match any of the individual collapse specifications. * In a collapse specification, results are collapsed if their properties match all individual properties in the collapse specification. */ CollapseSpecification?: string; /** * The locale identifier (LCID) of the user interface */ UIlanguage?: number; /** * The preferred number of characters to display in the hit-highlighted summary generated for a search result. */ DesiredSnippetLength?: number; /** * The maximum number of characters to display in the hit-highlighted summary generated for a search result. */ MaxSnippetLength?: number; /** * The number of characters to display in the result summary for a search result. */ SummaryLength?: number; } /** * Provides hints at the properties which may be available on the result object */ export interface SearchResult { Rank?: number; DocId?: number; WorkId?: number; Title?: string; Author?: string; Size?: number; Path?: string; Description?: string; Write?: Date; LastModifiedTime?: Date; CollapsingStatus?: number; HitHighlightedSummary?: string; HitHighlightedProperties?: string; contentclass?: string; PictureThumbnailURL?: string; ServerRedirectedURL?: string; ServerRedirectedEmbedURL?: string; ServerRedirectedPreviewURL?: string; FileExtension?: string; ContentTypeId?: string; ParentLink?: string; ViewsLifeTime?: number; ViewsRecent?: number; SectionNames?: string; SectionIndexes?: string; SiteLogo?: string; SiteDescription?: string; importance?: number; SiteName?: string; IsDocument?: boolean; FileType?: string; IsContainer?: boolean; WebTemplate?: string; SPWebUrl?: string; UniqueId?: string; ProgId?: string; OriginalPath?: string; RenderTemplateId?: string; PartitionId?: string; UrlZone?: number; Culture?: string; } export interface SearchResponse { ElapsedTime: number; Properties?: { Key: string; Value: any; ValueType: string; }[]; PrimaryQueryResult?: ResultTableCollection; SecondaryQueryResults?: ResultTableCollection; SpellingSuggestion?: string; TriggeredRules?: any[]; } export interface ResultTableCollection { QueryErrors?: Dictionary; QueryId?: string; QueryRuleId?: string; CustomResults?: ResultTable; RefinementResults?: ResultTable; RelevantResults?: ResultTable; SpecialTermResults?: ResultTable; } export interface ResultTable { GroupTemplateId?: string; ItemTemplateId?: string; Properties?: { Key: string; Value: any; ValueType: string; }[]; Table?: { Rows: { Cells: { Key: string; Value: any; ValueType: string; }[]; }[]; }; Refiners?: { Name: string; Entries: { RefinementCount: string; RefinementName: string; RefinementToken: string; RefinementValue: string; }[]; }[]; ResultTitle?: string; ResultTitleUrl?: string; RowCount?: number; TableType?: string; TotalRows?: number; TotalRowsIncludingDuplicates?: number; } /** * Defines how search results are sorted. */ export interface Sort { /** * The name for a property by which the search results are ordered. */ Property: string; /** * The direction in which search results are ordered. */ Direction: SortDirection; } /** * Defines one search property */ export interface SearchProperty { Name: string; Value: SearchPropertyValue; } /** * Defines one search property value. Set only one of StrlVal/BoolVal/IntVal/StrArray. */ export interface SearchPropertyValue { StrVal?: string; BoolVal?: boolean; Intval?: number; StrArray?: string[]; QueryPropertyValueTypeIndex: QueryPropertyValueType; } /** * defines the SortDirection enum */ export enum SortDirection { Ascending = 0, Descending = 1, FQLFormula = 2, } /** * Defines how ReorderingRule interface, used for reordering results */ export interface ReorderingRule { /** * The value to match on */ MatchValue: string; /** * The rank boosting */ Boost: number; /** * The rank boosting */ MatchType: ReorderingRuleMatchType; } /** * defines the ReorderingRuleMatchType enum */ export enum ReorderingRuleMatchType { ResultContainsKeyword = 0, TitleContainsKeyword = 1, TitleMatchesKeyword = 2, UrlStartsWith = 3, UrlExactlyMatches = 4, ContentTypeIs = 5, FileExtensionMatches = 6, ResultHasTag = 7, ManualCondition = 8, } /** * Specifies the type value for the property */ export enum QueryPropertyValueType { None = 0, StringType = 1, Int32Type = 2, BooleanType = 3, StringArrayType = 4, UnSupportedType = 5, } export class SearchBuiltInSourceId { static readonly Documents: string; static readonly ItemsMatchingContentType: string; static readonly ItemsMatchingTag: string; static readonly ItemsRelatedToCurrentUser: string; static readonly ItemsWithSameKeywordAsThisItem: string; static readonly LocalPeopleResults: string; static readonly LocalReportsAndDataResults: string; static readonly LocalSharePointResults: string; static readonly LocalVideoResults: string; static readonly Pages: string; static readonly Pictures: string; static readonly Popular: string; static readonly RecentlyChangedItems: string; static readonly RecommendedItems: string; static readonly Wiki: string; } } declare module "sharepoint/searchsuggest" { import { SharePointQueryable, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; /** * Defines a query execute against the search/suggest endpoint (see https://msdn.microsoft.com/en-us/library/office/dn194079.aspx) */ export interface SearchSuggestQuery { /** * A string that contains the text for the search query. */ querytext: string; /** * The number of query suggestions to retrieve. Must be greater than zero (0). The default value is 5. */ count?: number; /** * The number of personal results to retrieve. Must be greater than zero (0). The default value is 5. */ personalCount?: number; /** * A Boolean value that specifies whether to retrieve pre-query or post-query suggestions. true to return pre-query suggestions; otherwise, false. The default value is false. */ preQuery?: boolean; /** * A Boolean value that specifies whether to hit-highlight or format in bold the query suggestions. true to format in bold the terms in the returned query suggestions * that match terms in the specified query; otherwise, false. The default value is true. */ hitHighlighting?: boolean; /** * A Boolean value that specifies whether to capitalize the first letter in each term in the returned query suggestions. true to capitalize the first letter in each term; * otherwise, false. The default value is false. */ capitalize?: boolean; /** * The locale ID (LCID) for the query (see https://msdn.microsoft.com/en-us/library/cc233982.aspx). */ culture?: string; /** * A Boolean value that specifies whether stemming is enabled. true to enable stemming; otherwise, false. The default value is true. */ stemming?: boolean; /** * A Boolean value that specifies whether to include people names in the returned query suggestions. true to include people names in the returned query suggestions; * otherwise, false. The default value is true. */ includePeople?: boolean; /** * A Boolean value that specifies whether to turn on query rules for this query. true to turn on query rules; otherwise, false. The default value is true. */ queryRules?: boolean; /** * A Boolean value that specifies whether to return query suggestions for prefix matches. true to return query suggestions based on prefix matches, otherwise, false when * query suggestions should match the full query word. */ prefixMatch?: boolean; } export class SearchSuggest extends SharePointQueryableInstance { constructor(baseUrl: string | SharePointQueryable, path?: string); execute(query: SearchSuggestQuery): Promise; private mapQueryToQueryString(query); } export class SearchSuggestResult { PeopleNames: string[]; PersonalResults: PersonalResultSuggestion[]; Queries: any[]; constructor(json: any); } export interface PersonalResultSuggestion { HighlightedTitle?: string; IsBestBet?: boolean; Title?: string; TypeId?: string; Url?: string; } } declare module "sharepoint/odata" { import { SharePointQueryableConstructor } from "sharepoint/sharepointqueryable"; import { ODataParser } from "odata/core"; export function spExtractODataId(candidate: any): string; export function spGetEntityUrl(entity: any): string; export function spODataEntity(factory: SharePointQueryableConstructor): ODataParser; export function spODataEntityArray(factory: SharePointQueryableConstructor): ODataParser; } declare module "sharepoint/siteusers" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { SiteGroups } from "sharepoint/sitegroups"; import { TypedHash } from "collections/collections"; /** * Properties that provide both a getter, and a setter. * */ export interface UserUpdateResult { user: SiteUser; data: any; } /** * Describes a collection of all site collection users * */ export class SiteUsers extends SharePointQueryableCollection { /** * Creates a new instance of the SiteUsers class * * @param baseUrl The url or SharePointQueryable which forms the parent of this user collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a user from the collection by email * * @param email The email address of the user to retrieve */ getByEmail(email: string): SiteUser; /** * Gets a user from the collection by id * * @param id The id of the user to retrieve */ getById(id: number): SiteUser; /** * Gets a user from the collection by login name * * @param loginName The login name of the user to retrieve */ getByLoginName(loginName: string): SiteUser; /** * Removes a user from the collection by id * * @param id The id of the user to remove */ removeById(id: number | SharePointQueryable): Promise; /** * Removes a user from the collection by login name * * @param loginName The login name of the user to remove */ removeByLoginName(loginName: string): Promise; /** * Adds a user to a group * * @param loginName The login name of the user to add to the group * */ add(loginName: string): Promise; } /** * Describes a single user * */ export class SiteUser extends SharePointQueryableInstance { /** * Gets the groups for this user * */ readonly groups: SiteGroups; /** * Updates this user instance with the supplied properties * * @param properties A plain object of property names and values to update for the user */ update(properties: TypedHash): Promise; /** * Delete this user * */ delete(): Promise; } /** * Represents the current user */ export class CurrentUser extends SharePointQueryableInstance { constructor(baseUrl: string | SharePointQueryable, path?: string); } export interface SiteUserProps { Email: string; Id: number; IsHiddenInUI: boolean; IsShareByEmailGuestUser: boolean; IsSiteAdmin: boolean; LoginName: string; PrincipalType: number; Title: string; } } declare module "sharepoint/sitegroups" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { SiteUsers } from "sharepoint/siteusers"; import { TypedHash } from "collections/collections"; /** * Principal Type enum * */ export enum PrincipalType { None = 0, User = 1, DistributionList = 2, SecurityGroup = 4, SharePointGroup = 8, All = 15, } /** * Results from updating a group * */ export interface GroupUpdateResult { group: SiteGroup; data: any; } /** * Results from adding a group * */ export interface GroupAddResult { group: SiteGroup; data: any; } /** * Describes a collection of site groups * */ export class SiteGroups extends SharePointQueryableCollection { /** * Creates a new instance of the SiteGroups class * * @param baseUrl The url or SharePointQueryable which forms the parent of this group collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Adds a new group to the site collection * * @param props The group properties object of property names and values to be set for the group */ add(properties: TypedHash): Promise; /** * Gets a group from the collection by name * * @param groupName The name of the group to retrieve */ getByName(groupName: string): SiteGroup; /** * Gets a group from the collection by id * * @param id The id of the group to retrieve */ getById(id: number): SiteGroup; /** * Removes the group with the specified member id from the collection * * @param id The id of the group to remove */ removeById(id: number): Promise; /** * Removes the cross-site group with the specified name from the collection * * @param loginName The name of the group to remove */ removeByLoginName(loginName: string): Promise; } /** * Describes a single group * */ export class SiteGroup extends SharePointQueryableInstance { /** * Gets the users for this group * */ readonly users: SiteUsers; /** * Updates this group instance with the supplied properties * * @param properties A GroupWriteableProperties object of property names and values to update for the group */ update(properties: TypedHash): Promise; } export interface SiteGroupAddResult { group: SiteGroup; data: any; } } declare module "sharepoint/types" { import { TypedHash } from "collections/collections"; /** * Represents the unique sequential location of a change within the change log. */ export interface ChangeToken { /** * Gets or sets a string value that contains the serialized representation of the change token generated by the protocol server. */ StringValue: string; } /** * Defines a query that is performed against the change log. */ export interface ChangeQuery { /** * Gets or sets a value that specifies whether add changes are included in the query. */ Add?: boolean; /** * Gets or sets a value that specifies whether changes to alerts are included in the query. */ Alert?: boolean; /** * Gets or sets a value that specifies the end date and end time for changes that are returned through the query. */ ChangeTokenEnd?: ChangeToken; /** * Gets or sets a value that specifies the start date and start time for changes that are returned through the query. */ ChangeTokenStart?: ChangeToken; /** * Gets or sets a value that specifies whether changes to content types are included in the query. */ ContentType?: boolean; /** * Gets or sets a value that specifies whether deleted objects are included in the query. */ DeleteObject?: boolean; /** * Gets or sets a value that specifies whether changes to fields are included in the query. */ Field?: boolean; /** * Gets or sets a value that specifies whether changes to files are included in the query. */ File?: boolean; /** * Gets or sets value that specifies whether changes to folders are included in the query. */ Folder?: boolean; /** * Gets or sets a value that specifies whether changes to groups are included in the query. */ Group?: boolean; /** * Gets or sets a value that specifies whether adding users to groups is included in the query. */ GroupMembershipAdd?: boolean; /** * Gets or sets a value that specifies whether deleting users from the groups is included in the query. */ GroupMembershipDelete?: boolean; /** * Gets or sets a value that specifies whether general changes to list items are included in the query. */ Item?: boolean; /** * Gets or sets a value that specifies whether changes to lists are included in the query. */ List?: boolean; /** * Gets or sets a value that specifies whether move changes are included in the query. */ Move?: boolean; /** * Gets or sets a value that specifies whether changes to the navigation structure of a site collection are included in the query. */ Navigation?: boolean; /** * Gets or sets a value that specifies whether renaming changes are included in the query. */ Rename?: boolean; /** * Gets or sets a value that specifies whether restoring items from the recycle bin or from backups is included in the query. */ Restore?: boolean; /** * Gets or sets a value that specifies whether adding role assignments is included in the query. */ RoleAssignmentAdd?: boolean; /** * Gets or sets a value that specifies whether adding role assignments is included in the query. */ RoleAssignmentDelete?: boolean; /** * Gets or sets a value that specifies whether adding role assignments is included in the query. */ RoleDefinitionAdd?: boolean; /** * Gets or sets a value that specifies whether adding role assignments is included in the query. */ RoleDefinitionDelete?: boolean; /** * Gets or sets a value that specifies whether adding role assignments is included in the query. */ RoleDefinitionUpdate?: boolean; /** * Gets or sets a value that specifies whether modifications to security policies are included in the query. */ SecurityPolicy?: boolean; /** * Gets or sets a value that specifies whether changes to site collections are included in the query. */ Site?: boolean; /** * Gets or sets a value that specifies whether updates made using the item SystemUpdate method are included in the query. */ SystemUpdate?: boolean; /** * Gets or sets a value that specifies whether update changes are included in the query. */ Update?: boolean; /** * Gets or sets a value that specifies whether changes to users are included in the query. */ User?: boolean; /** * Gets or sets a value that specifies whether changes to views are included in the query. */ View?: boolean; /** * Gets or sets a value that specifies whether changes to Web sites are included in the query. */ Web?: boolean; } /** * Specifies a Collaborative Application Markup Language (CAML) query on a list or joined lists. */ export interface CamlQuery { /** * Gets or sets a value that indicates whether the query returns dates in Coordinated Universal Time (UTC) format. */ DatesInUtc?: boolean; /** * Gets or sets a value that specifies the server relative URL of a list folder from which results will be returned. */ FolderServerRelativeUrl?: string; /** * Gets or sets a value that specifies the information required to get the next page of data for the list view. */ ListItemCollectionPosition?: ListItemCollectionPosition; /** * Gets or sets value that specifies the XML schema that defines the list view. */ ViewXml?: string; } /** * Specifies the information required to get the next page of data for a list view. */ export interface ListItemCollectionPosition { /** * Gets or sets a value that specifies information, as name-value pairs, required to get the next page of data for a list view. */ PagingInfo: string; } /** * Represents the input parameter of the GetListItemChangesSinceToken method. */ export interface ChangeLogitemQuery { /** * The change token for the request. */ ChangeToken?: string; /** * The XML element that defines custom filtering for the query. */ Contains?: string; /** * The records from the list to return and their return order. */ Query?: string; /** * The options for modifying the query. */ QueryOptions?: string; /** * RowLimit */ RowLimit?: string; /** * The names of the fields to include in the query result. */ ViewFields?: string; /** * The GUID of the view. */ ViewName?: string; } /** * Determines the display mode of the given control or view */ export enum ControlMode { Display = 1, Edit = 2, New = 3, } /** * Represents properties of a list item field and its value. */ export interface ListItemFormUpdateValue { /** * The error message result after validating the value for the field. */ ErrorMessage?: string; /** * The internal name of the field. */ FieldName?: string; /** * The value of the field, in string format. */ FieldValue?: string; /** * Indicates whether there was an error result after validating the value for the field. */ HasException?: boolean; } /** * Specifies the type of the field. */ export enum FieldTypes { Invalid = 0, Integer = 1, Text = 2, Note = 3, DateTime = 4, Counter = 5, Choice = 6, Lookup = 7, Boolean = 8, Number = 9, Currency = 10, URL = 11, Computed = 12, Threading = 13, Guid = 14, MultiChoice = 15, GridChoice = 16, Calculated = 17, File = 18, Attachments = 19, User = 20, Recurrence = 21, CrossProjectLink = 22, ModStat = 23, Error = 24, ContentTypeId = 25, PageSeparator = 26, ThreadIndex = 27, WorkflowStatus = 28, AllDayEvent = 29, WorkflowEventType = 30, } export enum DateTimeFieldFormatType { DateOnly = 0, DateTime = 1, } /** * Specifies the control settings while adding a field. */ export enum AddFieldOptions { /** * Specify that a new field added to the list must also be added to the default content type in the site collection */ DefaultValue = 0, /** * Specify that a new field added to the list must also be added to the default content type in the site collection. */ AddToDefaultContentType = 1, /** * Specify that a new field must not be added to any other content type */ AddToNoContentType = 2, /** * Specify that a new field that is added to the specified list must also be added to all content types in the site collection */ AddToAllContentTypes = 4, /** * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations */ AddFieldInternalNameHint = 8, /** * Specify that a new field that is added to the specified list must also be added to the default list view */ AddFieldToDefaultView = 16, /** * Specify to confirm that no other field has the same display name */ AddFieldCheckDisplayName = 32, } export interface XmlSchemaFieldCreationInformation { Options?: AddFieldOptions; SchemaXml: string; } export interface FieldCreationProperties extends TypedHash { DefaultFormula?: string; Description?: string; EnforceUniqueValues?: boolean; FieldTypeKind?: number; Group?: string; Hidden?: boolean; Indexed?: boolean; Required?: boolean; Title?: string; ValidationFormula?: string; ValidationMessage?: string; } export enum CalendarType { Gregorian = 1, Japan = 3, Taiwan = 4, Korea = 5, Hijri = 6, Thai = 7, Hebrew = 8, GregorianMEFrench = 9, GregorianArabic = 10, GregorianXLITEnglish = 11, GregorianXLITFrench = 12, KoreaJapanLunar = 14, ChineseLunar = 15, SakaEra = 16, UmAlQura = 23, } export enum UrlFieldFormatType { Hyperlink = 0, Image = 1, } export enum ChoiceFieldFormatType { Dropdown = 0, RadioButtons = 1, } export interface BasePermissions { Low: string; High: string; } export enum PermissionKind { /** * Has no permissions on the Site. Not available through the user interface. */ EmptyMask = 0, /** * View items in lists, documents in document libraries, and Web discussion comments. */ ViewListItems = 1, /** * Add items to lists, documents to document libraries, and Web discussion comments. */ AddListItems = 2, /** * Edit items in lists, edit documents in document libraries, edit Web discussion comments * in documents, and customize Web Part Pages in document libraries. */ EditListItems = 3, /** * Delete items from a list, documents from a document library, and Web discussion * comments in documents. */ DeleteListItems = 4, /** * Approve a minor version of a list item or document. */ ApproveItems = 5, /** * View the source of documents with server-side file handlers. */ OpenItems = 6, /** * View past versions of a list item or document. */ ViewVersions = 7, /** * Delete past versions of a list item or document. */ DeleteVersions = 8, /** * Discard or check in a document which is checked out to another user. */ CancelCheckout = 9, /** * Create, change, and delete personal views of lists. */ ManagePersonalViews = 10, /** * Create and delete lists, add or remove columns in a list, and add or remove public views of a list. */ ManageLists = 12, /** * View forms, views, and application pages, and enumerate lists. */ ViewFormPages = 13, /** * Make content of a list or document library retrieveable for anonymous users through SharePoint search. * The list permissions in the site do not change. */ AnonymousSearchAccessList = 14, /** * Allow users to open a Site, list, or folder to access items inside that container. */ Open = 17, /** * View pages in a Site. */ ViewPages = 18, /** * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using * a Windows SharePoint Services compatible editor. */ AddAndCustomizePages = 19, /** * Apply a theme or borders to the entire Site. */ ApplyThemeAndBorder = 20, /** * Apply a style sheet (.css file) to the Site. */ ApplyStyleSheets = 21, /** * View reports on Site usage. */ ViewUsageData = 22, /** * Create a Site using Self-Service Site Creation. */ CreateSSCSite = 23, /** * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. */ ManageSubwebs = 24, /** * Create a group of users that can be used anywhere within the site collection. */ CreateGroups = 25, /** * Create and change permission levels on the Site and assign permissions to users * and groups. */ ManagePermissions = 26, /** * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer * and WebDAV interfaces. */ BrowseDirectories = 27, /** * View information about users of the Site. */ BrowseUserInfo = 28, /** * Add or remove personal Web Parts on a Web Part Page. */ AddDelPrivateWebParts = 29, /** * Update Web Parts to display personalized information. */ UpdatePersonalWebParts = 30, /** * Grant the ability to perform all administration tasks for the Site as well as * manage content, activate, deactivate, or edit properties of Site scoped Features * through the object model or through the user interface (UI). When granted on the * root Site of a Site Collection, activate, deactivate, or edit properties of * site collection scoped Features through the object model. To browse to the Site * Collection Features page and activate or deactivate Site Collection scoped Features * through the UI, you must be a Site Collection administrator. */ ManageWeb = 31, /** * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through * SharePoint search if the list or document library has AnonymousSearchAccessList set. */ AnonymousSearchAccessWebLists = 32, /** * Use features that launch client applications. Otherwise, users must work on documents * locally and upload changes. */ UseClientIntegration = 37, /** * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site. */ UseRemoteAPIs = 38, /** * Manage alerts for all users of the Site. */ ManageAlerts = 39, /** * Create e-mail alerts. */ CreateAlerts = 40, /** * Allows a user to change his or her user information, such as adding a picture. */ EditMyUserInfo = 41, /** * Enumerate permissions on Site, list, folder, document, or list item. */ EnumeratePermissions = 63, /** * Has all permissions on the Site. Not available through the user interface. */ FullMask = 65, } export interface FollowedContent { FollowedDocumentsUrl: string; FollowedSitesUrl: string; } export interface UserProfile { /** * An object containing the user's FollowedDocumentsUrl and FollowedSitesUrl. */ FollowedContent?: FollowedContent; /** * The account name of the user. (SharePoint Online only) */ AccountName?: string; /** * The display name of the user. (SharePoint Online only) */ DisplayName?: string; /** * The FirstRun flag of the user. (SharePoint Online only) */ O15FirstRunExperience?: number; /** * The personal site of the user. */ PersonalSite?: string; /** * The capabilities of the user's personal site. Represents a bitwise PersonalSiteCapabilities value: * None = 0; Profile Value = 1; Social Value = 2; Storage Value = 4; MyTasksDashboard Value = 8; Education Value = 16; Guest Value = 32. */ PersonalSiteCapabilities?: number; /** * The error thrown when the user's personal site was first created, if any. (SharePoint Online only) */ PersonalSiteFirstCreationError?: string; /** * The date and time when the user's personal site was first created. (SharePoint Online only) */ PersonalSiteFirstCreationTime?: Date; /** * The status for the state of the personal site instantiation */ PersonalSiteInstantiationState?: number; /** * The date and time when the user's personal site was last created. (SharePoint Online only) */ PersonalSiteLastCreationTime?: Date; /** * The number of attempts made to create the user's personal site. (SharePoint Online only) */ PersonalSiteNumberOfRetries?: number; /** * Indicates whether the user's picture is imported from Exchange. */ PictureImportEnabled?: boolean; /** * The public URL of the personal site of the current user. (SharePoint Online only) */ PublicUrl?: string; /** * The URL used to create the user's personal site. */ UrlToCreatePersonalSite?: string; } export interface HashTag { /** * The hash tag's internal name. */ Name?: string; /** * The number of times that the hash tag is used. */ UseCount?: number; } export interface HashTagCollection { Items: HashTag[]; } export interface UserIdInfo { NameId?: string; NameIdIssuer?: string; } /** * Specifies the type of a principal. */ export const enum PrincipalType { /** * Enumeration whose value specifies no principal type. */ None = 0, /** * Enumeration whose value specifies a user as the principal type. */ User = 1, /** * Enumeration whose value specifies a distribution list as the principal type. */ DistributionList = 2, /** * Enumeration whose value specifies a security group as the principal type. */ SecurityGroup = 4, /** * Enumeration whose value specifies a group as the principal type. */ SharePointGroup = 8, /** * Enumeration whose value specifies all principal types. */ All = 15, } /** * Specifies the source of a principal. */ export const enum PrincipalSource { /** * Enumeration whose value specifies no principal source. */ None = 0, /** * Enumeration whose value specifies user information list as the principal source. */ UserInfoList = 1, /** * Enumeration whose value specifies Active Directory as the principal source. */ Windows = 2, /** * Enumeration whose value specifies the current membership provider as the principal source. */ MembershipProvider = 4, /** * Enumeration whose value specifies the current role provider as the principal source. */ RoleProvider = 8, /** * Enumeration whose value specifies all principal sources. */ All = 15, } export enum RoleType { None = 0, Guest = 1, Reader = 2, Contributor = 3, WebDesigner = 4, Administrator = 5, } export interface PrincipalInfo { Department: string; DisplayName: string; Email: string; JobTitle: string; LoginName: string; Mobile: string; PrincipalId: number; PrincipalType: PrincipalType; SIPAddress: string; } export interface DocumentLibraryInformation { AbsoluteUrl?: string; Modified?: Date; ModifiedFriendlyDisplay?: string; ServerRelativeUrl?: string; Title?: string; } export interface ContextInfo { FormDigestTimeoutSeconds?: number; FormDigestValue?: number; LibraryVersion?: string; SiteFullUrl?: string; SupportedSchemaVersions?: string[]; WebFullUrl?: string; } export interface RenderListData { Row: any[]; FirstRow: number; FolderPermissions: string; LastRow: number; FilterLink: string; ForceNoHierarchy: string; HierarchyHasIndention: string; } export enum PageType { Invalid = -1, DefaultView = 0, NormalView = 1, DialogView = 2, View = 3, DisplayForm = 4, DisplayFormDialog = 5, EditForm = 6, EditFormDialog = 7, NewForm = 8, NewFormDialog = 9, SolutionForm = 10, PAGE_MAXITEMS = 11, } export interface ListFormData { ContentType?: string; Title?: string; Author?: string; Editor?: string; Created?: Date; Modified: Date; Attachments?: any; ListSchema?: any; FormControlMode?: number; FieldControlModes?: { Title?: number; Author?: number; Editor?: number; Created?: number; Modified?: number; Attachments?: number; }; WebAttributes?: { WebUrl?: string; EffectivePresenceEnabled?: boolean; AllowScriptableWebParts?: boolean; PermissionCustomizePages?: boolean; LCID?: number; CurrentUserId?: number; }; ItemAttributes?: { Id?: number; FsObjType?: number; ExternalListItem?: boolean; Url?: string; EffectiveBasePermissionsLow?: number; EffectiveBasePermissionsHigh?: number; }; ListAttributes?: { Id?: string; BaseType?: number; Direction?: string; ListTemplateType?: number; DefaultItemOpen?: number; EnableVersioning?: boolean; }; CSRCustomLayout?: boolean; PostBackRequired?: boolean; PreviousPostBackHandled?: boolean; UploadMode?: boolean; SubmitButtonID?: string; ItemContentTypeName?: string; ItemContentTypeId?: string; JSLinks?: string; } export enum SharingLinkKind { /** * Uninitialized link */ Uninitialized = 0, /** * Direct link to the object being shared */ Direct = 1, /** * Organization-shareable link to the object being shared with view permissions */ OrganizationView = 2, /** * Organization-shareable link to the object being shared with edit permissions */ OrganizationEdit = 3, /** * View only anonymous link */ AnonymousView = 4, /** * Read/Write anonymous link */ AnonymousEdit = 5, /** * Flexible sharing Link where properties can change without affecting link URL */ Flexible = 6, } export interface ShareObjectOptions { url?: string; loginNames?: string | string[]; role: SharingRole; emailData?: SharingEmailData; group?: RoleType; propagateAcl?: boolean; includeAnonymousLinkInEmail?: boolean; useSimplifiedRoles?: boolean; } /** * Indicates the role of the sharing link */ export enum SharingRole { None = 0, View = 1, Edit = 2, Owner = 3, } /** * Represents email data. */ export interface SharingEmailData { /** * The e-mail subject. */ subject?: string; /** * The e-mail body. */ body: string; } export interface ShareLinkSettings { /** * The optional unique identifier of an existing sharing link to be retrieved and updated if necessary. */ shareId?: string; /** * The kind of the sharing link to be created. */ linkKind: SharingLinkKind; /** * A date/time string for which the format conforms to the ISO 8601:2004(E) complete representation for calendar date and time of day and * which represents the time and date of expiry for the anonymous link. Both the minutes and hour value must be specified for the * difference between the local and UTC time. Midnight is represented as 00:00:00. */ expiration?: string; /** * The role to be used for the sharing link. This is required for Flexible links, and ignored for legacy link kinds. */ role?: SharingRole; /** * Indicates if the sharing link, should support anonymous access. This is required for Flexible links, and ignored for legacy link kinds. */ allowAnonymousAccess?: boolean; } export interface ShareLinkRequest { /** * A string of JSON representing users in people picker format. Only needed if an e-mail notification should be sent. */ peoplePickerInput?: string; /** * Whether to create the link or not if it doesn't exist yet. */ createLink: boolean; /** * The e-mail data. Only needed if an e-mail notification should be sent. */ emailData?: SharingEmailData; /** * The settings for the sharing link to be created/updated */ settings: ShareLinkSettings; } /** * Represents a response for sharing a link */ export interface ShareLinkResponse { /** * A SharingLinkInfo that represents the sharing link. Will be populated if sharing operation is returning a sharing link. */ sharingLinkInfo: SharingLinkInfo; } export interface SharingLinkInfo { AllowsAnonymousAccess: boolean; Created: string; CreatedBy: PrincipalInfo; Expiration: string; IsActive: boolean; IsEditLink: boolean; IsFormsLink: boolean; IsUnhealthy: boolean; LastModified: string; LastModifiedBy: PrincipalInfo; LinkKind: SharingLinkKind; ShareId: string; Url: string; } export enum SharingOperationStatusCode { /** * The share operation completed without errors. */ CompletedSuccessfully = 0, /** * The share operation completed and generated requests for access. */ AccessRequestsQueued = 1, /** * The share operation failed as there were no resolved users. */ NoResolvedUsers = -1, /** * The share operation failed due to insufficient permissions. */ AccessDenied = -2, /** * The share operation failed when attempting a cross site share, which is not supported. */ CrossSiteRequestNotSupported = -3, /** * The sharing operation failed due to an unknown error. */ UnknowError = -4, /** * The text you typed is too long. Please shorten it. */ EmailBodyTooLong = -5, /** * The maximum number of unique scopes in the list has been exceeded. */ ListUniqueScopesExceeded = -6, /** * The share operation failed because a sharing capability is disabled in the site. */ CapabilityDisabled = -7, /** * The specified object for the share operation is not supported. */ ObjectNotSupported = -8, /** * A SharePoint group cannot contain another SharePoint group. */ NestedGroupsNotSupported = -9, } export interface SharingResult { /** * The relative URL of a page which can be navigated to, to show permissions. */ PermissionsPageRelativeUrl?: string; /** * A collection of users which have new pending access requests as a result of sharing. */ UsersWithAccessRequests?: any[]; /** * An enumeration which summarizes the result of the sharing operation. */ StatusCode?: SharingOperationStatusCode; /** * An error message about the failure if sharing was unsuccessful. */ ErrorMessage?: string; /** * A list of UserSharingResults from attempting to share a securable with unique permissions. */ UniquelyPermissionedUsers?: UserSharingResult[]; /** * Groups which were granted permissions. */ GroupsSharedWith?: any[]; /** * The SharePoint group users were added to, if any were added to a group. */ GroupUsersAddedTo?: any; /** * A list of users being added to a SharePoint permissions goup */ UsersAddedToGroup?: UserSharingResult[]; /** * A list of SPInvitationCreationResult for external users being invited to have access. */ InvitedUsers?: SPInvitationCreationResult[]; /** * The name of the securable being shared. */ Name?: string; /** * The url of the securable being shared. */ Url?: string; /** * IconUrl */ IconUrl?: string; } export interface UserSharingResult { IsUserKnown?: boolean; Status?: boolean; Message?: string; User?: string; DisplayName?: string; Email?: string; CurrentRole?: SharingRole; AllowedRoles?: SharingRole[]; InvitationLink?: string; } export interface SPInvitationCreationResult { Succeeded?: boolean; Email?: string; InvitationLink?: string; } export interface SharingRecipient { email?: string; alias?: string; } export interface SharingEntityPermission { /** * The Input Entity provided to the Call. */ inputEntity: string; /** * The Resolved Entity after resolving using PeoplePicker API. */ resolvedEntity: string; /** * Does the Entity have Access to the Securable Object */ hasAccess: boolean; /** * Role of the Entity on ListItem */ role: SharingRole; } export interface SharingInformationRequest { /** * Max Principal's to return. */ maxPrincipalsToReturn: number; /** * Supported Features (For future use by Office Client). */ clientSupportedFeatures: string; } export interface ObjectSharingSettings { /** * The URL pointing to the containing SPWeb object */ WebUrl: string; /** * The unique ID of the parent list (if applicable) */ ListId?: string; /** * The list item ID (if applicable) */ ItemId?: string; /** * The object title */ ItemName: string; /** * The server relative object URL */ ItemUrl: string; /** * Contains information about the sharing state of a shareable object */ ObjectSharingInformation: any; /** * Boolean indicating whether the sharing context operates under the access request mode */ AccessRequestMode: boolean; /** * Boolean indicating whether the sharing context operates under the permissions only mode * (i.e. adding to a group or hiding the groups dropdown in the SharePoint UI) */ PermissionsOnlyMode: boolean; /** * URL of the site from which the shared object inherits permissions */ InheritingWebLink: string; /** * Boolean flag denoting if guest users are enabled for the site collection */ ShareByEmailEnabled: boolean; /** * Boolean indicating whether the current user is a guest user */ IsGuestUser: boolean; /** * Boolean indicating whether the site has the standard "Editor" role */ HasEditRole: boolean; /** * Boolean indicating whether the site has the standard "Reader" role */ HasReadRole: boolean; /** * Boolean indicating whether the object to share is a picture library */ IsPictureLibrary: boolean; /** * Boolean indicating whether the folder object can be shared */ CanShareFolder: boolean; /** * Boolean indicating whether email invitations can be sent */ CanSendEmail: boolean; /** * Default share link type */ DefaultShareLinkType: SharingLinkKind; /** * Boolean indicating whether the object to share supports ACL propagation */ SupportsAclPropagation: boolean; /** * Boolean indicating whether the current user can only share within the tenancy */ CanCurrentUserShareInternally: boolean; /** * Boolean indicating whether the current user can share outside the tenancy, by inviting external users */ CanCurrentUserShareExternally: boolean; /** * Boolean indicating whether the current user can retrieve an anonymous View link, if one has already been created * If one has not been created, the user cannot create one */ CanCurrentUserRetrieveReadonlyLink: boolean; /** * Boolean indicating whether the current user can create or disable an anonymous Edit link */ CanCurrentUserManageReadonlyLink: boolean; /** * Boolean indicating whether the current user can retrieve an anonymous Edit link, if one has already been created * If one has not been created, the user cannot create one */ CanCurrentUserRetrieveReadWriteLink: boolean; /** * Boolean indicating whether the current user can create or disable an anonymous Edit link */ CanCurrentUserManageReadWriteLink: boolean; /** * Boolean indicating whether the current user can retrieve an organization View link, if one has already been created * If one has not been created, the user cannot create one */ CanCurrentUserRetrieveOrganizationReadonlyLink: boolean; /** * Boolean indicating whether the current user can create or disable an organization Edit link */ CanCurrentUserManageOrganizationReadonlyLink: boolean; /** * Boolean indicating whether the current user can retrieve an organization Edit link, if one has already been created * If one has not been created, the user cannot create one */ CanCurrentUserRetrieveOrganizationReadWriteLink: boolean; /** * Boolean indicating whether the current user can create or disable an organization Edit link */ CanCurrentUserManageOrganizationReadWriteLink: boolean; /** * Boolean indicating whether the current user can make use of Share-By-Link */ CanSendLink: boolean; /** * Boolean indicating whether the client logic should warn the user * that they are about to share with external email addresses. */ ShowExternalSharingWarning: boolean; /** * A list of SharingPermissionInformation objects that can be used to share */ SharingPermissions: any[]; /** * A dictionary object that lists the display name and the id of * the SharePoint simplified roles (edit, view) */ SimplifiedRoles: { [key: string]: string; }; /** * A dictionary object that lists the display name and the id of the SharePoint groups */ GroupsList: { [key: string]: string; }; /** * A dictionary object that lists the display name and the id of the SharePoint regular roles */ Roles: { [key: string]: string; }; /** * An object containing the SharePoint UI specific sharing settings. */ SharePointSettings: any; /** * Boolean indicating whether the current user is a site collection administrator */ IsUserSiteAdmin: boolean; /** * A value that indicates number of days an anonymous link can be valid before it expires */ RequiredAnonymousLinkExpirationInDays: number; } export interface SharingInformation { /** * External Sharing. */ canAddExternalPrincipal?: boolean; /** * Internal Sharing. */ canAddInternalPrincipal?: boolean; /** * Can Send Email. */ canSendEmail?: boolean; /** * Can Use Simplified Roles present in Roles Enum. */ canUseSimplifiedRoles?: boolean; /** * Has Unique Permissions. */ hasUniquePermissions?: boolean; /** * Current Users Role on the Item. */ currentRole?: SharingRole; /** * Does the User+Item require Approval from Admin for Sharing. */ requiresAccessApproval?: boolean; /** * (Owners only)Whether there are pending access requests for the securable object. */ hasPendingAccessRequests?: boolean; /** * (Owners only)The link to the access requests page for the securable object, or an empty string if the link is not available. */ pendingAccessRequestsLink?: string; /** * sharedObjectType */ sharedObjectType?: SPSharedObjectType; /** * Url for the Securable Object (Encoded). */ directUrl?: string; /** * Parent Web Url for the Securable Object (Encoded). */ webUrl?: string; /** * Default SharingLinkKind. */ defaultLinkKind?: SharingLinkKind; /** * Tenant's SharingDomainRestrictionMode. */ domainRestrictionMode?: SharingDomainRestrictionMode; /** * Tenant's RestrictedDomains. */ RestrictedDomains?: string; /** * Tenant's Anonymous Link Expiration Restriction in Days. */ anonymousLinkExpirationRestrictionDays?: number; /** * The PermissionCollection that are on the Securable Object (Princpals & Links) */ permissionsInformation?: any; /** * PickerSettings used by the PeoplePicker Control. */ pickerSettings?: any; } export enum SPSharedObjectType { Unknown = 0, File = 1, Folder = 2, Item = 3, List = 4, Web = 5, Max = 6, } export enum SharingDomainRestrictionMode { None = 0, AllowList = 1, BlockList = 2, } export interface EmailProperties { To: string[]; CC?: string[]; BCC?: string[]; Subject: string; Body: string; AdditionalHeaders?: TypedHash; From?: string; } export interface WikiPageCreationInformation { /** * The server-relative-url of the wiki page to be created. */ ServerRelativeUrl: string; /** * The wiki content to be set in the wiki page. */ WikiHtmlContent: string; } export enum RenderListDataOptions { None = 0, ContextInfo = 1, ListData = 2, ListSchema = 4, MenuView = 8, ListContentType = 16, FileSystemItemId = 32, ClientFormSchema = 64, QuickLaunch = 128, Spotlight = 256, Visualization = 512, ViewMetadata = 1024, DisableAutoHyperlink = 2048, EnableMediaTAUrls = 4096, ParentInfo = 8192, PageContextInfo = 16384, ClientSideComponentManifest = 32768, } export interface RenderListDataParameters { AllowMultipleValueFilterForTaxonomyFields?: boolean; DatesInUtc?: boolean; ExpandGroups?: boolean; FirstGroupOnly?: boolean; FolderServerRelativeUrl?: string; ImageFieldsToTryRewriteToCdnUrls?: string; OverrideViewXml?: string; Paging?: string; RenderOptions?: RenderListDataOptions; ReplaceGroup?: boolean; ViewXml?: string; } export interface AppData { AppCatalogVersion?: string; CanUpgrade?: boolean; CurrentVersionDeployed?: boolean; Deployed?: boolean; ID?: string; InstalledVersion?: string; IsClientSideSolution?: boolean; Title?: string; } export interface RegionalSettingsProps { AdjustHijriDays: number; AlternateCalendarType: number; AM: string; CalendarType: number; Collation: number; CollationLCID: number; DateFormat: number; DateSeparator: string; DecimalSeparator: string; DigitGrouping: string; FirstDayOfWeek: number; FirstWeekOfYear: number; IsEastAsia: boolean; IsRightToLeft: boolean; IsUIRightToLeft: boolean; ListSeparator: string; LocaleId: number; NegativeSign: string; NegNumberMode: number; PM: string; PositiveSign: string; ShowWeeks: boolean; ThousandSeparator: string; Time24: boolean; TimeMarkerPosition: number; TimeSeparator: string; WorkDayEndHour: number; WorkDays: number; WorkDayStartHour: number; } export interface MenuNode { CustomProperties: any[]; FriendlyUrlSegment: string; IsDeleted: boolean; IsHidden: boolean; Key: string; Nodes: MenuNode[]; NodeType: number; SimpleUrl: string; Title: string; } export interface MenuNodeCollection { FriendlyUrlPrefix: string; Nodes: MenuNode[]; SimpleUrl: string; SPSitePrefix: string; SPWebPrefix: string; StartingNodeKey: string; StartingNodeTitle: string; Version: Date; } export enum FieldUserSelectionMode { PeopleAndGroups = 1, PeopleOnly = 0, } /** * Client people picker query parameters */ export interface ClientPeoplePickerQueryParameters { /** * Gets or sets a value that specifies whether e-mail addresses can be used to perform search. */ AllowEmailAddresses?: boolean; /** * Gets or sets a value that specifies whether multiple entities are allowed. */ AllowMultipleEntities?: boolean; /** * Gets or sets a value that specifies whether only e-mail addresses can be used to perform search. */ AllowOnlyEmailAddresses?: boolean; /** * Gets or sets a value that specifies whether all URL zones are used to perform search. */ AllUrlZones?: boolean; /** * Gets or sets a value that specifies claim providers that are used to perform search. */ EnabledClaimProviders?: string; /** * Gets or sets a value that specifies whether claims are forced (if yes, multiple results for single entity can be returned). */ ForceClaims?: boolean; /** * Gets or sets a value that specifies limit of results returned. */ MaximumEntitySuggestions: number; /** * Gets or sets a value that specifies principal sources to perform search. */ PrincipalSource?: PrincipalSource; /** * Gets or sets a value that specifies principal types to search for. */ PrincipalType?: PrincipalType; /** * Gets or sets a value that specifies additional query settings. */ QuerySettings?: PeoplePickerQuerySettings; /** * Gets or sets a value that specifies the term to search for. */ QueryString: string; /** * Gets or sets a value that specifies ID of the SharePoint Group that will be used to perform search. */ SharePointGroupID?: number; /** * Gets or sets a value that specifies URL zones that are used to perform search. */ UrlZone?: UrlZone; /** * Gets or sets a value that specifies whether search is limited to specific URL zone. */ UrlZoneSpecified?: boolean; /** * Gets or sets a value that specifies GUID of the Web Application that is used to perform search. */ WebApplicationID?: string; } /** * People picker query settings */ export interface PeoplePickerQuerySettings { ExcludeAllUsersOnTenantClaim?: boolean; } /** * People picker entity */ export interface PeoplePickerEntity { Description: string; DisplayText: string; EntityData: PeoplePickerEntityData; EntityType: string; IsResolved: boolean; Key: string; MultipleMatches: PeoplePickerEntityData[]; ProviderDisplayName: string; ProviderName: string; } /** * People picker entity data */ export interface PeoplePickerEntityData { AccountName?: string; Department?: string; Email?: string; IsAltSecIdPresent?: string; MobilePhone?: string; ObjectId?: string; OtherMails?: string; PrincipalType?: string; SPGroupID?: string; SPUserID?: string; Title?: string; } /** * Specifies the originating zone of a request received. */ export const enum UrlZone { /** * Specifies the default zone used for requests unless another zone is specified. */ DefaultZone = 0, /** * Specifies an intranet zone. */ Intranet = 1, /** * Specifies an Internet zone. */ Internet = 2, /** * Specifies a custom zone. */ Custom = 3, /** * Specifies an extranet zone. */ Extranet = 4, } } declare module "sharepoint/roles" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { SiteGroups } from "sharepoint/sitegroups"; import { BasePermissions } from "sharepoint/types"; import { TypedHash } from "collections/collections"; /** * Describes a set of role assignments for the current scope * */ export class RoleAssignments extends SharePointQueryableCollection { /** * Creates a new instance of the RoleAssignments class * * @param baseUrl The url or SharePointQueryable which forms the parent of this role assignments collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Adds a new role assignment with the specified principal and role definitions to the collection * * @param principalId The id of the user or group to assign permissions to * @param roleDefId The id of the role definition that defines the permissions to assign * */ add(principalId: number, roleDefId: number): Promise; /** * Removes the role assignment with the specified principal and role definition from the collection * * @param principalId The id of the user or group in the role assignment * @param roleDefId The id of the role definition in the role assignment * */ remove(principalId: number, roleDefId: number): Promise; /** * Gets the role assignment associated with the specified principal id from the collection. * * @param id The id of the role assignment */ getById(id: number): RoleAssignment; } /** * Describes a role assignment * */ export class RoleAssignment extends SharePointQueryableInstance { /** * Gets the groups that directly belong to the access control list (ACL) for this securable object * */ readonly groups: SiteGroups; /** * Gets the role definition bindings for this role assignment * */ readonly bindings: RoleDefinitionBindings; /** * Deletes this role assignment * */ delete(): Promise; } /** * Describes a collection of role definitions * */ export class RoleDefinitions extends SharePointQueryableCollection { /** * Creates a new instance of the RoleDefinitions class * * @param baseUrl The url or SharePointQueryable which forms the parent of this role definitions collection * */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets the role definition with the specified id from the collection * * @param id The id of the role definition * */ getById(id: number): RoleDefinition; /** * Gets the role definition with the specified name * * @param name The name of the role definition * */ getByName(name: string): RoleDefinition; /** * Gets the role definition with the specified role type * * @param roleTypeKind The roletypekind of the role definition (None=0, Guest=1, Reader=2, Contributor=3, WebDesigner=4, Administrator=5, Editor=6, System=7) * */ getByType(roleTypeKind: number): RoleDefinition; /** * Creates a role definition * * @param name The new role definition's name * @param description The new role definition's description * @param order The order in which the role definition appears * @param basePermissions The permissions mask for this role definition * */ add(name: string, description: string, order: number, basePermissions: BasePermissions): Promise; } /** * Describes a role definition * */ export class RoleDefinition extends SharePointQueryableInstance { /** * Updates this role definition with the supplied properties * * @param properties A plain object hash of values to update for the role definition */ update(properties: TypedHash): Promise; /** * Deletes this role definition * */ delete(): Promise; } /** * Result from updating a role definition * */ export interface RoleDefinitionUpdateResult { definition: RoleDefinition; data: any; } /** * Result from adding a role definition * */ export interface RoleDefinitionAddResult { definition: RoleDefinition; data: any; } /** * Describes the role definitons bound to a role assignment object * */ export class RoleDefinitionBindings extends SharePointQueryableCollection { /** * Creates a new instance of the RoleDefinitionBindings class * * @param baseUrl The url or SharePointQueryable which forms the parent of this role definition bindings collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); } } declare module "sharepoint/sharepointqueryablesecurable" { import { RoleAssignments } from "sharepoint/roles"; import { BasePermissions, PermissionKind } from "sharepoint/types"; import { SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; export class SharePointQueryableSecurable extends SharePointQueryableInstance { /** * Gets the set of role assignments for this item * */ readonly roleAssignments: RoleAssignments; /** * Gets the closest securable up the security hierarchy whose permissions are applied to this list item * */ readonly firstUniqueAncestorSecurableObject: SharePointQueryableInstance; /** * Gets the effective permissions for the user supplied * * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com) */ getUserEffectivePermissions(loginName: string): Promise; /** * Gets the effective permissions for the current user */ getCurrentUserEffectivePermissions(): Promise; /** * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes * * @param copyRoleAssignments If true the permissions are copied from the current parent scope * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object */ breakRoleInheritance(copyRoleAssignments?: boolean, clearSubscopes?: boolean): Promise; /** * Removes the local role assignments so that it re-inherit role assignments from the parent object. * */ resetRoleInheritance(): Promise; /** * Determines if a given user has the appropriate permissions * * @param loginName The user to check * @param permission The permission being checked */ userHasPermissions(loginName: string, permission: PermissionKind): Promise; /** * Determines if the current user has the requested permissions * * @param permission The permission we wish to check */ currentUserHasPermissions(permission: PermissionKind): Promise; /** * Taken from sp.js, checks the supplied permissions against the mask * * @param value The security principal's permissions on the given object * @param perm The permission checked against the value */ hasPermissions(value: BasePermissions, perm: PermissionKind): boolean; } } declare module "sharepoint/sharepointqueryableshareable" { import { SharePointQueryable, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { SharePointQueryableSecurable } from "sharepoint/sharepointqueryablesecurable"; import { RoleType, SharingLinkKind, ShareLinkResponse, SharingRole, SharingEmailData, SharingResult, SharingRecipient, SharingEntityPermission, SharingInformationRequest, ObjectSharingSettings, SharingInformation, ShareObjectOptions } from "sharepoint/types"; /** * Internal helper class used to augment classes to include sharing functionality */ export class SharePointQueryableShareable extends SharePointQueryable { /** * Gets a sharing link for the supplied * * @param kind The kind of link to share * @param expiration The optional expiration for this link */ getShareLink(kind: SharingLinkKind, expiration?: Date): Promise; /** * Shares this instance with the supplied users * * @param loginNames Resolved login names to share * @param role The role * @param requireSignin True to require the user is authenticated, otherwise false * @param propagateAcl True to apply this share to all children * @param emailData If supplied an email will be sent with the indicated properties */ shareWith(loginNames: string | string[], role: SharingRole, requireSignin?: boolean, propagateAcl?: boolean, emailData?: SharingEmailData): Promise; /** * Shares an object based on the supplied options * * @param options The set of options to send to the ShareObject method * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method */ shareObject(options: ShareObjectOptions, bypass?: boolean): Promise; /** * Calls the web's UnshareObject method * * @param url The url of the object to unshare */ unshareObjectWeb(url: string): Promise; /** * Checks Permissions on the list of Users and returns back role the users have on the Item. * * @param recipients The array of Entities for which Permissions need to be checked. */ checkPermissions(recipients: SharingRecipient[]): Promise; /** * Get Sharing Information. * * @param request The SharingInformationRequest Object. */ getSharingInformation(request?: SharingInformationRequest): Promise; /** * Gets the sharing settings of an item. * * @param useSimplifiedRoles Determines whether to use simplified roles. */ getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; /** * Unshares this object */ unshareObject(): Promise; /** * Deletes a link by type * * @param kind Deletes a sharing link by the kind of link */ deleteLinkByKind(kind: SharingLinkKind): Promise; /** * Removes the specified link to the item. * * @param kind The kind of link to be deleted. * @param shareId */ unshareLink(kind: SharingLinkKind, shareId?: string): Promise; /** * Calculates the roleValue string used in the sharing query * * @param role The Sharing Role * @param group The Group type */ protected getRoleValue(role: SharingRole, group: RoleType): Promise; private getShareObjectWeb(candidate); private sendShareObjectRequest(options); } export class SharePointQueryableShareableWeb extends SharePointQueryableSecurable { /** * Shares this web with the supplied users * @param loginNames The resolved login names to share * @param role The role to share this web * @param emailData Optional email data */ shareWith(loginNames: string | string[], role?: SharingRole, emailData?: SharingEmailData): Promise; /** * Provides direct access to the static web.ShareObject method * * @param url The url to share * @param loginNames Resolved loginnames string[] of a single login name string * @param roleValue Role value * @param emailData Optional email data * @param groupId Optional group id * @param propagateAcl * @param includeAnonymousLinkInEmail * @param useSimplifiedRoles */ shareObject(url: string, loginNames: string | string[], role: SharingRole, emailData?: SharingEmailData, group?: RoleType, propagateAcl?: boolean, includeAnonymousLinkInEmail?: boolean, useSimplifiedRoles?: boolean): Promise; /** * Supplies a method to pass any set of arguments to ShareObject * * @param options The set of options to send to ShareObject */ shareObjectRaw(options: any): Promise; /** * Unshares the object * * @param url The url of the object to stop sharing */ unshareObject(url: string): Promise; } export class SharePointQueryableShareableItem extends SharePointQueryableSecurable { /** * Gets a link suitable for sharing for this item * * @param kind The type of link to share * @param expiration The optional expiration date */ getShareLink(kind?: SharingLinkKind, expiration?: Date): Promise; /** * Shares this item with one or more users * * @param loginNames string or string[] of resolved login names to which this item will be shared * @param role The role (View | Edit) applied to the share * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. */ shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, emailData?: SharingEmailData): Promise; /** * Checks Permissions on the list of Users and returns back role the users have on the Item. * * @param recipients The array of Entities for which Permissions need to be checked. */ checkSharingPermissions(recipients: SharingRecipient[]): Promise; /** * Get Sharing Information. * * @param request The SharingInformationRequest Object. */ getSharingInformation(request?: SharingInformationRequest): Promise; /** * Gets the sharing settings of an item. * * @param useSimplifiedRoles Determines whether to use simplified roles. */ getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; /** * Unshare this item */ unshare(): Promise; /** * Deletes a sharing link by kind * * @param kind Deletes a sharing link by the kind of link */ deleteSharingLinkByKind(kind: SharingLinkKind): Promise; /** * Removes the specified link to the item. * * @param kind The kind of link to be deleted. * @param shareId */ unshareLink(kind: SharingLinkKind, shareId?: string): Promise; } export class FileFolderShared extends SharePointQueryableInstance { /** * Gets a link suitable for sharing * * @param kind The kind of link to get * @param expiration Optional, an expiration for this link */ getShareLink(kind?: SharingLinkKind, expiration?: Date): Promise; /** * Checks Permissions on the list of Users and returns back role the users have on the Item. * * @param recipients The array of Entities for which Permissions need to be checked. */ checkSharingPermissions(recipients: SharingRecipient[]): Promise; /** * Get Sharing Information. * * @param request The SharingInformationRequest Object. */ getSharingInformation(request?: SharingInformationRequest): Promise; /** * Gets the sharing settings of an item. * * @param useSimplifiedRoles Determines whether to use simplified roles. */ getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; /** * Unshare this item */ unshare(): Promise; /** * Deletes a sharing link by the kind of link * * @param kind The kind of link to be deleted. */ deleteSharingLinkByKind(kind: SharingLinkKind): Promise; /** * Removes the specified link to the item. * * @param kind The kind of link to be deleted. * @param shareId The share id to delete */ unshareLink(kind: SharingLinkKind, shareId?: string): Promise; /** * For files and folders we need to use the associated item end point */ protected getShareable(): Promise; } export class SharePointQueryableShareableFile extends FileFolderShared { /** * Shares this item with one or more users * * @param loginNames string or string[] of resolved login names to which this item will be shared * @param role The role (View | Edit) applied to the share * @param shareEverything Share everything in this folder, even items with unique permissions. * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. */ shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, emailData?: SharingEmailData): Promise; } export class SharePointQueryableShareableFolder extends FileFolderShared { /** * Shares this item with one or more users * * @param loginNames string or string[] of resolved login names to which this item will be shared * @param role The role (View | Edit) applied to the share * @param shareEverything Share everything in this folder, even items with unique permissions. * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. */ shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, shareEverything?: boolean, emailData?: SharingEmailData): Promise; } } declare module "sharepoint/webparts" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; export class LimitedWebPartManager extends SharePointQueryable { /** * Gets the set of web part definitions contained by this web part manager * */ readonly webparts: WebPartDefinitions; /** * Exports a webpart definition * * @param id the GUID id of the definition to export */ export(id: string): Promise; /** * Imports a webpart * * @param xml webpart definition which must be valid XML in the .dwp or .webpart format */ import(xml: string): Promise; } export class WebPartDefinitions extends SharePointQueryableCollection { /** * Gets a web part definition from the collection by id * * @param id The storage ID of the SPWebPartDefinition to retrieve */ getById(id: string): WebPartDefinition; /** * Gets a web part definition from the collection by storage id * * @param id The WebPart.ID of the SPWebPartDefinition to retrieve */ getByControlId(id: string): WebPartDefinition; } export class WebPartDefinition extends SharePointQueryableInstance { /** * Gets the webpart information associated with this definition */ readonly webpart: WebPart; /** * Saves changes to the Web Part made using other properties and methods on the SPWebPartDefinition object */ saveChanges(): Promise; /** * Moves the Web Part to a different location on a Web Part Page * * @param zoneId The ID of the Web Part Zone to which to move the Web Part * @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 */ moveTo(zoneId: string, zoneIndex: number): Promise; /** * Closes the Web Part. If the Web Part is already closed, this method does nothing */ close(): Promise; /** * Opens the Web Part. If the Web Part is already closed, this method does nothing */ open(): Promise; /** * Removes a webpart from a page, all settings will be lost */ delete(): Promise; } export class WebPart extends SharePointQueryableInstance { /** * Creates a new instance of the WebPart class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection * @param path Optional, if supplied will be appended to the supplied baseUrl */ constructor(baseUrl: string | SharePointQueryable, path?: string); } } declare module "sharepoint/files" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { LimitedWebPartManager } from "sharepoint/webparts"; import { Item } from "sharepoint/items"; import { SharePointQueryableShareableFile } from "sharepoint/sharepointqueryableshareable"; export interface ChunkedFileUploadProgressData { uploadId: string; stage: "starting" | "continue" | "finishing"; blockNumber: number; totalBlocks: number; chunkSize: number; currentPointer: number; fileSize: number; } /** * Describes a collection of File objects * */ export class Files extends SharePointQueryableCollection { /** * Creates a new instance of the Files class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a File by filename * * @param name The name of the file, including extension. */ getByName(name: string): File; /** * Uploads a file. Not supported for batching * * @param url The folder-relative url of the file. * @param content The file contents blob. * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) * @returns The new File and the raw response. */ add(url: string, content: string | ArrayBuffer | Blob, shouldOverWrite?: boolean): Promise; /** * Uploads a file. Not supported for batching * * @param url The folder-relative url of the file. * @param content The Blob file content to add * @param progress A callback function which can be used to track the progress of the upload * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) * @param chunkSize The size of each file slice, in bytes (default: 10485760) * @returns The new File and the raw response. */ addChunked(url: string, content: Blob, progress?: (data: ChunkedFileUploadProgressData) => void, shouldOverWrite?: boolean, chunkSize?: number): Promise; /** * Adds a ghosted file to an existing list or document library. Not supported for batching. * * @param fileUrl The server-relative url where you want to save the file. * @param templateFileType The type of use to create the file. * @returns The template file that was added and the raw response. */ addTemplateFile(fileUrl: string, templateFileType: TemplateFileType): Promise; } /** * Describes a single File instance * */ export class File extends SharePointQueryableShareableFile { /** * Gets a value that specifies the list item field values for the list item corresponding to the file. * */ readonly listItemAllFields: SharePointQueryableCollection; /** * Gets a collection of versions * */ readonly versions: Versions; /** * Approves the file submitted for content approval with the specified comment. * Only documents in lists that are enabled for content approval can be approved. * * @param comment The comment for the approval. */ approve(comment?: string): Promise; /** * Stops the chunk upload session without saving the uploaded data. Does not support batching. * If the file doesn’t already exist in the library, the partially uploaded file will be deleted. * Use this in response to user action (as in a request to cancel an upload) or an error or exception. * Use the uploadId value that was passed to the StartUpload method that started the upload session. * This method is currently available only on Office 365. * * @param uploadId The unique identifier of the upload session. */ cancelUpload(uploadId: string): Promise; /** * Checks the file in to a document library based on the check-in type. * * @param comment A comment for the check-in. Its length must be <= 1023. * @param checkinType The check-in type for the file. */ checkin(comment?: string, checkinType?: CheckinType): Promise; /** * Checks out the file from a document library. */ checkout(): Promise; /** * Copies the file to the destination url. * * @param url The absolute url or server relative url of the destination file path to copy to. * @param shouldOverWrite Should a file with the same name in the same location be overwritten? */ copyTo(url: string, shouldOverWrite?: boolean): Promise; /** * Delete this file. * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Denies approval for a file that was submitted for content approval. * Only documents in lists that are enabled for content approval can be denied. * * @param comment The comment for the denial. */ deny(comment?: string): Promise; /** * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view. * An exception is thrown if the file is not an ASPX page. * * @param scope The WebPartsPersonalizationScope view on the Web Parts page. */ getLimitedWebPartManager(scope?: WebPartsPersonalizationScope): LimitedWebPartManager; /** * Moves the file to the specified destination url. * * @param url The absolute url or server relative url of the destination file path to move to. * @param moveOperations The bitwise MoveOperations value for how to move the file. */ moveTo(url: string, moveOperations?: MoveOperations): Promise; /** * Submits the file for content approval with the specified comment. * * @param comment The comment for the published file. Its length must be <= 1023. */ publish(comment?: string): Promise; /** * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item. * * @returns The GUID of the recycled file. */ recycle(): Promise; /** * Reverts an existing checkout for the file. * */ undoCheckout(): Promise; /** * Removes the file from content approval or unpublish a major version. * * @param comment The comment for the unpublish operation. Its length must be <= 1023. */ unpublish(comment?: string): Promise; /** * Gets the contents of the file as text. Not supported in batching. * */ getText(): Promise; /** * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching. * */ getBlob(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. */ getBuffer(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. */ getJSON(): Promise; /** * Sets the content of a file, for large files use setContentChunked. Not supported in batching. * * @param content The file content * */ setContent(content: string | ArrayBuffer | Blob): Promise; /** * Gets the associated list item for this folder, loading the default properties */ getItem(...selects: string[]): Promise; /** * Sets the contents of a file using a chunked upload approach. Not supported in batching. * * @param file The file to upload * @param progress A callback function which can be used to track the progress of the upload * @param chunkSize The size of each file slice, in bytes (default: 10485760) */ setContentChunked(file: Blob, progress?: (data: ChunkedFileUploadProgressData) => void, chunkSize?: number): Promise; /** * Starts a new chunk upload session and uploads the first fragment. * The current file content is not changed when this method completes. * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream. * The upload session ends either when you use the CancelUpload method or when you successfully * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods. * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes, * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload. * This method is currently available only on Office 365. * * @param uploadId The unique identifier of the upload session. * @param fragment The file contents. * @returns The size of the total uploaded data in bytes. */ protected startUpload(uploadId: string, fragment: ArrayBuffer | Blob): Promise; /** * Continues the chunk upload session with an additional fragment. * The current file content is not changed. * Use the uploadId value that was passed to the StartUpload method that started the upload session. * This method is currently available only on Office 365. * * @param uploadId The unique identifier of the upload session. * @param fileOffset The size of the offset into the file where the fragment starts. * @param fragment The file contents. * @returns The size of the total uploaded data in bytes. */ protected continueUpload(uploadId: string, fileOffset: number, fragment: ArrayBuffer | Blob): Promise; /** * Uploads the last file fragment and commits the file. The current file content is changed when this method completes. * Use the uploadId value that was passed to the StartUpload method that started the upload session. * This method is currently available only on Office 365. * * @param uploadId The unique identifier of the upload session. * @param fileOffset The size of the offset into the file where the fragment starts. * @param fragment The file contents. * @returns The newly uploaded file. */ protected finishUpload(uploadId: string, fileOffset: number, fragment: ArrayBuffer | Blob): Promise; } /** * Describes a collection of Version objects * */ export class Versions extends SharePointQueryableCollection { /** * Creates a new instance of the File class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a version by id * * @param versionId The id of the version to retrieve */ getById(versionId: number): Version; /** * Deletes all the file version objects in the collection. * */ deleteAll(): Promise; /** * Deletes the specified version of the file. * * @param versionId The ID of the file version to delete. */ deleteById(versionId: number): Promise; /** * Recycles the specified version of the file. * * @param versionId The ID of the file version to delete. */ recycleByID(versionId: number): Promise; /** * Deletes the file version object with the specified version label. * * @param label The version label of the file version to delete, for example: 1.2 */ deleteByLabel(label: string): Promise; /** * REcycles the file version object with the specified version label. * * @param label The version label of the file version to delete, for example: 1.2 */ recycleByLabel(label: string): Promise; /** * Creates a new file version from the file specified by the version label. * * @param label The version label of the file version to restore, for example: 1.2 */ restoreByLabel(label: string): Promise; } /** * Describes a single Version instance * */ export class Version extends SharePointQueryableInstance { /** * Delete a specific version of a file. * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Opens the file as a stream. */ openBinaryStream(): Promise; } export enum CheckinType { Minor = 0, Major = 1, Overwrite = 2, } export interface FileAddResult { file: File; data: any; } export enum WebPartsPersonalizationScope { User = 0, Shared = 1, } export enum MoveOperations { Overwrite = 1, AllowBrokenThickets = 8, } export enum TemplateFileType { StandardPage = 0, WikiPage = 1, FormPage = 2, ClientSidePage = 3, } } declare module "sharepoint/folders" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { SharePointQueryableShareableFolder } from "sharepoint/sharepointqueryableshareable"; import { Files } from "sharepoint/files"; import { TypedHash } from "collections/collections"; import { Item } from "sharepoint/items"; /** * Describes a collection of Folder objects * */ export class Folders extends SharePointQueryableCollection { /** * Creates a new instance of the Folders class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a folder by folder name * */ getByName(name: string): Folder; /** * Adds a new folder to the current folder (relative) or any folder (absolute) * * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute. * @returns The new Folder and the raw response. */ add(url: string): Promise; } /** * Describes a single Folder instance * */ export class Folder extends SharePointQueryableShareableFolder { /** * Specifies the sequence in which content types are displayed. * */ readonly contentTypeOrder: SharePointQueryableCollection; /** * Gets this folder's files * */ readonly files: Files; /** * Gets this folder's sub folders * */ readonly folders: Folders; /** * Gets this folder's list item field values * */ readonly listItemAllFields: SharePointQueryableCollection; /** * Gets the parent folder, if available * */ readonly parentFolder: Folder; /** * Gets this folder's properties * */ readonly properties: SharePointQueryableInstance; /** * Gets this folder's server relative url * */ readonly serverRelativeUrl: SharePointQueryable; /** * Gets a value that specifies the content type order. * */ readonly uniqueContentTypeOrder: SharePointQueryableCollection; update(properties: TypedHash): Promise; /** * Delete this folder * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item. */ recycle(): Promise; /** * Gets the associated list item for this folder, loading the default properties */ getItem(...selects: string[]): Promise; } export interface FolderAddResult { folder: Folder; data: any; } export interface FolderUpdateResult { folder: Folder; data: any; } } declare module "sharepoint/contenttypes" { import { TypedHash } from "collections/collections"; import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; /** * Describes a collection of content types * */ export class ContentTypes extends SharePointQueryableCollection { /** * Creates a new instance of the ContentTypes class * * @param baseUrl The url or SharePointQueryable which forms the parent of this content types collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a ContentType by content type id */ getById(id: string): ContentType; /** * Adds an existing contenttype to a content type collection * * @param contentTypeId in the following format, for example: 0x010102 */ addAvailableContentType(contentTypeId: string): Promise; /** * Adds a new content type to the collection * * @param id The desired content type id for the new content type (also determines the parent content type) * @param name The name of the content type * @param description The description of the content type * @param group The group in which to add the content type * @param additionalSettings Any additional settings to provide when creating the content type * */ add(id: string, name: string, description?: string, group?: string, additionalSettings?: TypedHash): Promise; } /** * Describes a single ContentType instance * */ export class ContentType extends SharePointQueryableInstance { /** * Gets the column (also known as field) references in the content type. */ readonly fieldLinks: FieldLinks; /** * Gets a value that specifies the collection of fields for the content type. */ readonly fields: SharePointQueryableCollection; /** * Gets the parent content type of the content type. */ readonly parent: ContentType; /** * Gets a value that specifies the collection of workflow associations for the content type. */ readonly workflowAssociations: SharePointQueryableCollection; /** * Delete this content type */ delete(): Promise; } export interface ContentTypeAddResult { contentType: ContentType; data: any; } /** * Represents a collection of field link instances */ export class FieldLinks extends SharePointQueryableCollection { /** * Creates a new instance of the ContentType class * * @param baseUrl The url or SharePointQueryable which forms the parent of this content type instance */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a FieldLink by GUID id * * @param id The GUID id of the field link */ getById(id: string): FieldLink; } /** * Represents a field link instance */ export class FieldLink extends SharePointQueryableInstance { } } declare module "sharepoint/attachmentfiles" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; export interface AttachmentFileInfo { name: string; content: string | Blob | ArrayBuffer; } /** * Describes a collection of Item objects * */ export class AttachmentFiles extends SharePointQueryableCollection { /** * Creates a new instance of the AttachmentFiles class * * @param baseUrl The url or SharePointQueryable which forms the parent of this attachments collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a Attachment File by filename * * @param name The name of the file, including extension. */ getByName(name: string): AttachmentFile; /** * Adds a new attachment to the collection. Not supported for batching. * * @param name The name of the file, including extension. * @param content The Base64 file content. */ add(name: string, content: string | Blob | ArrayBuffer): Promise; /** * Adds multiple new attachment to the collection. Not supported for batching. * * @files name The collection of files to add */ addMultiple(files: AttachmentFileInfo[]): Promise; /** * Delete multiple attachments from the collection. Not supported for batching. * * @files name The collection of files to delete */ deleteMultiple(...files: string[]): Promise; /** * Delete multiple attachments from the collection and sends it to recycle bin. Not supported for batching. * * @files name The collection of files to delete */ recycleMultiple(...files: string[]): Promise; } /** * Describes a single attachment file instance * */ export class AttachmentFile extends SharePointQueryableInstance { /** * Gets the contents of the file as text * */ getText(): Promise; /** * Gets the contents of the file as a blob, does not work in Node.js * */ getBlob(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js */ getBuffer(): Promise; /** * Gets the contents of a file as an ArrayBuffer, works in Node.js */ getJSON(): Promise; /** * Sets the content of a file. Not supported for batching * * @param content The value to set for the file contents */ setContent(content: string | ArrayBuffer | Blob): Promise; /** * Delete this attachment file * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Delete this attachment file and send it to Recycle Bin * * @param eTag Value used in the IF-Match header, by default "*" */ recycle(eTag?: string): Promise; } export interface AttachmentFileAddResult { file: AttachmentFile; data: any; } } declare module "sharepoint/items" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { SharePointQueryableShareableItem } from "sharepoint/sharepointqueryableshareable"; import { Folder } from "sharepoint/folders"; import { File } from "sharepoint/files"; import { ContentType } from "sharepoint/contenttypes"; import { TypedHash } from "collections/collections"; import { ListItemFormUpdateValue } from "sharepoint/types"; import { AttachmentFiles } from "sharepoint/attachmentfiles"; /** * Describes a collection of Item objects * */ export class Items extends SharePointQueryableCollection { /** * Creates a new instance of the Items class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets an Item by id * * @param id The integer id of the item to retrieve */ getById(id: number): Item; /** * Gets BCS Item by string id * * @param stringId The string id of the BCS item to retrieve */ getItemByStringId(stringId: string): Item; /** * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6) * * @param skip The starting id where the page should start, use with top to specify pages * @param reverse It true the PagedPrev=true parameter is added allowing backwards navigation in the collection */ skip(skip: number, reverse?: boolean): this; /** * Gets a collection designed to aid in paging through data * */ getPaged(): Promise>; /** * Gets all the items in a list, regardless of count. Does not support batching or caching * * @param requestSize Number of items to return in each request (Default: 2000) */ getAll(requestSize?: number): Promise; /** * Adds a new item to the collection * * @param properties The new items's properties */ add(properties?: TypedHash, listItemEntityTypeFullName?: string): Promise; /** * Ensures we have the proper list item entity type name, either from the value provided or from the list * * @param candidatelistItemEntityTypeFullName The potential type name */ private ensureListItemEntityTypeName(candidatelistItemEntityTypeFullName); } /** * Descrines a single Item instance * */ export class Item extends SharePointQueryableShareableItem { /** * Gets the set of attachments for this item * */ readonly attachmentFiles: AttachmentFiles; /** * Gets the content type for this item * */ readonly contentType: ContentType; /** * Gets the effective base permissions for the item * */ readonly effectiveBasePermissions: SharePointQueryable; /** * Gets the effective base permissions for the item in a UI context * */ readonly effectiveBasePermissionsForUI: SharePointQueryable; /** * Gets the field values for this list item in their HTML representation * */ readonly fieldValuesAsHTML: SharePointQueryableInstance; /** * Gets the field values for this list item in their text representation * */ readonly fieldValuesAsText: SharePointQueryableInstance; /** * Gets the field values for this list item for use in editing controls * */ readonly fieldValuesForEdit: SharePointQueryableInstance; /** * Gets the folder associated with this list item (if this item represents a folder) * */ readonly folder: Folder; /** * Gets the folder associated with this list item (if this item represents a folder) * */ readonly file: File; /** * Gets the collection of versions associated with this item */ readonly versions: ItemVersions; /** * Updates this list intance with the supplied properties * * @param properties A plain object hash of values to update for the list * @param eTag Value used in the IF-Match header, by default "*" */ update(properties: TypedHash, eTag?: string, listItemEntityTypeFullName?: string): Promise; /** * Delete this item * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item. */ recycle(): Promise; /** * Gets a string representation of the full URL to the WOPI frame. * If there is no associated WOPI application, or no associated action, an empty string is returned. * * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview */ getWopiFrameUrl(action?: number): Promise; /** * Validates and sets the values of the specified collection of fields for the list item. * * @param formValues The fields to change and their new values. * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false. */ validateUpdateListItem(formValues: ListItemFormUpdateValue[], newDocumentUpdate?: boolean): Promise; /** * Ensures we have the proper list item entity type name, either from the value provided or from the list * * @param candidatelistItemEntityTypeFullName The potential type name */ private ensureListItemEntityTypeName(candidatelistItemEntityTypeFullName); } export interface ItemAddResult { item: Item; data: any; } export interface ItemUpdateResult { item: Item; data: ItemUpdateResultData; } export interface ItemUpdateResultData { "odata.etag": string; } /** * Provides paging functionality for list items */ export class PagedItemCollection { private nextUrl; results: T; constructor(nextUrl: string, results: T); /** * If true there are more results available in the set, otherwise there are not */ readonly hasNext: boolean; /** * Gets the next set of results, or resolves to null if no results are available */ getNext(): Promise>; } /** * Describes a collection of Version objects * */ export class ItemVersions extends SharePointQueryableCollection { /** * Creates a new instance of the File class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a version by id * * @param versionId The id of the version to retrieve */ getById(versionId: number): ItemVersion; } /** * Describes a single Version instance * */ export class ItemVersion extends SharePointQueryableInstance { /** * Delete a specific version of a file. * * @param eTag Value used in the IF-Match header, by default "*" */ delete(): Promise; } } declare module "sharepoint/views" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { TypedHash } from "collections/collections"; /** * Describes the views available in the current context * */ export class Views extends SharePointQueryableCollection { /** * Creates a new instance of the Views class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a view by guid id * * @param id The GUID id of the view */ getById(id: string): View; /** * Gets a view by title (case-sensitive) * * @param title The case-sensitive title of the view */ getByTitle(title: string): View; /** * Adds a new view to the collection * * @param title The new views's title * @param personalView True if this is a personal view, otherwise false, default = false * @param additionalSettings Will be passed as part of the view creation body */ add(title: string, personalView?: boolean, additionalSettings?: TypedHash): Promise; } /** * Describes a single View instance * */ export class View extends SharePointQueryableInstance { readonly fields: ViewFields; /** * Updates this view intance with the supplied properties * * @param properties A plain object hash of values to update for the view */ update(properties: TypedHash): Promise; /** * Delete this view * */ delete(): Promise; /** * Returns the list view as HTML. * */ renderAsHtml(): Promise; } export class ViewFields extends SharePointQueryableCollection { constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a value that specifies the XML schema that represents the collection. */ getSchemaXml(): Promise; /** * Adds the field with the specified field internal name or display name to the collection. * * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add. */ add(fieldTitleOrInternalName: string): Promise; /** * Moves the field with the specified field internal name to the specified position in the collection. * * @param fieldInternalName The case-sensitive internal name of the field to move. * @param index The zero-based index of the new position for the field. */ move(fieldInternalName: string, index: number): Promise; /** * Removes all the fields from the collection. */ removeAll(): Promise; /** * Removes the field with the specified field internal name from the collection. * * @param fieldInternalName The case-sensitive internal name of the field to remove from the view. */ remove(fieldInternalName: string): Promise; } export interface ViewAddResult { view: View; data: any; } export interface ViewUpdateResult { view: View; data: any; } } declare module "sharepoint/fields" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { TypedHash } from "collections/collections"; import { XmlSchemaFieldCreationInformation, FieldCreationProperties, DateTimeFieldFormatType, FieldTypes, CalendarType, UrlFieldFormatType, FieldUserSelectionMode, ChoiceFieldFormatType } from "sharepoint/types"; /** * Describes a collection of Field objects * */ export class Fields extends SharePointQueryableCollection { /** * Creates a new instance of the Fields class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a field from the collection by title * * @param title The case-sensitive title of the field */ getByTitle(title: string): Field; /** * Gets a field from the collection by using internal name or title * * @param name The case-sensitive internal name or title of the field */ getByInternalNameOrTitle(name: string): Field; /** * Gets a list from the collection by guid id * * @param id The Id of the list */ getById(id: string): Field; /** * Creates a field based on the specified schema */ createFieldAsXml(xml: string | XmlSchemaFieldCreationInformation): Promise; /** * Adds a new field to the collection * * @param title The new field's title * @param fieldType The new field's type (ex: SP.FieldText) * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ add(title: string, fieldType: string, properties: FieldCreationProperties & { FieldTypeKind: number; }): Promise; /** * Adds a new SP.FieldText to the collection * * @param title The field title * @param maxLength The maximum number of characters allowed in the value of the field. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addText(title: string, maxLength?: number, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldCalculated to the collection * * @param title The field title. * @param formula The formula for the field. * @param dateFormat The date and time format that is displayed in the field. * @param outputType Specifies the output format for the field. Represents a FieldType value. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addCalculated(title: string, formula: string, dateFormat: DateTimeFieldFormatType, outputType?: FieldTypes, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldDateTime to the collection * * @param title The field title * @param displayFormat The format of the date and time that is displayed in the field. * @param calendarType Specifies the calendar type of the field. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addDateTime(title: string, displayFormat?: DateTimeFieldFormatType, calendarType?: CalendarType, friendlyDisplayFormat?: number, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldNumber to the collection * * @param title The field title * @param minValue The field's minimum value * @param maxValue The field's maximum value * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addNumber(title: string, minValue?: number, maxValue?: number, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldCurrency to the collection * * @param title The field title * @param minValue The field's minimum value * @param maxValue The field's maximum value * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addCurrency(title: string, minValue?: number, maxValue?: number, currencyLocalId?: number, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldMultiLineText to the collection * * @param title The field title * @param numberOfLines Specifies the number of lines of text to display for the field. * @param richText Specifies whether the field supports rich formatting. * @param restrictedMode Specifies whether the field supports a subset of rich formatting. * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms. * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) * */ addMultilineText(title: string, numberOfLines?: number, richText?: boolean, restrictedMode?: boolean, appendOnly?: boolean, allowHyperlink?: boolean, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldUrl to the collection * * @param title The field title */ addUrl(title: string, displayFormat?: UrlFieldFormatType, properties?: FieldCreationProperties): Promise; /** * Adds a user field to the colleciton * * @param title The new field's title * @param selectionMode The selection mode of the field * @param selectionGroup Value that specifies the identifier of the SharePoint group whose members can be selected as values of the field * @param properties */ addUser(title: string, selectionMode: FieldUserSelectionMode, properties?: FieldCreationProperties): Promise; /** * Adds a SP.FieldLookup to the collection * * @param title The new field's title * @param lookupListId The guid id of the list where the source of the lookup is found * @param lookupFieldName The internal name of the field in the source list * @param properties Set of additional properties to set on the new field */ addLookup(title: string, lookupListId: string, lookupFieldName: string, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldChoice to the collection * * @param title The field title. * @param choices The choices for the field. * @param format The display format of the available options for the field. * @param fillIn Specifies whether the field allows fill-in values. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addChoice(title: string, choices: string[], format?: ChoiceFieldFormatType, fillIn?: boolean, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldMultiChoice to the collection * * @param title The field title. * @param choices The choices for the field. * @param fillIn Specifies whether the field allows fill-in values. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addMultiChoice(title: string, choices: string[], fillIn?: boolean, properties?: FieldCreationProperties): Promise; /** * Adds a new SP.FieldBoolean to the collection * * @param title The field title. * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) */ addBoolean(title: string, properties?: FieldCreationProperties): Promise; } /** * Describes a single of Field instance * */ export class Field extends SharePointQueryableInstance { /** * Updates this field intance with the supplied properties * * @param properties A plain object hash of values to update for the list * @param fieldType The type value, required to update child field type properties */ update(properties: TypedHash, fieldType?: string): Promise; /** * Delete this fields * */ delete(): Promise; /** * Sets the value of the ShowInDisplayForm property for this field. */ setShowInDisplayForm(show: boolean): Promise; /** * Sets the value of the ShowInEditForm property for this field. */ setShowInEditForm(show: boolean): Promise; /** * Sets the value of the ShowInNewForm property for this field. */ setShowInNewForm(show: boolean): Promise; } /** * This interface defines the result of adding a field */ export interface FieldAddResult { data: any; field: Field; } export interface FieldUpdateResult { data: any; field: Field; } } declare module "sharepoint/forms" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; /** * Describes a collection of Field objects * */ export class Forms extends SharePointQueryableCollection { /** * Creates a new instance of the Fields class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a form by id * * @param id The guid id of the item to retrieve */ getById(id: string): Form; } /** * Describes a single of Form instance * */ export class Form extends SharePointQueryableInstance { } } declare module "sharepoint/subscriptions" { import { SharePointQueryable, SharePointQueryableCollection, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; /** * Describes a collection of webhook subscriptions * */ export class Subscriptions extends SharePointQueryableCollection { /** * Creates a new instance of the Subscriptions class * * @param baseUrl - The url or SharePointQueryable which forms the parent of this webhook subscriptions collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Returns all the webhook subscriptions or the specified webhook subscription * * @param subscriptionId The id of a specific webhook subscription to retrieve, omit to retrieve all the webhook subscriptions */ getById(subscriptionId: string): Subscription; /** * Creates a new webhook subscription * * @param notificationUrl The url to receive the notifications * @param expirationDate The date and time to expire the subscription in the form YYYY-MM-ddTHH:mm:ss+00:00 (maximum of 6 months) * @param clientState A client specific string (defaults to pnp-js-core-subscription when omitted) */ add(notificationUrl: string, expirationDate: string, clientState?: string): Promise; } /** * Describes a single webhook subscription instance * */ export class Subscription extends SharePointQueryableInstance { /** * Renews this webhook subscription * * @param expirationDate The date and time to expire the subscription in the form YYYY-MM-ddTHH:mm:ss+00:00 (maximum of 6 months) */ update(expirationDate: string): Promise; /** * Removes this webhook subscription * */ delete(): Promise; } export interface SubscriptionAddResult { subscription: Subscription; data: any; } export interface SubscriptionUpdateResult { subscription: Subscription; data: any; } } declare module "sharepoint/usercustomactions" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { TypedHash } from "collections/collections"; /** * Describes a collection of user custom actions * */ export class UserCustomActions extends SharePointQueryableCollection { /** * Creates a new instance of the UserCustomActions class * * @param baseUrl The url or SharePointQueryable which forms the parent of this user custom actions collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Returns the user custom action with the specified id * * @param id The GUID id of the user custom action to retrieve */ getById(id: string): UserCustomAction; /** * Creates a user custom action * * @param properties The information object of property names and values which define the new user custom action * */ add(properties: TypedHash): Promise; /** * Deletes all user custom actions in the collection * */ clear(): Promise; } /** * Describes a single user custom action * */ export class UserCustomAction extends SharePointQueryableInstance { /** * Updates this user custom action with the supplied properties * * @param properties An information object of property names and values to update for this user custom action */ update(properties: TypedHash): Promise; /** * Removes this user custom action * */ delete(): Promise; } /** * Result from adding a user custom action * */ export interface UserCustomActionAddResult { data: any; action: UserCustomAction; } /** * Result from udating a user custom action * */ export interface UserCustomActionUpdateResult { data: any; action: UserCustomAction; } } declare module "sharepoint/lists" { import { Items } from "sharepoint/items"; import { Views, View } from "sharepoint/views"; import { ContentTypes } from "sharepoint/contenttypes"; import { Fields } from "sharepoint/fields"; import { Forms } from "sharepoint/forms"; import { Subscriptions } from "sharepoint/subscriptions"; import { SharePointQueryable, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { SharePointQueryableSecurable } from "sharepoint/sharepointqueryablesecurable"; import { TypedHash } from "collections/collections"; import { ControlMode, RenderListData, ChangeQuery, CamlQuery, ChangeLogitemQuery, ListFormData, RenderListDataParameters } from "sharepoint/types"; import { UserCustomActions } from "sharepoint/usercustomactions"; import { Folder } from "sharepoint/folders"; /** * Describes a collection of List objects * */ export class Lists extends SharePointQueryableCollection { /** * Creates a new instance of the Lists class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a list from the collection by title * * @param title The title of the list */ getByTitle(title: string): List; /** * Gets a list from the collection by guid id * * @param id The Id of the list (GUID) */ getById(id: string): List; /** * Adds a new list to the collection * * @param title The new list's title * @param description The new list's description * @param template The list template value * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled * @param additionalSettings Will be passed as part of the list creation body */ add(title: string, description?: string, template?: number, enableContentTypes?: boolean, additionalSettings?: TypedHash): Promise; /** * Ensures that the specified list exists in the collection (note: this method not supported for batching) * * @param title The new list's title * @param description The new list's description * @param template The list template value * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list */ ensure(title: string, description?: string, template?: number, enableContentTypes?: boolean, additionalSettings?: TypedHash): Promise; /** * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages. */ ensureSiteAssetsLibrary(): Promise; /** * Gets a list that is the default location for wiki pages. */ ensureSitePagesLibrary(): Promise; } /** * Describes a single List instance * */ export class List extends SharePointQueryableSecurable { /** * Gets the content types in this list * */ readonly contentTypes: ContentTypes; /** * Gets the items in this list * */ readonly items: Items; /** * Gets the views in this list * */ readonly views: Views; /** * Gets the fields in this list * */ readonly fields: Fields; /** * Gets the forms in this list * */ readonly forms: Forms; /** * Gets the default view of this list * */ readonly defaultView: View; /** * Get all custom actions on a site collection * */ readonly userCustomActions: UserCustomActions; /** * Gets the effective base permissions of this list * */ readonly effectiveBasePermissions: SharePointQueryable; /** * Gets the event receivers attached to this list * */ readonly eventReceivers: SharePointQueryableCollection; /** * Gets the related fields of this list * */ readonly relatedFields: SharePointQueryable; /** * Gets the IRM settings for this list * */ readonly informationRightsManagementSettings: SharePointQueryable; /** * Gets the webhook subscriptions of this list * */ readonly subscriptions: Subscriptions; /** * The root folder of the list */ readonly rootFolder: Folder; /** * Gets a view by view guid id * */ getView(viewId: string): View; /** * Updates this list intance with the supplied properties * * @param properties A plain object hash of values to update for the list * @param eTag Value used in the IF-Match header, by default "*" */ update(properties: TypedHash, eTag?: string): Promise; /** * Delete this list * * @param eTag Value used in the IF-Match header, by default "*" */ delete(eTag?: string): Promise; /** * Returns the collection of changes from the change log that have occurred within the list, based on the specified query. */ getChanges(query: ChangeQuery): Promise; /** * Returns a collection of items from the list based on the specified query. * * @param CamlQuery The Query schema of Collaborative Application Markup * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation * to define queries against list data. * see: * * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx * * @param expands A URI with a $expand System Query Option indicates that Entries associated with * the Entry or Collection of Entries identified by the Resource Path * section of the URI must be represented inline (i.e. eagerly loaded). * see: * * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx * * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption */ getItemsByCAMLQuery(query: CamlQuery, ...expands: string[]): Promise; /** * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx */ getListItemChangesSinceToken(query: ChangeLogitemQuery): Promise; /** * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item. */ recycle(): Promise; /** * Renders list data based on the view xml provided */ renderListData(viewXml: string): Promise; /** * Returns the data for the specified query view * * @param parameters The parameters to be used to render list data as JSON string. * @param overrideParameters The parameters that are used to override and extend the regular SPRenderListDataParameters. */ renderListDataAsStream(parameters: RenderListDataParameters, overrideParameters?: any): Promise; /** * Gets the field values and field schema attributes for a list item. */ renderListFormData(itemId: number, formId: string, mode: ControlMode): Promise; /** * Reserves a list item ID for idempotent list item creation. */ reserveListItemId(): Promise; /** * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching. * */ getListItemEntityTypeFullName(): Promise; } export interface ListAddResult { list: List; data: any; } export interface ListUpdateResult { list: List; data: any; } export interface ListEnsureResult { list: List; created: boolean; data: any; } } declare module "sharepoint/navigation" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { MenuNodeCollection } from "sharepoint/types"; /** * Result from adding a navigation node * */ export interface NavigationNodeAddResult { data: any; node: NavigationNode; } /** * Represents a collection of navigation nodes * */ export class NavigationNodes extends SharePointQueryableCollection { /** * Gets a navigation node by id * * @param id The id of the node */ getById(id: number): NavigationNode; /** * Adds a new node to the collection * * @param title Display name of the node * @param url The url of the node * @param visible If true the node is visible, otherwise it is hidden (default: true) */ add(title: string, url: string, visible?: boolean): Promise; /** * Moves a node to be after another node in the navigation * * @param nodeId Id of the node to move * @param previousNodeId Id of the node after which we move the node specified by nodeId */ moveAfter(nodeId: number, previousNodeId: number): Promise; } /** * Represents an instance of a navigation node * */ export class NavigationNode extends SharePointQueryableInstance { /** * Represents the child nodes of this node */ readonly children: NavigationNodes; /** * Deletes this node and any child nodes */ delete(): Promise; } /** * Exposes the navigation components * */ export class Navigation extends SharePointQueryable { /** * Creates a new instance of the Navigation class * * @param baseUrl The url or SharePointQueryable which forms the parent of these navigation components */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets the quicklaunch navigation nodes for the current context * */ readonly quicklaunch: NavigationNodes; /** * Gets the top bar navigation nodes for the current context * */ readonly topNavigationBar: NavigationNodes; } export interface INavigationService { getMenuState(menuNodeKey?: string, depth?: number, mapProviderName?: string, customProperties?: string): Promise; getMenuNodeKey(currentUrl: string, mapProviderName?: string): Promise; } /** * Represents the top level navigation service */ export class NavigationService extends SharePointQueryable implements INavigationService { constructor(path?: string); /** * The MenuState service operation returns a Menu-State (dump) of a SiteMapProvider on a site. * * @param menuNodeKey MenuNode.Key of the start node within the SiteMapProvider If no key is provided the SiteMapProvider.RootNode will be the root of the menu state. * @param depth Depth of the dump. If no value is provided a dump with the depth of 10 is returned * @param mapProviderName The name identifying the SiteMapProvider to be used * @param customProperties comma seperated list of custom properties to be returned. */ getMenuState(menuNodeKey?: string, depth?: number, mapProviderName?: string, customProperties?: string): Promise; /** * Tries to get a SiteMapNode.Key for a given URL within a site collection. * * @param currentUrl A url representing the SiteMapNode * @param mapProviderName The name identifying the SiteMapProvider to be used */ getMenuNodeKey(currentUrl: string, mapProviderName?: string): Promise; } } declare module "sharepoint/regionalsettings" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; /** * Describes regional settings ODada object */ export class RegionalSettings extends SharePointQueryableInstance { /** * Creates a new instance of the RegionalSettings class * * @param baseUrl The url or SharePointQueryable which forms the parent of this regional settings collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets the collection of languages used in a server farm. */ readonly installedLanguages: InstalledLanguages; /** * Gets the collection of language packs that are installed on the server. */ readonly globalInstalledLanguages: InstalledLanguages; /** * Gets time zone */ readonly timeZone: TimeZone; /** * Gets time zones */ readonly timeZones: TimeZones; } /** * Describes installed languages ODada queriable collection */ export class InstalledLanguages extends SharePointQueryableCollection { constructor(baseUrl: string | SharePointQueryable, path?: string); } /** * Describes TimeZone ODada object */ export class TimeZone extends SharePointQueryableInstance { constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets an Local Time by UTC Time * * @param utcTime UTC Time as Date or ISO String */ utcToLocalTime(utcTime: string | Date): Promise; /** * Gets an UTC Time by Local Time * * @param localTime Local Time as Date or ISO String */ localTimeToUTC(localTime: string | Date): Promise; } /** * Describes time zones queriable collection */ export class TimeZones extends SharePointQueryableCollection { constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets an TimeZone by id * * @param id The integer id of the timezone to retrieve */ getById(id: number): Promise; } } declare module "sharepoint/features" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; /** * Describes a collection of List objects * */ export class Features extends SharePointQueryableCollection { /** * Creates a new instance of the Lists class * * @param baseUrl The url or SharePointQueryable which forms the parent of this fields collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets a list from the collection by guid id * * @param id The Id of the feature (GUID) */ getById(id: string): Feature; /** * Adds a new list to the collection * * @param id The Id of the feature (GUID) * @param force If true the feature activation will be forced */ add(id: string, force?: boolean): Promise; /** * Removes (deactivates) a feature from the collection * * @param id The Id of the feature (GUID) * @param force If true the feature deactivation will be forced */ remove(id: string, force?: boolean): Promise; } export class Feature extends SharePointQueryableInstance { /** * Removes (deactivates) a feature from the collection * * @param force If true the feature deactivation will be forced */ deactivate(force?: boolean): Promise; } export interface FeatureAddResult { data: any; feature: Feature; } } declare module "sharepoint/relateditems" { import { SharePointQueryable } from "sharepoint/sharepointqueryable"; export interface RelatedItem { ListId: string; ItemId: number; Url: string; Title: string; WebId: string; IconUrl: string; } export interface RelatedItemManger { getRelatedItems(sourceListName: string, sourceItemId: number): Promise; getPageOneRelatedItems(sourceListName: string, sourceItemId: number): Promise; addSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemID: number, targetWebUrl: string, tryAddReverseLink?: boolean): Promise; /** * Adds a related item link from an item specified by list name and item id, to an item specified by url * * @param sourceListName The source list name or list id * @param sourceItemId The source item id * @param targetItemUrl The target item url * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) */ addSingleLinkToUrl(sourceListName: string, sourceItemId: number, targetItemUrl: string, tryAddReverseLink?: boolean): Promise; /** * Adds a related item link from an item specified by url, to an item specified by list name and item id * * @param sourceItemUrl The source item url * @param targetListName The target list name or list id * @param targetItemId The target item id * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) */ addSingleLinkFromUrl(sourceItemUrl: string, targetListName: string, targetItemId: number, tryAddReverseLink?: boolean): Promise; deleteSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemId: number, targetWebUrl: string, tryDeleteReverseLink?: boolean): Promise; } export class RelatedItemManagerImpl extends SharePointQueryable implements RelatedItemManger { static FromUrl(url: string): RelatedItemManagerImpl; constructor(baseUrl: string | SharePointQueryable, path?: string); getRelatedItems(sourceListName: string, sourceItemId: number): Promise; getPageOneRelatedItems(sourceListName: string, sourceItemId: number): Promise; addSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemID: number, targetWebUrl: string, tryAddReverseLink?: boolean): Promise; /** * Adds a related item link from an item specified by list name and item id, to an item specified by url * * @param sourceListName The source list name or list id * @param sourceItemId The source item id * @param targetItemUrl The target item url * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) */ addSingleLinkToUrl(sourceListName: string, sourceItemId: number, targetItemUrl: string, tryAddReverseLink?: boolean): Promise; /** * Adds a related item link from an item specified by url, to an item specified by list name and item id * * @param sourceItemUrl The source item url * @param targetListName The target list name or list id * @param targetItemId The target item id * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) */ addSingleLinkFromUrl(sourceItemUrl: string, targetListName: string, targetItemId: number, tryAddReverseLink?: boolean): Promise; deleteSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemId: number, targetWebUrl: string, tryDeleteReverseLink?: boolean): Promise; } } declare module "sharepoint/appcatalog" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { File } from "sharepoint/files"; /** * Represents an app catalog */ export class AppCatalog extends SharePointQueryableCollection { constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Get details of specific app from the app catalog * @param id - Specify the guid of the app */ getAppById(id: string): App; /** * Uploads an app package. Not supported for batching * * @param filename Filename to create. * @param content app package data (eg: the .app or .sppkg file). * @param shouldOverWrite Should an app with the same name in the same location be overwritten? (default: true) * @returns Promise */ add(filename: string, content: string | ArrayBuffer | Blob, shouldOverWrite?: boolean): Promise; } /** * Represents the actions you can preform on a given app within the catalog */ export class App extends SharePointQueryableInstance { /** * This method deploys an app on the app catalog. It must be called in the context * of the tenant app catalog web or it will fail. */ deploy(): Promise; /** * This method retracts a deployed app on the app catalog. It must be called in the context * of the tenant app catalog web or it will fail. */ retract(): Promise; /** * This method allows an app which is already deployed to be installed on a web */ install(): Promise; /** * This method allows an app which is already insatlled to be uninstalled on a web */ uninstall(): Promise; /** * This method allows an app which is already insatlled to be upgraded on a web */ upgrade(): Promise; /** * This method removes an app from the app catalog. It must be called in the context * of the tenant app catalog web or it will fail. */ remove(): Promise; } export interface AppAddResult { data: any; file: File; } } declare module "sharepoint/clientsidepages" { import { List } from "sharepoint/lists"; import { File } from "sharepoint/files"; import { ItemUpdateResult } from "sharepoint/items"; import { TypedHash } from "collections/collections"; /** * Page promotion state */ export const enum PromotedState { /** * Regular client side page */ NotPromoted = 0, /** * Page that will be promoted as news article after publishing */ PromoteOnPublish = 1, /** * Page that is promoted as news article */ Promoted = 2, } /** * Type describing the available page layout types for client side "modern" pages */ export type ClientSidePageLayoutType = "Article" | "Home"; /** * Column size factor. Max value is 12 (= one column), other options are 8,6,4 or 0 */ export type CanvasColumnFactorType = 0 | 2 | 4 | 6 | 8 | 12; /** * Represents the data and methods associated with client side "modern" pages */ export class ClientSidePage extends File { sections: CanvasSection[]; commentsDisabled: boolean; /** * Creates a new blank page within the supplied library * * @param library The library in which to create the page * @param pageName Filename of the page, such as "page.aspx" * @param title The display title of the page * @param pageLayoutType Layout type of the page to use */ static create(library: List, pageName: string, title: string, pageLayoutType?: ClientSidePageLayoutType): Promise; /** * Creates a new ClientSidePage instance from the provided html content string * * @param html HTML markup representing the page */ static fromFile(file: File): Promise; /** * Converts a json object to an escaped string appropriate for use in attributes when storing client-side controls * * @param json The json object to encode into a string */ static jsonToEscapedString(json: any): string; /** * Converts an escaped string from a client-side control attribute to a json object * * @param escapedString */ static escapedStringToJson(escapedString: string): T; /** * Creates a new instance of the ClientSidePage class * * @param baseUrl The url or SharePointQueryable which forms the parent of this web collection * @param commentsDisabled Indicates if comments are disabled, not valid until load is called */ constructor(file: File, sections?: CanvasSection[], commentsDisabled?: boolean); /** * Add a section to this page */ addSection(): CanvasSection; /** * Converts this page's content to html markup */ toHtml(): string; /** * Loads this page instance's content from the supplied html * * @param html html string representing the page's content */ fromHtml(html: string): this; /** * Loads this page's content from the server */ load(): Promise; /** * Persists the content changes (sections, columns, and controls) */ save(): Promise; /** * Enables comments on this page */ enableComments(): Promise; /** * Disables comments on this page */ disableComments(): Promise; /** * Finds a control by the specified instance id * * @param id Instance id of the control to find */ findControlById(id: string): T; /** * Finds a control within this page's control tree using the supplied predicate * * @param predicate Takes a control and returns true or false, if true that control is returned by findControl */ findControl(predicate: (c: CanvasControl) => boolean): T; /** * Sets the comments flag for a page * * @param on If true comments are enabled, false they are disabled */ private setCommentsOn(on); /** * Merges the control into the tree of sections and columns for this page * * @param control The control to merge */ private mergeControlToTree(control); /** * Merges the supplied column into the tree * * @param column Column to merge * @param position The position data for the column */ private mergeColumnToTree(column); /** * Updates the properties of the underlying ListItem associated with this ClientSidePage * * @param properties Set of properties to update * @param eTag Value used in the IF-Match header, by default "*" */ private updateProperties(properties, eTag?); } export class CanvasSection { page: ClientSidePage; order: number; columns: CanvasColumn[]; constructor(page: ClientSidePage, order: number, columns?: CanvasColumn[]); /** * Default column (this.columns[0]) for this section */ readonly defaultColumn: CanvasColumn; /** * Adds a new column to this section */ addColumn(factor: CanvasColumnFactorType): CanvasColumn; /** * Adds a control to the default column for this section * * @param control Control to add to the default column */ addControl(control: CanvasControl): this; toHtml(): string; } export abstract class CanvasControl { protected controlType: number; protected dataVersion: string; column: CanvasColumn; order: number; id: string; controlData: ClientSideControlData; constructor(controlType: number, dataVersion: string, column?: CanvasColumn, order?: number, id?: string, controlData?: ClientSideControlData); /** * Value of the control's "data-sp-controldata" attribute */ readonly jsonData: string; abstract toHtml(index: number): string; fromHtml(html: string): void; protected abstract getControlData(): ClientSideControlData; } export class CanvasColumn extends CanvasControl { section: CanvasSection; order: number; factor: CanvasColumnFactorType; controls: CanvasControl[]; constructor(section: CanvasSection, order: number, factor?: CanvasColumnFactorType, controls?: CanvasControl[], dataVersion?: string); addControl(control: CanvasControl): this; getControl(index: number): T; toHtml(): string; fromHtml(html: string): void; getControlData(): ClientSideControlData; } export class ClientSideText extends CanvasControl { private _text; constructor(text?: string); /** * The text markup of this control */ text: string; getControlData(): ClientSideControlData; toHtml(index: number): string; fromHtml(html: string): void; } export class ClientSideWebpart extends CanvasControl { title: string; description: string; propertieJson: TypedHash; webPartId: string; protected htmlProperties: string; protected serverProcessedContent: ServerProcessedContent; static fromComponentDef(definition: ClientSidePageComponent): ClientSideWebpart; constructor(title: string, description?: string, propertieJson?: TypedHash, webPartId?: string, htmlProperties?: string, serverProcessedContent?: ServerProcessedContent); import(component: ClientSidePageComponent): void; setProperties(properties: T): this; getProperties(): T; toHtml(index: number): string; fromHtml(html: string): void; getControlData(): ClientSideControlData; protected renderHtmlProperties(): string; protected parseJsonProperties(props: TypedHash): any; } /** * Client side webpart object (retrieved via the _api/web/GetClientSideWebParts REST call) */ export interface ClientSidePageComponent { /** * Component type for client side webpart object */ ComponentType: number; /** * Id for client side webpart object */ Id: string; /** * Manifest for client side webpart object */ Manifest: string; /** * Manifest type for client side webpart object */ ManifestType: number; /** * Name for client side webpart object */ Name: string; /** * Status for client side webpart object */ Status: number; } export interface ServerProcessedContent { searchablePlainTexts: any[]; imageSources: any[]; links: any[]; } export interface ClientSideControlPosition { controlIndex?: number; sectionFactor: CanvasColumnFactorType; sectionIndex: number; zoneIndex: number; } export interface ClientSideControlData { controlType?: number; id?: string; editorType?: string; position: ClientSideControlPosition; webPartId?: string; displayMode?: number; } export interface ClientSideWebpartData { dataVersion: string; description: string; id: string; instanceId: string; properties: any; title: string; serverProcessedContent?: ServerProcessedContent; } export module ClientSideWebpartPropertyTypes { /** * Propereties for Embed (component id: 490d7c76-1824-45b2-9de3-676421c997fa) */ interface Embed { embedCode: string; cachedEmbedCode?: string; shouldScaleWidth?: boolean; tempState?: any; } /** * Properties for Bing Map (component id: e377ea37-9047-43b9-8cdb-a761be2f8e09) */ interface BingMap { center: { altitude?: number; altitudeReference?: number; latitude: number; longitude: number; }; mapType: "aerial" | "birdseye" | "road" | "streetside"; maxNumberOfPushPins?: number; pushPins?: { location: { latitude: number; longitude: number; altitude?: number; altitudeReference?: number; }; address?: string; defaultAddress?: string; defaultTitle?: string; title?: string; }[]; shouldShowPushPinTitle?: boolean; zoomLevel?: number; } } } declare module "sharepoint/webs" { import { SharePointQueryable, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { Lists } from "sharepoint/lists"; import { Fields } from "sharepoint/fields"; import { Navigation } from "sharepoint/navigation"; import { SiteGroups, SiteGroup } from "sharepoint/sitegroups"; import { ContentTypes } from "sharepoint/contenttypes"; import { RegionalSettings } from "sharepoint/regionalsettings"; import { Folders, Folder } from "sharepoint/folders"; import { RoleDefinitions } from "sharepoint/roles"; import { File } from "sharepoint/files"; import { TypedHash } from "collections/collections"; import { ChangeQuery } from "sharepoint/types"; import { List } from "sharepoint/lists"; import { SiteUsers, SiteUser, CurrentUser, SiteUserProps } from "sharepoint/siteusers"; import { UserCustomActions } from "sharepoint/usercustomactions"; import { ODataBatch } from "sharepoint/batch"; import { Features } from "sharepoint/features"; import { SharePointQueryableShareableWeb } from "sharepoint/sharepointqueryableshareable"; import { RelatedItemManger } from "sharepoint/relateditems"; import { AppCatalog } from "sharepoint/appcatalog"; import { ClientSidePage, ClientSidePageComponent } from "sharepoint/clientsidepages"; /** * Describes a collection of webs * */ export class Webs extends SharePointQueryableCollection { /** * Creates a new instance of the Webs class * * @param baseUrl The url or SharePointQueryable which forms the parent of this web collection */ constructor(baseUrl: string | SharePointQueryable, webPath?: string); /** * Adds a new web to the collection * * @param title The new web's title * @param url The new web's relative url * @param description The new web's description * @param template The new web's template internal name (default = STS) * @param language The locale id that specifies the new web's language (default = 1033 [English, US]) * @param inheritPermissions When true, permissions will be inherited from the new web's parent (default = true) */ add(title: string, url: string, description?: string, template?: string, language?: number, inheritPermissions?: boolean): Promise; } /** * Describes a collection of web infos * */ export class WebInfos extends SharePointQueryableCollection { /** * Creates a new instance of the WebInfos class * * @param baseUrl The url or SharePointQueryable which forms the parent of this web infos collection */ constructor(baseUrl: string | SharePointQueryable, webPath?: string); } /** * Describes a web * */ export class Web extends SharePointQueryableShareableWeb { /** * Creates a new web instance from the given url by indexing the location of the /_api/ * segment. If this is not found the method creates a new web with the entire string as * supplied. * * @param url */ static fromUrl(url: string, path?: string): Web; /** * Creates a new instance of the Web class * * @param baseUrl The url or SharePointQueryable which forms the parent of this web */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets this web's subwebs * */ readonly webs: Webs; /** * Returns a collection of objects that contain metadata about subsites of the current site in which the current user is a member. * * @param nWebTemplateFilter Specifies the site definition (default = -1) * @param nConfigurationFilter A 16-bit integer that specifies the identifier of a configuration (default = -1) */ getSubwebsFilteredForCurrentUser(nWebTemplateFilter?: number, nConfigurationFilter?: number): Webs; /** * Gets the set of all web properties from the read-only collection. */ readonly allProperties: SharePointQueryableCollection; /** * Gets a collection of WebInfos for this web's subwebs * */ readonly webinfos: WebInfos; /** * Gets the content types available in this web * */ readonly contentTypes: ContentTypes; /** * Gets the lists in this web * */ readonly lists: Lists; /** * Gets the fields in this web * */ readonly fields: Fields; /** * Gets the active features for this web * */ readonly features: Features; /** * Gets the available fields in this web * */ readonly availablefields: Fields; /** * Gets the navigation options in this web * */ readonly navigation: Navigation; /** * Gets the site users * */ readonly siteUsers: SiteUsers; /** * Gets the site groups * */ readonly siteGroups: SiteGroups; /** * Gets site user info list * */ readonly siteUserInfoList: List; /** * Gets regional settings * */ readonly regionalSettings: RegionalSettings; /** * Gets the current user */ readonly currentUser: CurrentUser; /** * Gets the top-level folders in this web * */ readonly folders: Folders; /** * Gets all user custom actions for this web * */ readonly userCustomActions: UserCustomActions; /** * Gets the effective base permissions of this web * */ readonly effectiveBasePermissions: SharePointQueryable; /** * Gets the collection of RoleDefinition resources * */ readonly roleDefinitions: RoleDefinitions; /** * Provides an interface to manage related items * */ readonly relatedItems: RelatedItemManger; /** * Creates a new batch for requests within the context of this web * */ createBatch(): ODataBatch; /** * Gets the root folder of this web * */ readonly rootFolder: Folder; /** * Gets the associated owner group for this web * */ readonly associatedOwnerGroup: SiteGroup; /** * Gets the associated member group for this web * */ readonly associatedMemberGroup: SiteGroup; /** * Gets the associated visitor group for this web * */ readonly associatedVisitorGroup: SiteGroup; /** * Gets a folder by server relative url * * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable) */ getFolderByServerRelativeUrl(folderRelativeUrl: string): Folder; /** * Gets a folder by server relative relative path if your folder name contains # and % characters * you need to first encode the file name using encodeURIComponent() and then pass the url * let url = "/sites/test/Shared Documents/" + encodeURIComponent("%123"); * This works only in SharePoint online. * * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable) */ getFolderByServerRelativePath(folderRelativeUrl: string): Folder; /** * Gets a file by server relative url * * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable) */ getFileByServerRelativeUrl(fileRelativeUrl: string): File; /** * Gets a file by server relative url if your file name contains # and % characters * you need to first encode the file name using encodeURIComponent() and then pass the url * let url = "/sites/test/Shared Documents/" + encodeURIComponent("%123.docx"); * * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable) */ getFileByServerRelativePath(fileRelativeUrl: string): File; /** * Gets a list by server relative url (list's root folder) * * @param listRelativeUrl The server relative path to the list's root folder (including /sites/ if applicable) */ getList(listRelativeUrl: string): List; /** * Updates this web instance with the supplied properties * * @param properties A plain object hash of values to update for the web */ update(properties: TypedHash): Promise; /** * Deletes this web * */ delete(): Promise; /** * Applies the theme specified by the contents of each of the files specified in the arguments to the site * * @param colorPaletteUrl The server-relative URL of the color palette file * @param fontSchemeUrl The server-relative URL of the font scheme * @param backgroundImageUrl The server-relative URL of the background image * @param shareGenerated When true, the generated theme files are stored in the root site. When false, they are stored in this web */ applyTheme(colorPaletteUrl: string, fontSchemeUrl: string, backgroundImageUrl: string, shareGenerated: boolean): Promise; /** * Applies the specified site definition or site template to the Web site that has no template applied to it * * @param template Name of the site definition or the name of the site template */ applyWebTemplate(template: string): Promise; /** * 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. * * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com) */ ensureUser(loginName: string): Promise; /** * Returns a collection of site templates available for the site * * @param language The locale id of the site templates to retrieve (default = 1033 [English, US]) * @param includeCrossLanguage When true, includes language-neutral site templates; otherwise false (default = true) */ availableWebTemplates(language?: number, includeCrossLanugage?: boolean): SharePointQueryableCollection; /** * Returns the list gallery on the site * * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114, * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125 */ getCatalog(type: number): Promise; /** * Returns the collection of changes from the change log that have occurred within the list, based on the specified query * * @param query The change query */ getChanges(query: ChangeQuery): Promise; /** * Gets the custom list templates for the site * */ readonly customListTemplate: SharePointQueryableCollection; /** * Returns the user corresponding to the specified member identifier for the current site * * @param id The id of the user */ getUserById(id: number): SiteUser; /** * Returns the name of the image file for the icon that is used to represent the specified file * * @param filename The file name. If this parameter is empty, the server returns an empty string * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1 (default = 0) * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName */ mapToIcon(filename: string, size?: number, progId?: string): Promise; /** * Returns the tenant property corresponding to the specified key in the app catalog site * * @param key */ getStorageEntity(key: string): Promise; /** * Gets the app catalog for this web * * @param url Optional url or web containing the app catalog (default: current web) */ getAppCatalog(url?: string | Web): AppCatalog; /** * Gets the collection of available client side web parts for this web instance */ getClientSideWebParts(): Promise; /** * Creates a new client side page * * @param pageName Name of the new page * @param title Display title of the new page * @param libraryTitle Title of the library in which to create the new page. Default: "Site Pages" */ addClientSidePage(pageName: string, title?: string, libraryTitle?: string): Promise; /** * Creates a new client side page using the library path * * @param pageName Name of the new page * @param listRelativePath The server relative path to the list's root folder (including /sites/ if applicable) * @param title Display title of the new page */ addClientSidePageByPath(pageName: string, listRelativePath: string, title?: string): Promise; } /** * Result from adding a web * */ export interface WebAddResult { data: any; web: Web; } /** * Result from updating a web * */ export interface WebUpdateResult { data: any; web: Web; } /** * Result from retrieving a catalog * */ export interface GetCatalogResult { data: any; list: List; } /** * Result from ensuring a user * */ export interface WebEnsureUserResult { data: SiteUserProps; user: SiteUser; } } declare module "sharepoint/site" { import { SharePointQueryable, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; import { Web } from "sharepoint/webs"; import { UserCustomActions } from "sharepoint/usercustomactions"; import { ContextInfo, DocumentLibraryInformation } from "sharepoint/types"; import { ODataBatch } from "sharepoint/batch"; import { Features } from "sharepoint/features"; /** * Describes a site collection * */ export class Site extends SharePointQueryableInstance { /** * Creates a new instance of the Site class * * @param baseUrl The url or SharePointQueryable which forms the parent of this site collection */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets the root web of the site collection * */ readonly rootWeb: Web; /** * Gets the active features for this site collection * */ readonly features: Features; /** * Gets all custom actions for this site collection * */ readonly userCustomActions: UserCustomActions; /** * Gets a Web instance representing the root web of the site collection * correctly setup for chaining within the library */ getRootWeb(): Promise; /** * Gets the context information for this site collection */ getContextInfo(): Promise; /** * Gets the document libraries on a site. Static method. (SharePoint Online only) * * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned */ getDocumentLibraries(absoluteWebUrl: string): Promise; /** * Gets the site url from a page url * * @param absolutePageUrl The absolute url of the page */ getWebUrlFromPageUrl(absolutePageUrl: string): Promise; /** * Creates a new batch for requests within the context of this site collection * */ createBatch(): ODataBatch; /** * Opens a web by id (using POST) * * @param webId The GUID id of the web to open */ openWebById(webId: string): Promise; } /** * The result of opening a web by id: contains the data returned as well as a chainable web instance */ export interface OpenWebByIdResult { data: any; web: Web; } } declare module "utils/files" { /** * Reads a blob as text * * @param blob The data to read */ export function readBlobAsText(blob: Blob): Promise; /** * Reads a blob into an array buffer * * @param blob The data to read */ export function readBlobAsArrayBuffer(blob: Blob): Promise; } declare module "sharepoint/userprofiles" { import { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection } from "sharepoint/sharepointqueryable"; import { ClientPeoplePickerQueryParameters, HashTagCollection, PeoplePickerEntity, UserProfile } from "sharepoint/types"; export class UserProfileQuery extends SharePointQueryableInstance { private clientPeoplePickerQuery; private profileLoader; /** * Creates a new instance of the UserProfileQuery class * * @param baseUrl The url or SharePointQueryable which forms the parent of this user profile query */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * The url of the edit profile page for the current user */ readonly editProfileLink: Promise; /** * A boolean value that indicates whether the current user's "People I'm Following" list is public */ readonly isMyPeopleListPublic: Promise; /** * A boolean value that indicates whether the current user is being followed by the specified user * * @param loginName The account name of the user */ amIFollowedBy(loginName: string): Promise; /** * A boolean value that indicates whether the current user is following the specified user * * @param loginName The account name of the user */ amIFollowing(loginName: string): Promise; /** * Gets tags that the current user is following * * @param maxCount The maximum number of tags to retrieve (default is 20) */ getFollowedTags(maxCount?: number): Promise; /** * Gets the people who are following the specified user * * @param loginName The account name of the user */ getFollowersFor(loginName: string): Promise; /** * Gets the people who are following the current user * */ readonly myFollowers: SharePointQueryableCollection; /** * Gets user properties for the current user * */ readonly myProperties: SharePointQueryableInstance; /** * Gets the people who the specified user is following * * @param loginName The account name of the user. */ getPeopleFollowedBy(loginName: string): Promise; /** * Gets user properties for the specified user. * * @param loginName The account name of the user. */ getPropertiesFor(loginName: string): Promise; /** * Gets the 20 most popular hash tags over the past week, sorted so that the most popular tag appears first * */ readonly trendingTags: Promise; /** * Gets the specified user profile property for the specified user * * @param loginName The account name of the user * @param propertyName The case-sensitive name of the property to get */ getUserProfilePropertyFor(loginName: string, propertyName: string): Promise; /** * Removes the specified user from the user's list of suggested people to follow * * @param loginName The account name of the user */ hideSuggestion(loginName: string): Promise; /** * A boolean values that indicates whether the first user is following the second user * * @param follower The account name of the user who might be following the followee * @param followee The account name of the user who might be followed by the follower */ isFollowing(follower: string, followee: string): Promise; /** * Uploads and sets the user profile picture (Users can upload a picture to their own profile only). Not supported for batching. * * @param profilePicSource Blob data representing the user's picture in BMP, JPEG, or PNG format of up to 4.76MB */ setMyProfilePic(profilePicSource: Blob): Promise; /** * Sets single value User Profile property * * @param accountName The account name of the user * @param propertyName Property name * @param propertyValue Property value */ setSingleValueProfileProperty(accountName: string, propertyName: string, propertyValue: string): Promise; /** * Sets multi valued User Profile property * * @param accountName The account name of the user * @param propertyName Property name * @param propertyValues Property values */ setMultiValuedProfileProperty(accountName: string, propertyName: string, propertyValues: string[]): Promise; /** * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) * * @param emails The email addresses of the users to provision sites for */ createPersonalSiteEnqueueBulk(...emails: string[]): Promise; /** * Gets the user profile of the site owner * */ readonly ownerUserProfile: Promise; /** * Gets the user profile for the current user */ readonly userProfile: Promise; /** * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files * * @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request */ createPersonalSite(interactiveRequest?: boolean): Promise; /** * Sets the privacy settings for this profile * * @param share true to make all social data public; false to make all social data private */ shareAllSocialData(share: boolean): Promise; /** * Resolves user or group using specified query parameters * * @param queryParams The query parameters used to perform resolve */ clientPeoplePickerResolveUser(queryParams: ClientPeoplePickerQueryParameters): Promise; /** * Searches for users or groups using specified query parameters * * @param queryParams The query parameters used to perform search */ clientPeoplePickerSearchUser(queryParams: ClientPeoplePickerQueryParameters): Promise; } } declare module "sharepoint/social" { import { SharePointQueryable, SharePointQueryableInstance } from "sharepoint/sharepointqueryable"; export interface SocialMethods { my: MySocialQueryMethods; getFollowedSitesUri(): Promise; getFollowedDocumentsUri(): Promise; follow(actorInfo: SocialActorInfo): Promise; isFollowed(actorInfo: SocialActorInfo): Promise; stopFollowing(actorInfo: SocialActorInfo): Promise; } /** * Exposes social following methods */ export class SocialQuery extends SharePointQueryableInstance implements SocialMethods { /** * Creates a new instance of the SocialQuery class * * @param baseUrl The url or SharePointQueryable which forms the parent of this social query */ constructor(baseUrl: string | SharePointQueryable, path?: string); readonly my: MySocialQueryMethods; /** * Gets a URI to a site that lists the current user's followed sites. */ getFollowedSitesUri(): Promise; /** * Gets a URI to a site that lists the current user's followed documents. */ getFollowedDocumentsUri(): Promise; /** * Makes the current user start following a user, document, site, or tag * * @param actorInfo The actor to start following */ follow(actorInfo: SocialActorInfo): Promise; /** * Indicates whether the current user is following a specified user, document, site, or tag * * @param actorInfo The actor to find the following status for */ isFollowed(actorInfo: SocialActorInfo): Promise; /** * Makes the current user stop following a user, document, site, or tag * * @param actorInfo The actor to stop following */ stopFollowing(actorInfo: SocialActorInfo): Promise; /** * Creates SocialActorInfo request body * * @param actorInfo The actor to create request body */ private createSocialActorInfoRequestBody(actorInfo); } /** * Defines the public methods exposed by the my endpoint */ export interface MySocialQueryMethods { /** * Gets this user's data */ get(): Promise; /** * Gets users, documents, sites, and tags that the current user is following. * * @param types Bitwise set of SocialActorTypes to retrieve */ followed(types: SocialActorTypes): Promise; /** * Gets the count of users, documents, sites, and tags that the current user is following. * * @param types Bitwise set of SocialActorTypes to retrieve */ followedCount(types: SocialActorTypes): Promise; /** * Gets the users who are following the current user. */ followers(): Promise; /** * Gets users who the current user might want to follow. */ suggestions(): Promise; } export class MySocialQuery extends SharePointQueryableInstance implements MySocialQueryMethods { /** * Creates a new instance of the SocialQuery class * * @param baseUrl The url or SharePointQueryable which forms the parent of this social query */ constructor(baseUrl: string | SharePointQueryable, path?: string); /** * Gets users, documents, sites, and tags that the current user is following. * * @param types Bitwise set of SocialActorTypes to retrieve */ followed(types: SocialActorTypes): Promise; /** * Gets the count of users, documents, sites, and tags that the current user is following. * * @param types Bitwise set of SocialActorTypes to retrieve */ followedCount(types: SocialActorTypes): Promise; /** * Gets the users who are following the current user. */ followers(): Promise; /** * Gets users who the current user might want to follow. */ suggestions(): Promise; } /** * Social actor info * */ export interface SocialActorInfo { AccountName?: string; ActorType: SocialActorType; ContentUri?: string; Id?: string; TagGuid?: string; } /** * Social actor type * */ export const enum SocialActorType { User = 0, Document = 1, Site = 2, Tag = 3, } /** * Social actor type * */ export const enum SocialActorTypes { None = 0, User = 1, Document = 2, Site = 4, Tag = 8, /** * The set excludes documents and sites that do not have feeds. */ ExcludeContentWithoutFeeds = 268435456, /** * The set includes group sites */ IncludeGroupsSites = 536870912, /** * The set includes only items created within the last 24 hours */ WithinLast24Hours = 1073741824, } /** * Result from following * */ export const enum SocialFollowResult { Ok = 0, AlreadyFollowing = 1, LimitReached = 2, InternalError = 3, } /** * Specifies an exception or status code. */ export const enum SocialStatusCode { /** * The operation completed successfully */ OK = 0, /** * The request is invalid. */ InvalidRequest = 1, /** * The current user is not authorized to perform the operation. */ AccessDenied = 2, /** * The target of the operation was not found. */ ItemNotFound = 3, /** * The operation is invalid for the target's current state. */ InvalidOperation = 4, /** * The operation completed without modifying the target. */ ItemNotModified = 5, /** * The operation failed because an internal error occurred. */ InternalError = 6, /** * The operation failed because the server could not access the distributed cache. */ CacheReadError = 7, /** * The operation succeeded but the server could not update the distributed cache. */ CacheUpdateError = 8, /** * No personal site exists for the current user, and no further information is available. */ PersonalSiteNotFound = 9, /** * No personal site exists for the current user, and a previous attempt to create one failed. */ FailedToCreatePersonalSite = 10, /** * No personal site exists for the current user, and a previous attempt to create one was not authorized. */ NotAuthorizedToCreatePersonalSite = 11, /** * No personal site exists for the current user, and no attempt should be made to create one. */ CannotCreatePersonalSite = 12, /** * The operation was rejected because an internal limit had been reached. */ LimitReached = 13, /** * The operation failed because an error occurred during the processing of the specified attachment. */ AttachmentError = 14, /** * The operation succeeded with recoverable errors; the returned data is incomplete. */ PartialData = 15, /** * A required SharePoint feature is not enabled. */ FeatureDisabled = 16, /** * The site's storage quota has been exceeded. */ StorageQuotaExceeded = 17, /** * The operation failed because the server could not access the database. */ DatabaseError = 18, } export interface SocialActor { /** * Gets the actor type. */ ActorType: SocialActorType; /** * Gets the actor's unique identifier. */ Id: string; /** * Gets the actor's canonical URI. */ Uri: string; /** * Gets the actor's display name. */ Name: string; /** * Returns true if the current user is following the actor, false otherwise. */ IsFollowed: boolean; /** * Gets a code that indicates recoverable errors that occurred during actor retrieval */ Status: SocialStatusCode; /** * Returns true if the Actor can potentially be followed, false otherwise. */ CanFollow: boolean; /** * Gets the actor's image URI. Only valid when ActorType is User, Document, or Site */ ImageUri: string; /** * Gets the actor's account name. Only valid when ActorType is User */ AccountName: string; /** * Gets the actor's email address. Only valid when ActorType is User */ EmailAddress: string; /** * Gets the actor's title. Only valid when ActorType is User */ Title: string; /** * Gets the text of the actor's most recent post. Only valid when ActorType is User */ StatusText: string; /** * Gets the URI of the actor's personal site. Only valid when ActorType is User */ PersonalSiteUri: string; /** * Gets the URI of the actor's followed content folder. Only valid when this represents the current user */ FollowedContentUri: string; /** * Gets the actor's content URI. Only valid when ActorType is Document, or Site */ ContentUri: string; /** * Gets the actor's library URI. Only valid when ActorType is Document */ LibraryUri: string; /** * Gets the actor's tag GUID. Only valid when ActorType is Tag */ TagGuid: string; } /** * Defines the properties retrurned from the my endpoint */ export interface MySocialData { SocialActor: SocialActor; MyFollowedDocumentsUri: string; MyFollowedSitesUri: string; } } declare module "sharepoint/utilities" { import { SharePointQueryable } from "sharepoint/sharepointqueryable"; import { EmailProperties } from "sharepoint/types"; import { ODataBatch } from "sharepoint/batch"; import { ICachingOptions } from "odata/caching"; import { File } from "sharepoint/files"; import { PrincipalInfo, PrincipalType, PrincipalSource, WikiPageCreationInformation } from "sharepoint/types"; /** * Public interface for the utility methods to limit SharePointQueryable method exposure */ export interface UtilityMethods { usingCaching(options?: ICachingOptions): this; inBatch(batch: ODataBatch): this; sendEmail(props: EmailProperties): Promise; getCurrentUserEmailAddresses(): Promise; resolvePrincipal(email: string, scopes: PrincipalType, sources: PrincipalSource, inputIsEmailOnly: boolean, addToUserInfoList: boolean, matchUserInfoList?: boolean): Promise; searchPrincipals(input: string, scopes: PrincipalType, sources: PrincipalSource, groupName: string, maxCount: number): Promise; createEmailBodyForInvitation(pageAddress: string): Promise; expandGroupsToPrincipals(inputs: string[], maxCount?: number): Promise; createWikiPage(info: WikiPageCreationInformation): Promise; } /** * Allows for calling of the static SP.Utilities.Utility methods by supplying the method name */ export class UtilityMethod extends SharePointQueryable implements UtilityMethods { private static getBaseUrl(candidate); /** * Creates a new instance of the Utility method class * * @param baseUrl The parent url provider * @param methodName The static method name to call on the utility class */ constructor(baseUrl: string | SharePointQueryable, methodName: string); excute(props: any): Promise; /** * Sends an email based on the supplied properties * * @param props The properties of the email to send */ sendEmail(props: EmailProperties): Promise; getCurrentUserEmailAddresses(): Promise; resolvePrincipal(input: string, scopes: PrincipalType, sources: PrincipalSource, inputIsEmailOnly: boolean, addToUserInfoList: boolean, matchUserInfoList?: boolean): Promise; searchPrincipals(input: string, scopes: PrincipalType, sources: PrincipalSource, groupName: string, maxCount: number): Promise; createEmailBodyForInvitation(pageAddress: string): Promise; expandGroupsToPrincipals(inputs: string[], maxCount?: number): Promise; createWikiPage(info: WikiPageCreationInformation): Promise; } export interface CreateWikiPageResult { data: any; file: File; } } declare module "sharepoint/rest" { import { SearchQuery, SearchResults, SearchQueryBuilder } from "sharepoint/search"; import { SearchSuggestQuery, SearchSuggestResult } from "sharepoint/searchsuggest"; import { Site } from "sharepoint/site"; import { Web } from "sharepoint/webs"; import { UserProfileQuery } from "sharepoint/userprofiles"; import { SocialMethods } from "sharepoint/social"; import { INavigationService } from "sharepoint/navigation"; import { ODataBatch } from "sharepoint/batch"; import { UtilityMethods } from "sharepoint/utilities"; import { ConfigOptions } from "net/utils"; /** * Root of the SharePoint REST module */ export class SPRest { /** * Additional options to be set before sending actual http requests */ private _options; /** * A string that should form the base part of the url */ private _baseUrl; /** * Creates a new instance of the SPRest class * * @param options Additional options * @param baseUrl A string that should form the base part of the url */ constructor(options?: ConfigOptions, baseUrl?: string); /** * Configures instance with additional options and baseUrl. * Provided configuration used by other objects in a chain * * @param options Additional options * @param baseUrl A string that should form the base part of the url */ configure(options: ConfigOptions, baseUrl?: string): SPRest; /** * Executes a search against this web context * * @param query The SearchQuery definition */ searchSuggest(query: string | SearchSuggestQuery): Promise; /** * Executes a search against this web context * * @param query The SearchQuery definition */ search(query: string | SearchQuery | SearchQueryBuilder): Promise; /** * Begins a site collection scoped REST request * */ readonly site: Site; /** * Begins a web scoped REST request * */ readonly web: Web; /** * Access to user profile methods */ readonly profiles: UserProfileQuery; /** * Access to social methods */ readonly social: SocialMethods; /** * Access to the site collection level navigation service */ readonly navigation: INavigationService; /** * Creates a new batch object for use with the SharePointQueryable.addToBatch method * */ createBatch(): ODataBatch; /** * Static utilities methods from SP.Utilities.Utility */ readonly utility: UtilityMethods; /** * Begins a cross-domain, host site scoped REST request, for use in add-in webs * * @param addInWebUrl The absolute url of the add-in web * @param hostWebUrl The absolute url of the host web */ crossDomainSite(addInWebUrl: string, hostWebUrl: string): Site; /** * Begins a cross-domain, host web scoped REST request, for use in add-in webs * * @param addInWebUrl The absolute url of the add-in web * @param hostWebUrl The absolute url of the host web */ crossDomainWeb(addInWebUrl: string, hostWebUrl: string): Web; /** * Implements the creation of cross domain REST urls * * @param factory The constructor of the object to create Site | Web * @param addInWebUrl The absolute url of the add-in web * @param hostWebUrl The absolute url of the host web * @param urlPart String part to append to the url "site" | "web" */ private _cdImpl(factory, addInWebUrl, hostWebUrl, urlPart); } } declare module "graph/graphqueryable" { import { FetchOptions } from "net/utils"; import { ODataParser } from "odata/core"; import { ODataQueryable } from "odata/queryable"; import { RequestContext } from "request/pipeline"; export interface GraphQueryableConstructor { new (baseUrl: string | GraphQueryable, path?: string): T; } /** * Queryable Base Class * */ export class GraphQueryable extends ODataQueryable { /** * Creates a new instance of the Queryable class * * @constructor * @param baseUrl A string or Queryable that should form the base part of the url * */ constructor(baseUrl: string | GraphQueryable, path?: string); /** * Creates a new instance of the supplied factory and extends this into that new instance * * @param factory constructor for the new queryable */ as(factory: GraphQueryableConstructor): T; /** * Gets the full url with query information * */ toUrlAndQuery(): string; /** * Gets a parent for this instance as specified * * @param factory The contructor for the class to create */ protected getParent(factory: GraphQueryableConstructor, baseUrl?: string | GraphQueryable, path?: string): T; /** * Clones this queryable into a new queryable instance of T * @param factory Constructor used to create the new instance * @param additionalPath Any additional path to include in the clone * @param includeBatch If true this instance's batch will be added to the cloned instance */ protected clone(factory: GraphQueryableConstructor, additionalPath?: string, includeBatch?: boolean): T; /** * Converts the current instance to a request context * * @param verb The request verb * @param options The set of supplied request options * @param parser The supplied ODataParser instance * @param pipeline Optional request processing pipeline */ protected toRequestContext(verb: string, options: FetchOptions, parser: ODataParser, pipeline?: Array<(c: RequestContext) => Promise>>): Promise>; } /** * Represents a REST collection which can be filtered, paged, and selected * */ export class GraphQueryableCollection extends GraphQueryable { /** * * @param filter The string representing the filter query */ filter(filter: string): this; /** * Choose which fields to return * * @param selects One or more fields to return */ select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ expand(...expands: string[]): this; /** * Orders based on the supplied fields ascending * * @param orderby The name of the field to sort on * @param ascending If false DESC is appended, otherwise ASC (default) */ orderBy(orderBy: string, ascending?: boolean): this; /** * Limits the query to only return the specified number of items * * @param top The query row limit */ top(top: number): this; /** * Skips a set number of items in the return set * * @param num Number of items to skip */ skip(num: number): this; /** * To request second and subsequent pages of Graph data */ skipToken(token: string): this; /** * Retrieves the total count of matching resources */ readonly count: this; } export class GraphQueryableSearchableCollection extends GraphQueryableCollection { /** * To request second and subsequent pages of Graph data */ search(query: string): this; } /** * Represents an instance that can be selected * */ export class GraphQueryableInstance extends GraphQueryable { /** * Choose which fields to return * * @param selects One or more fields to return */ select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ expand(...expands: string[]): this; } } declare module "graph/members" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; export class Members extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Use this API to add a member to an Office 365 group, a security group or a mail-enabled security group through * the members navigation property. You can add users or other groups. * Important: You can add only users to Office 365 groups. * * @param id Full @odata.id of the directoryObject, user, or group object you want to add (ex: https://graph.microsoft.com/v1.0/directoryObjects/${id}) */ add(id: string): Promise; /** * Gets a member of the group by id * * @param id Group member's id */ getById(id: string): Member; } export class Member extends GraphQueryableInstance { } export class Owners extends Members { constructor(baseUrl: string | GraphQueryable, path?: string); } } declare module "graph/calendars" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; import { TypedHash } from "collections/collections"; import { Event as IEvent } from "@microsoft/microsoft-graph-types"; export class Calendars extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); } export class Calendar extends GraphQueryableInstance { readonly events: Events; } export class Events extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); getById(id: string): Event; /** * Adds a new event to the collection * * @param properties The set of properties used to create the event */ add(properties: Event): Promise; } export interface EventAddResult { data: IEvent; event: Event; } export class Event extends GraphQueryableInstance { /** * Update the properties of an event object * * @param properties Set of properties of this event to update */ update(properties: TypedHash): Promise; /** * Deletes this event */ delete(): Promise; } } declare module "graph/attachments" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; import { Attachment as IAttachment } from "@microsoft/microsoft-graph-types"; export class Attachments extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets a member of the group by id * * @param id Attachment id */ getById(id: string): Attachment; /** * Add attachment to this collection * * @param name Name given to the attachment file * @param bytes File content */ addFile(name: string, bytes: string | Blob): Promise; } export class Attachment extends GraphQueryableInstance { } } declare module "graph/conversations" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; import { TypedHash } from "collections/collections"; import { Attachments } from "graph/attachments"; import { ConversationThread as IConversationThread, Post as IPost, Recipient as IRecipient } from "@microsoft/microsoft-graph-types"; /** * Information used to forward a post */ export interface PostForwardInfo { comment?: string; toRecipients: IRecipient[]; } export class Conversations extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Create a new conversation by including a thread and a post. * * @param properties Properties used to create the new conversation */ add(properties: TypedHash): Promise; /** * Gets a conversation from this collection by id * * @param id Group member's id */ getById(id: string): Conversation; } export class Threads extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets a thread from this collection by id * * @param id Group member's id */ getById(id: string): Thread; /** * Adds a new thread to this collection * * @param properties properties used to create the new thread * @returns Id of the new thread */ add(properties: IConversationThread): Promise<{ id: string; }>; } export class Posts extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets a thread from this collection by id * * @param id Group member's id */ getById(id: string): Post; /** * Adds a new thread to this collection * * @param properties properties used to create the new thread * @returns Id of the new thread */ add(properties: IPost): Promise<{ id: string; }>; } export class Conversation extends GraphQueryableInstance { /** * Get all the threads in a group conversation. */ readonly threads: Threads; /** * Updates this conversation */ update(properties: TypedHash): Promise; /** * Deletes this member from the group */ delete(): Promise; } export class Thread extends GraphQueryableInstance { /** * Get all the threads in a group conversation. */ readonly posts: Posts; /** * Reply to a thread in a group conversation and add a new post to it * * @param post Contents of the post */ reply(post: IPost): Promise; /** * Deletes this member from the group */ delete(): Promise; } export class Post extends GraphQueryableInstance { readonly attachments: Attachments; /** * Deletes this post */ delete(): Promise; /** * Forward a post to a recipient */ forward(info: PostForwardInfo): Promise; /** * Reply to a thread in a group conversation and add a new post to it * * @param post Contents of the post */ reply(post: IPost): Promise; } export class Senders extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Add a new user or group to this senders collection * @param id The full @odata.id value to add (ex: https://graph.microsoft.com/v1.0/users/user@contoso.com) */ add(id: string): Promise; /** * Removes the entity from the collection * * @param id The full @odata.id value to remove (ex: https://graph.microsoft.com/v1.0/users/user@contoso.com) */ remove(id: string): Promise; } } declare module "graph/plans" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; export class Plans extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets a plan from this collection by id * * @param id Plan's id */ getById(id: string): Plan; } export class Plan extends GraphQueryableInstance { } } declare module "graph/photos" { import { GraphQueryable, GraphQueryableInstance } from "graph/graphqueryable"; export class Photo extends GraphQueryableInstance { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets the image bytes as a blob (browser) */ getBlob(): Promise; /** * Gets the image file byets as a Buffer (node.js) */ getBuffer(): Promise; /** * Sets the file bytes * * @param content Image file contents, max 4 MB */ setContent(content: ArrayBuffer | Blob): Promise; } } declare module "graph/groups" { import { GraphQueryable, GraphQueryableInstance, GraphQueryableCollection } from "graph/graphqueryable"; import { Members, Owners } from "graph/members"; import { TypedHash } from "collections/collections"; import { Calendar, Events } from "graph/calendars"; import { Conversations, Senders } from "graph/conversations"; import { Event as IEvent } from "@microsoft/microsoft-graph-types"; import { Plans } from "graph/plans"; import { Photo } from "graph/photos"; export enum GroupType { /** * Office 365 (aka unified group) */ Office365 = 0, /** * Dynamic membership */ Dynamic = 1, /** * Security */ Security = 2, } /** * Describes a collection of Field objects * */ export class Groups extends GraphQueryableCollection { constructor(baseUrl: string | GraphQueryable, path?: string); /** * Gets a group from the collection using the specified id * * @param id Id of the group to get from this collection */ getById(id: string): Group; /** * Create a new group as specified in the request body. * * @param name Name to display in the address book for the group * @param mailNickname Mail alias for the group * @param groupType Type of group being created * @param additionalProperties A plain object collection of additional properties you want to set on the new group */ add(name: string, mailNickname: string, groupType: GroupType, additionalProperties?: TypedHash): Promise; } /** * Represents a group entity */ export class Group extends GraphQueryableInstance { /** * The calendar associated with this group */ readonly caldendar: Calendar; /** * Retrieve a list of event objects */ readonly events: Events; /** * Gets the collection of owners for this group */ readonly owners: Owners; /** * The collection of plans for this group */ readonly plans: Plans; /** * Gets the collection of members for this group */ readonly members: Members; /** * Gets the conversations collection for this group */ readonly conversations: Conversations; /** * Gets the collection of accepted senders for this group */ readonly acceptedSenders: Senders; /** * Gets the collection of rejected senders for this group */ readonly rejectedSenders: Senders; /** * The photo associated with the group */ readonly photo: Photo; /** * Add the group to the list of the current user's favorite groups. Supported for only Office 365 groups */ addFavorite(): Promise; /** * Return all the groups that the specified group is a member of. The check is transitive * * @param securityEnabledOnly */ getMemberGroups(securityEnabledOnly?: boolean): Promise<{ value: string[]; }>; /** * Deletes this group */ delete(): Promise; /** * Update the properties of a group object * * @param properties Set of properties of this group to update */ update(properties: TypedHash): Promise; /** * Remove the group from the list of the current user's favorite groups. Supported for only Office 365 groups */ removeFavorite(): Promise; /** * Reset the unseenCount of all the posts that the current user has not seen since their last visit */ resetUnseenCount(): Promise; /** * Calling this method will enable the current user to receive email notifications for this group, * about new posts, events, and files in that group. Supported for only Office 365 groups */ subscribeByMail(): Promise; /** * Calling this method will prevent the current user from receiving email notifications for this group * about new posts, events, and files in that group. Supported for only Office 365 groups */ unsubscribeByMail(): Promise; /** * Get the occurrences, exceptions, and single instances of events in a calendar view defined by a time range, from the default calendar of a group * * @param start Start date and time of the time range * @param end End date and time of the time range */ getCalendarView(start: Date, end: Date): Promise; } export interface GroupAddResult { group: Group; data: any; } } declare module "graph/v1" { import { GraphQueryable } from "graph/graphqueryable"; import { Groups } from "graph/groups"; /** * Root object wrapping v1 functionality for MS Graph * */ export class V1 extends GraphQueryable { /** * Creates a new instance of the V1 class * * @param baseUrl The url or Queryable which forms the parent of this fields collection * @param path Optional additional path */ constructor(baseUrl: string | GraphQueryable, path?: string); readonly groups: Groups; } } declare module "graph/rest" { import { V1 } from "graph/v1"; export class GraphRest { readonly v1: V1; } } declare module "configuration/providers/cachingConfigurationProvider" { import { IConfigurationProvider } from "configuration/configuration"; import { TypedHash } from "collections/collections"; import * as storage from "utils/storage"; /** * A caching provider which can wrap other non-caching providers * */ export default class CachingConfigurationProvider implements IConfigurationProvider { private wrappedProvider; private store; private cacheKey; /** * Creates a new caching configuration provider * @constructor * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration * @param {string} cacheKey Key that will be used to store cached items to the cache * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings. */ constructor(wrappedProvider: IConfigurationProvider, cacheKey: string, cacheStore?: storage.PnPClientStore); /** * Gets the wrapped configuration providers * * @return {IConfigurationProvider} Wrapped configuration provider */ getWrappedProvider(): IConfigurationProvider; /** * Loads the configuration values either from the cache or from the wrapped provider * * @return {Promise>} Promise of loaded configuration values */ getConfiguration(): Promise>; private selectPnPCache(); } } declare module "configuration/providers/spListConfigurationProvider" { import { IConfigurationProvider } from "configuration/configuration"; import { TypedHash } from "collections/collections"; import { default as CachingConfigurationProvider } from "configuration/providers/cachingConfigurationProvider"; import { Web } from "sharepoint/webs"; /** * A configuration provider which loads configuration values from a SharePoint list * */ export default class SPListConfigurationProvider implements IConfigurationProvider { private sourceWeb; private sourceListTitle; /** * Creates a new SharePoint list based configuration provider * @constructor * @param {string} webUrl Url of the SharePoint site, where the configuration list is located * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = "config") */ constructor(sourceWeb: Web, sourceListTitle?: string); /** * Gets the url of the SharePoint site, where the configuration list is located * * @return {string} Url address of the site */ readonly web: Web; /** * Gets the title of the SharePoint list, which contains the configuration settings * * @return {string} List title */ readonly listTitle: string; /** * Loads the configuration values from the SharePoint list * * @return {Promise>} Promise of loaded configuration values */ getConfiguration(): Promise>; /** * Wraps the current provider in a cache enabled provider * * @return {CachingConfigurationProvider} Caching providers which wraps the current provider */ asCaching(): CachingConfigurationProvider; } } declare module "configuration/providers/index" { export { default as CachingConfigurationProvider } from "configuration/providers/cachingConfigurationProvider"; export { default as SPListConfigurationProvider } from "configuration/providers/spListConfigurationProvider"; } declare module "exports/core" { export { IConfigurationProvider } from "configuration/configuration"; export * from "configuration/providers/index"; export { LibraryConfiguration } from "configuration/pnplibconfig"; export { TypedHash, Dictionary } from "collections/collections"; export { Util } from "utils/util"; export * from "utils/logging"; export * from "utils/exceptions"; export * from "utils/storage"; } declare module "graph/index" { export { GroupAddResult } from "graph/groups"; export { GraphQueryable, GraphQueryableCollection, GraphQueryableInstance, GraphQueryableConstructor, GraphQueryableSearchableCollection } from "graph/graphqueryable"; } declare module "exports/graph" { export * from "graph/index"; } declare module "net/sprequestexecutorclient" { import { HttpClientImpl } from "net/httpclient"; /** * Makes requests using the SP.RequestExecutor library. */ export class SPRequestExecutorClient implements HttpClientImpl { /** * Fetches a URL using the SP.RequestExecutor library. */ fetch(url: string, options: any): Promise; /** * Converts a SharePoint REST API response to a fetch API response. */ private convertToResponse; } } declare module "net/nodefetchclient" { import { HttpClientImpl } from "net/httpclient"; export interface AuthToken { token_type: string; expires_in: string; not_before: string; expires_on: string; resource: string; access_token: string; } /** * Fetch client for use within nodejs, requires you register a client id and secret with app only permissions */ export class NodeFetchClient implements HttpClientImpl { siteUrl: string; private _clientId; private _clientSecret; private _realm; private static SharePointServicePrincipal; private token; constructor(siteUrl: string, _clientId: string, _clientSecret: string, _realm?: string); fetch(url: string, options: any): Promise; /** * Gets an add-in only authentication token based on the supplied site url, client id and secret */ getAddInOnlyAccessToken(): Promise; private getRealm(); private getAuthUrl(realm); private getFormattedPrincipal(principalName, hostName, realm); private toDate(epoch); } } declare module "exports/net" { export { HttpClient, HttpClientImpl } from "net/httpclient"; export { ConfigOptions, FetchOptions } from "net/utils"; export { SPRequestExecutorClient } from "net/sprequestexecutorclient"; export { NodeFetchClient } from "net/nodefetchclient"; export { FetchClient } from "net/fetchclient"; export { GraphHttpClient, GraphHttpClientImpl } from "net/graphclient"; } declare module "exports/odata" { export * from "odata/core"; export * from "odata/parsers"; export * from "odata/caching"; export * from "odata/queryable"; } declare module "sharepoint/index" { export { AppCatalog, AppAddResult, App } from "sharepoint/appcatalog"; export { AttachmentFileAddResult, AttachmentFileInfo } from "sharepoint/attachmentfiles"; export * from "sharepoint/clientsidepages"; export { ODataBatch } from "sharepoint/batch"; export { Field, Fields, FieldAddResult, FieldUpdateResult } from "sharepoint/fields"; export { CheckinType, FileAddResult, WebPartsPersonalizationScope, MoveOperations, TemplateFileType, ChunkedFileUploadProgressData, File, Files } from "sharepoint/files"; export { FeatureAddResult } from "sharepoint/features"; export { FolderAddResult, Folder, Folders } from "sharepoint/folders"; export { Item, Items, ItemVersion, ItemVersions, ItemAddResult, ItemUpdateResult, ItemUpdateResultData, PagedItemCollection } from "sharepoint/items"; export { NavigationNodeAddResult, NavigationNodes, NavigationNode } from "sharepoint/navigation"; export { List, Lists, ListAddResult, ListUpdateResult, ListEnsureResult } from "sharepoint/lists"; export { spExtractODataId, spODataEntity, spODataEntityArray } from "sharepoint/odata"; export { SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection, SharePointQueryableConstructor } from "sharepoint/sharepointqueryable"; export { RelatedItem, RelatedItemManger } from "sharepoint/relateditems"; export { RoleDefinitionUpdateResult, RoleDefinitionAddResult, RoleDefinitionBindings } from "sharepoint/roles"; export { Search, SearchProperty, SearchPropertyValue, SearchQuery, SearchQueryBuilder, SearchResult, SearchResults, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType, SearchBuiltInSourceId, SearchResponse, ResultTableCollection, ResultTable } from "sharepoint/search"; export { SearchSuggest, SearchSuggestQuery, SearchSuggestResult, PersonalResultSuggestion } from "sharepoint/searchsuggest"; export { Site, OpenWebByIdResult } from "sharepoint/site"; export { SiteGroupAddResult } from "sharepoint/sitegroups"; export { UserUpdateResult, SiteUserProps } from "sharepoint/siteusers"; export * from "sharepoint/social"; export { SubscriptionAddResult, SubscriptionUpdateResult } from "sharepoint/subscriptions"; export * from "sharepoint/types"; export { UserCustomActionAddResult, UserCustomActionUpdateResult } from "sharepoint/usercustomactions"; export { UtilityMethod, CreateWikiPageResult } from "sharepoint/utilities"; export { ViewAddResult, ViewUpdateResult } from "sharepoint/views"; export { WebPartDefinitions, WebPartDefinition, WebPart } from "sharepoint/webparts"; export { Web, WebAddResult, WebUpdateResult, GetCatalogResult, WebEnsureUserResult } from "sharepoint/webs"; } declare module "exports/sp" { export * from "sharepoint/index"; } declare module "pnp" { import { Util } from "utils/util"; import { PnPClientStorage } from "utils/storage"; import { Settings } from "configuration/configuration"; import { Logger } from "utils/logging"; import { SPRest } from "sharepoint/rest"; import { LibraryConfiguration } from "configuration/pnplibconfig"; import { GraphRest } from "graph/rest"; /** * Root class of the Patterns and Practices namespace, provides an entry point to the library */ /** * Utility methods */ export const util: typeof Util; /** * Provides access to the SharePoint REST interface */ export const sp: SPRest; /** * Provides access to the Microsoft Graph REST interface */ export const graph: GraphRest; /** * Provides access to local and session storage */ export const storage: PnPClientStorage; /** * Global configuration instance to which providers can be added */ export const config: Settings; /** * Global logging instance to which subscribers can be registered and messages written */ export const log: typeof Logger; /** * Allows for the configuration of the library */ export const setup: (config: LibraryConfiguration) => void; /** * Export everything back to the top level so it can be properly bundled */ export * from "exports/core"; export * from "exports/graph"; export * from "exports/net"; export * from "exports/odata"; export * from "exports/sp"; const Def: { config: Settings; graph: GraphRest; log: typeof Logger; setup: (config: LibraryConfiguration) => void; sp: SPRest; storage: PnPClientStorage; util: typeof Util; }; export default Def; } declare module "graph/me" { import { GraphQueryable, GraphQueryableInstance } from "graph/graphqueryable"; export class Me extends GraphQueryableInstance { constructor(baseUrl: string | GraphQueryable, path?: string); } } declare module "net/nodefetchclientbrowser" { import { HttpClientImpl } from "net/httpclient"; /** * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by * not including all of the node dependencies */ export class NodeFetchClient implements HttpClientImpl { /** * Always throws an error that NodeFetchClient is not supported for use in the browser */ fetch(): Promise; } } declare module "utils/decorators" { export function deprecated(deprecationVersion: string, message: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; }