diff --git a/sharepoint/SharePoint-tests.ts b/sharepoint/SharePoint-tests.ts
new file mode 100644
index 0000000000..83934008c5
--- /dev/null
+++ b/sharepoint/SharePoint-tests.ts
@@ -0,0 +1,525 @@
+///
+
+// Website tasks
+function retrieveWebsite(resultpanel:HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ clientContext.load(oWebsite);
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Web site title: " + oWebsite.get_title();
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function retrieveWebsiteProps(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ clientContext.load(oWebsite, "Description", "Created");
+
+ clientContext.executeQueryAsync(successHandler,errorHandler);
+
+ function successHandler() {
+ resultpanel.innerHTML = "Description: " + oWebsite.get_description() +
+ "
Date created: " + oWebsite.get_created();
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function writeWebsiteProps(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ oWebsite.set_description("This is an updated description.");
+ oWebsite.update();
+
+ clientContext.load(oWebsite, "Description");
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+
+ function successHandler() {
+ resultpanel.innerHTML = "Web site description: " + oWebsite.get_description();
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+// Lists tasks
+function readAllProps(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ var collList = oWebsite.get_lists();
+ clientContext.load(collList);
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+
+ var listEnumerator = collList.getEnumerator();
+
+ var listInfo = "";
+ while (listEnumerator.moveNext()) {
+ var oList = listEnumerator.get_current();
+ listInfo += "Title: " + oList.get_title() + " Created: " +
+ oList.get_created().toString() + "
";
+ }
+
+ resultpanel.innerHTML = listInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function readSpecificProps(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ var collList = oWebsite.get_lists();
+
+ clientContext.load(collList, "Include(Title, Id)");
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+
+ var listEnumerator = collList.getEnumerator();
+
+ var listInfo = "";
+ while (listEnumerator.moveNext()) {
+ var oList = listEnumerator.get_current();
+ listInfo += "Title: " + oList.get_title() +
+ " ID: " + oList.get_id().toString() + "
";
+ }
+
+ resultpanel.innerHTML = listInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function readColl(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var collList = oWebsite.get_lists();
+
+ var listInfoCollection = clientContext.loadQuery(collList, "Include(Title, Id)");
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ var listInfo = "";
+ for (var i = 0; i < listInfoCollection.length; i++) {
+ var oList = listInfoCollection[i];
+ listInfo += "Title: " + oList.get_title() +
+ " ID: " + oList.get_id().toString() + "
";
+ }
+
+ resultpanel.innerHTML = listInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function readFilter(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var collList = oWebsite.get_lists();
+
+ var listInfoArray = clientContext.loadQuery(collList,
+ "Include(Title,Fields.Include(Title,InternalName))");
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+
+ for (var i = 0; i < listInfoArray.length; i++) {
+ var oList = listInfoArray[i];
+ var collField = oList.get_fields();
+ var fieldEnumerator = collField.getEnumerator();
+
+ var listInfo = "";
+ while (fieldEnumerator.moveNext()) {
+ var oField = fieldEnumerator.get_current();
+ var regEx = new RegExp("name", "ig");
+
+ if (regEx.test(oField.get_internalName())) {
+ listInfo += "List: " + oList.get_title() +
+ "
Field Title: " + oField.get_title() +
+ "
Field Internal name: " + oField.get_internalName();
+ }
+ }
+ }
+
+ resultpanel.innerHTML = listInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+// Create, update and delete lists
+function createList(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ var listCreationInfo = new SP.ListCreationInformation();
+ listCreationInfo.set_title("My Announcements List");
+ listCreationInfo.set_templateType(SP.ListTemplateType.announcements);
+
+ var oList = oWebsite.get_lists().add(listCreationInfo);
+ clientContext.load(oList);
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the list.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function updateList(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+
+ var oList = oWebsite.get_lists().getByTitle("My Announcements List");
+ oList.set_description("New Announcements List");
+ oList.update();
+
+ clientContext.load(oList);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Check the description in the list.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function addField(resultpanel: HTMLElement) {
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("My Announcements List");
+
+ var oField = oList.get_fields().addFieldAsXml(
+ "",
+ true,
+ SP.AddFieldOptions.defaultValue
+ );
+
+ var fieldNumber = clientContext.castTo(oField, SP.FieldNumber);
+ fieldNumber.set_maximumValue(100);
+ fieldNumber.set_minimumValue(35);
+ fieldNumber.update();
+
+ clientContext.load(oField);
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "The list with a new field.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function deleteList(resultpanel: HTMLElement) {
+ var listTitle = "My Announcements List";
+
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle(listTitle);
+ oList.deleteObject();
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = listTitle + " deleted.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+// Create, update and delete folders
+function createFolder(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Shared Documents");
+
+ var itemCreateInfo = new SP.ListItemCreationInformation();
+ itemCreateInfo.set_underlyingObjectType(SP.FileSystemObjectType.folder);
+ itemCreateInfo.set_leafName("My new folder!");
+ var oListItem = oList.addItem(itemCreateInfo);
+ oListItem.update();
+
+ clientContext.load(oListItem);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the document library to see your new folder.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function updateFolder(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Shared Documents");
+
+ var oListItem = oList.getItemById(1);
+ oListItem.set_item("FileLeafRef", "My updated folder");
+ oListItem.update();
+
+ clientContext.load(oListItem);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the document library to see your updated folder.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function deleteFolder(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Shared Documents");
+
+ var oListItem = oList.getItemById(1);
+ oListItem.deleteObject();
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the document library to make sure the folder is no longer there.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+// List item tasks
+function readItems(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Announcements");
+ var camlQuery = new SP.CamlQuery();
+ camlQuery.set_viewXml(
+ '' +
+ '1' +
+ '10'
+ );
+ var collListItem = oList.getItems(camlQuery);
+
+ clientContext.load(collListItem);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ var listItemEnumerator = collListItem.getEnumerator();
+
+ var listItemInfo = "";
+ while (listItemEnumerator.moveNext()) {
+ var oListItem = listItemEnumerator.get_current();
+ listItemInfo += "ID: " + oListItem.get_id() + "
" +
+ "Title: " + oListItem.get_item("Title") + "
" +
+ "Body: " + oListItem.get_item("Body") + "
";
+ }
+
+ resultpanel.innerHTML = listItemInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function readInclude(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Announcements");
+ var camlQuery = new SP.CamlQuery();
+ camlQuery.set_viewXml('100');
+
+ var collListItem = oList.getItems(camlQuery);
+
+ clientContext.load(collListItem, "Include(Id, DisplayName, HasUniqueRoleAssignments)");
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ var listItemEnumerator = collListItem.getEnumerator();
+
+ var listItemInfo = "";
+ while (listItemEnumerator.moveNext()) {
+ var oListItem = listItemEnumerator.get_current();
+ listItemInfo += "ID: " + oListItem.get_id() + "
" +
+ "Display name: " + oListItem.get_displayName() + "
" +
+ "Unique role assignments: " + oListItem.get_hasUniqueRoleAssignments() + "
";
+ }
+
+ resultpanel.innerHTML = listItemInfo;
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+// Create, update and delete list items
+function createListItem(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Announcements");
+
+ var itemCreateInfo = new SP.ListItemCreationInformation();
+ var oListItem = oList.addItem(itemCreateInfo);
+ oListItem.set_item("Title", "My New Item!");
+ oListItem.set_item("Body", "Hello World!");
+ oListItem.update();
+
+ clientContext.load(oListItem);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the list to see your new item.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function updateListItem(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Announcements");
+
+ var oListItem = oList.getItemById(1);
+ oListItem.set_item("Title", "My updated title");
+ oListItem.update();
+
+ clientContext.load(oListItem);
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the list to see your updated item.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
+
+function deleteListItem(resultpanel: HTMLElement) {
+ var clientContext = SP.ClientContext.get_current();
+ var oWebsite = clientContext.get_web();
+ var oList = oWebsite.get_lists().getByTitle("Announcements");
+
+ var oListItem = oList.getItemById(1);
+ oListItem.deleteObject();
+
+ clientContext.executeQueryAsync(
+ successHandler,
+ errorHandler
+ );
+
+ function successHandler() {
+ resultpanel.innerHTML = "Go to the list to make sure the item is no longer there.";
+ }
+
+ function errorHandler() {
+ resultpanel.innerHTML = "Request failed: " + arguments[1].get_message();
+ }
+}
\ No newline at end of file
diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts
new file mode 100644
index 0000000000..056087bedb
--- /dev/null
+++ b/sharepoint/SharePoint.d.ts
@@ -0,0 +1,7944 @@
+// Type definitions for sptypescript
+// Project: http://sptypescript.codeplex.com
+// Definitions by: Stanislav Vyshchepan and Andrey Markeev
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+declare module Sys {
+ export class EventArgs {
+ static Empty: Sys.EventArgs;
+ }
+ export class StringBuilder {
+ /** Appends a string to the string builder */
+ append(s: string): void;
+ /** Appends a line to the string builder */
+ appendLine(s: string): void;
+ /** Clears the contents of the string builder */
+ clear(): void;
+ /** Indicates wherever the string builder is empty */
+ isEmpty(): bool;
+ /** Gets the contents of the string builder as a string */
+ toString(): string;
+ }
+ export class Component {
+ get_id(): string;
+ static create(type: Component, properties?: any, events?: any, references?: any, element?: Node);
+ initialize(): void;
+ updated(): void;
+ }
+ module UI {
+ export class Control { }
+ export class DomEvent {
+ static addHandler(element: HTMLElement, eventName: string, handler: (e: Event) => void );
+ static removeHandler(element: HTMLElement, eventName: string, handler: (e: Event) => void );
+ }
+ }
+ module Net {
+ export class WebRequest { }
+ export class WebRequestExecutor { }
+ }
+ interface IDisposable {
+ dispose(): void;
+ }
+
+}
+
+declare var $get: { (id: string): HTMLElement; };
+declare var $addHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void ): void; };
+declare var $removeHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void ): void; };
+
+interface MQuery
+{
+ (selector: string, context?: any): MQueryResultSetElements;
+ (element: HTMLElement): MQueryResultSetElements;
+ (object: MQueryResultSetElements): MQueryResultSetElements;
+ (object: MQueryResultSet): MQueryResultSet;
+ (object: T): MQueryResultSet;
+ (elementArray: HTMLElement[]): MQueryResultSetElements;
+ (array: T[]): MQueryResultSet;
+ (): MQueryResultSet;
+
+ throttle(fn: Function, interval: number, shouldOverrideThrottle: boolean): Function;
+
+ extend(target: any, ...objs: any[]): Object;
+ extend(deep: boolean, target: any, ...objs: any[]): Object;
+
+ makeArray(obj: any): any[];
+
+ isDefined(obj: any): boolean;
+ isNotNull(obj: any): boolean;
+ isUndefined(obj: any): boolean;
+ isNull(obj: any): boolean;
+ isUndefinedOrNull(obj: any): boolean;
+ isDefinedAndNotNull(obj: any): boolean;
+ isString(obj: any): boolean;
+ isBoolean(obj: any): boolean;
+ isFunction(obj: any): boolean;
+ isArray(obj: any): boolean;
+ isNode(obj: any): boolean;
+ isElement(obj: any): boolean;
+ isMQueryResultSet(obj: any): boolean;
+ isNumber(obj: any): boolean;
+ isObject(obj: any): boolean;
+ isEmptyObject(obj: any): boolean;
+
+ ready(callback: () => void ): void;
+ contains(container: HTMLElement, contained: HTMLElement): boolean;
+
+ proxy(fn: (...args: any[]) => any, context: any, ...args: any[]): Function;
+ proxy(context: any, name: string, ...args: any[]): any;
+
+ every(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ every(obj: MQueryResultSet, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ every(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): boolean;
+ every(obj: MQueryResultSet, fn: (elementOfArray: any) => boolean, context?: any): boolean;
+
+ some(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ some(obj: MQueryResultSet, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ some(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): boolean;
+ some(obj: MQueryResultSet, fn: (elementOfArray: T) => boolean, context?: any): boolean;
+
+ filter(obj: T[], fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): T[];
+ filter(obj: MQueryResultSet, fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): MQueryResultSet;
+ filter(obj: T[], fn: (elementOfArray: T) => boolean, context?: any): T[];
+ filter(obj: MQueryResultSet, fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet;
+
+ forEach(obj: T[], fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
+ forEach(obj: MQueryResultSet, fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
+ forEach(obj: T[], fn: (elementOfArray: T) => void, context?: any): void;
+ forEach(obj: MQueryResultSet, fn: (elementOfArray: T) => void, context?: any): void;
+
+ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
+ map(array: MQueryResultSet, callback: (elementOfArray: T, indexInArray: number) => U): MQueryResultSet;
+ map(array: T[], callback: (elementOfArray: T) => U): U[];
+ map(array: MQueryResultSet, callback: (elementOfArray: T) => U): MQueryResultSet;
+
+ indexOf(obj: T[], object: T, startIndex?: number): number;
+ lastIndexOf(obj: T[], object: T, startIndex?: number): number;
+
+ data(element: HTMLElement, key: string, value: any): any;
+ data(element: HTMLElement, key: string): any;
+ data(element: HTMLElement): any;
+
+ removeData(element: HTMLElement, name?: string): MQueryResultSet;
+ hasData(element: HTMLElement): boolean;
+}
+
+interface MQueryResultSetElements extends MQueryResultSet{
+ append(node: HTMLElement): MQueryResultSetElements;
+ append(mQuerySet: MQueryResultSetElements): MQueryResultSetElements;
+ append(html: string): MQueryResultSetElements;
+
+ bind(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ unbind(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ trigger(eventType: string): MQueryResultSet;
+ one(eventType: string, handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+
+ detach(): MQueryResultSet;
+
+ find(selector: string): MQueryResultSetElements;
+ closest(selector: string, context?: any): MQueryResultSetElements;
+ offset(): { left: number; top: number; };
+ offset(coordinates: { left: any; top: any; }): MQueryResultSetElements;
+
+ filter(selector: string): MQueryResultSetElements;
+ filter(fn: (elementOfArray: HTMLElement, indexInArray: number) => boolean, context?: any): MQueryResultSetElements;
+ filter(fn: (elementOfArray: HTMLElement) => boolean, context?: any): MQueryResultSetElements;
+
+ not(selector: string): MQueryResultSetElements;
+
+ parent(selector?: string): MQueryResultSetElements;
+
+ offsetParent(selector?: string): MQueryResultSetElements;
+
+ parents(selector?: string): MQueryResultSetElements;
+ parentsUntil(selector?: string, filter?: string): MQueryResultSetElements;
+ parentsUntil(element?: HTMLElement, filter?: string): MQueryResultSetElements;
+
+ position(): { top: number; left: number; };
+
+ attr(attributeName: string): string;
+ attr(attributeName: string, value: any): MQueryResultSetElements;
+ attr(map: { [key: string]: any; }): MQueryResultSetElements;
+ attr(attributeName: string, func: (index: number, attr: any) => any): MQueryResultSetElements;
+
+ addClass(classNames: string): MQueryResultSetElements;
+ removeClass(classNames: string): MQueryResultSetElements;
+
+ css(propertyName: string): string;
+ css(propertyNames: string[]): string;
+ css(properties: any): MQueryResultSetElements;
+ css(propertyName: string, value: any): MQueryResultSetElements;
+ css(propertyName: any, value: any): MQueryResultSetElements;
+
+ remove(selector?: string): MQueryResultSetElements;
+ children(selector?: string): MQueryResultSetElements;
+ empty(): MQueryResultSetElements;
+ first(): MQueryResultSetElements;
+
+ data(key: string, value: any): MQueryResultSetElements;
+ data(obj: { [key: string]: any; }): MQueryResultSetElements;
+ data(key: string): any;
+
+ removeData(key: string): MQueryResultSetElements;
+
+ map(callback: (elementOfArray: HTMLElement, indexInArray: number) => any): MQueryResultSetElements;
+ map(callback: (elementOfArray: HTMLElement) => any): MQueryResultSetElements;
+
+ blur(): MQueryResultSetElements;
+ blur(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ change(): MQueryResultSetElements;
+ change(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ click(): MQueryResultSetElements;
+ click(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ dblclick(): MQueryResultSetElements;
+ dblclick(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ error(): MQueryResultSetElements;
+ error(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ focus(): MQueryResultSetElements;
+ focus(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ focusin(): MQueryResultSetElements;
+ focusin(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ focusout(): MQueryResultSetElements;
+ focusout(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ keydown(): MQueryResultSetElements;
+ keydown(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ keypress(): MQueryResultSetElements;
+ keypress(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ keyup(): MQueryResultSetElements;
+ keyup(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ load(): MQueryResultSetElements;
+ load(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mousedown(): MQueryResultSetElements;
+ mousedown(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mouseenter(): MQueryResultSetElements;
+ mouseenter(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mouseleave(): MQueryResultSetElements;
+ mouseleave(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mousemove(): MQueryResultSetElements;
+ mousemove(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mouseout(): MQueryResultSetElements;
+ mouseout(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mouseover(): MQueryResultSetElements;
+ mouseover(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ mouseup(): MQueryResultSetElements;
+ mouseup(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ resize(): MQueryResultSetElements;
+ resize(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ scroll(): MQueryResultSetElements;
+ scroll(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ select(): MQueryResultSetElements;
+ select(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ submit(): MQueryResultSetElements;
+ submit(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+ unload(): MQueryResultSetElements;
+ unload(handler: (eventObject: MQueryEvent) => any): MQueryResultSetElements;
+
+}
+
+interface MQueryResultSet {
+ contains(contained: T): boolean;
+
+ filter(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): MQueryResultSet;
+ filter(fn: (elementOfArray: T) => boolean, context?: any): MQueryResultSet;
+
+ every(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ every(fn: (elementOfArray: T) => boolean, context?: any): boolean;
+
+ some(fn: (elementOfArray: T, indexInArray: number) => boolean, context?: any): boolean;
+ some(fn: (elementOfArray: T) => boolean, context?: any): boolean;
+
+ map(callback: (elementOfArray: T, indexInArray: number) => any): MQueryResultSet;
+ map(callback: (elementOfArray: T) => any): MQueryResultSet;
+
+ forEach(fn: (elementOfArray: T, indexInArray: number) => void, context?: any): void;
+ forEach(fn: (elementOfArray: T) => void, context?: any): void;
+
+ indexOf(object: any, startIndex?: number): number;
+ lastIndexOf(object: any, startIndex?: number): number;
+
+}
+
+interface MQueryEvent extends Event {
+ altKey: boolean;
+ attrChange: number;
+ attrName: string;
+ bubbles: boolean;
+ button: number;
+ cancelable: boolean;
+ ctrlKey: boolean;
+ defaultPrevented: boolean;
+ detail: number;
+ eventPhase: number;
+ newValue: string;
+ prevValue: string;
+ relatedNode: HTMLElement;
+ screenX: number;
+ screenY: number;
+ shiftKey: boolean;
+ view: any;
+}
+
+declare var m$: MQuery;
+declare class CalloutActionOptions {
+ /** Text for the action link */
+ text: string;
+ tooltip: string;
+ disabledTooltip: string;
+ /** Callback that is executed when the action link is clicked.
+ @param event Standard javascript event object
+ @param action The action object */
+ onClickCallback: (event: Event, action: CalloutAction) => any;
+ /** Callback which returns if the action link is enabled */
+ isEnabledCallback: (action: CalloutAction) => bool;
+ /** Callback which returns if the action link is visible */
+ isVisibleCallback: (action: CalloutAction) => bool;
+ /** Submenu entries for the action. If defined, the action link click will popup the specified menu. */
+ menuEntries: CalloutActionMenuEntry[];
+}
+
+/** Defines a callout action menu entry */
+declare class CalloutActionMenuEntry {
+ /** Creates a callout action menu entry
+ @param text Text to be displayed as the menu item text
+ @param onClickCallback Callback that will be fired when the item is clicked
+ @param wzISrc Url of the icon
+ @param wzIAlt Alternative text for the icon image
+ @param wzISeq Sequence for the menu item
+ @param wzDesc Description of the menu item */
+ constructor(
+ text: string,
+ onClickCallback: (actionMenuEntry: CalloutActionMenuEntry, actionMenuEntryIndex: number) => void,
+ wzISrc: string,
+ wzIAlt: string,
+ wzISeq: number,
+ wzDesc: string);
+}
+
+
+declare class CalloutActionMenu {
+ constructor(actionsId);
+ addAction(action: CalloutAction);
+ getActions(): CalloutAction[];
+ render(): void;
+ refreshActions(): void;
+ calculateActionWidth(): void;
+}
+
+
+declare class CalloutAction {
+ constructor(options: CalloutActionOptions);
+ getText(): string;
+ getToolTop(): string;
+ getDisabledToolTip(): string;
+ getOnClickCallback(): (event, action: CalloutAction) => any;
+ getIsDisabledCallback(): (action: CalloutAction) => bool;
+ getIsVisibleCallback(): (action: CalloutAction) => bool;
+ getIsMenu(): bool;
+ getMenuEntries(): CalloutActionMenuEntry[];
+ render(): void;
+ isEnabled(): bool;
+ isVisible(): bool;
+ set (options: CalloutActionOptions): void;
+}
+
+declare class Callout {
+ /** Sets options for the callout. Not all options can be changed for the callout after its creation. */
+ set (options: CalloutOptions);
+ /** Adds event handler to the callout.
+ @param eventName one of the following: "opened", "opening", "closing", "closed" */
+ addEventCallback(eventName: string, callback: (callout: Callout) => void);
+ /** Returns the launch point element of the callout. */
+ getLaunchPoint(): HTMLElement;
+ /** Returns the ID of the callout. */
+ getID(): string;
+ /** Returns the title of the callout. */
+ getTitle(): string;
+ /** Returns the contents of the callout. */
+ getContent(): string;
+ /** Returns the content element of the callout. */
+ getContentElement(): HTMLElement;
+ /** Returns the bounding element defined for the callout during its creation. */
+ getBoundingBox(): HTMLElement;
+ /** Returns the content width defined for the callout during its creation. */
+ getContentWidth(): number;
+ /** Returns the object that represents open behaivor defined for the callout during its creation. */
+ getOpenOptions(): CalloutOpenOptions;
+ /** Returns the beak orientation defined for the callout during its creation. */
+ getBeakOrientation(): string;
+ /** Returns the position algorithm function defined for the callout during its creation. */
+ getPositionAlgorithm(): any;
+ /** Specifies wherever callout is in "Opened" state */
+ isOpen(): bool;
+ /** Specifies wherever callout is in "Opening" state */
+ isOpening(): bool;
+ /** Specifies wherever callout is in "Opened" or "Opening" state */
+ isOpenOrOpening(): bool;
+ /** Specifies wherever callout is in "Closing" state */
+ isClosing(): bool;
+ /** Specifies wherever callout is in "Closed" state */
+ isClosed(): bool;
+ /** Returns the callout actions menu */
+ getActionMenu(): CalloutActionMenu;
+ /** Adds a link to the actions panel in the bottom part of the callout window */
+ addAction(action: CalloutAction);
+ /** Re-renders the actions menu. Call after the actions menu is changed. */
+ refreshActions(): void;
+ /** Display the callout. Animation can be used only for IE9+ */
+ open(useAnimation: bool);
+ /** Hide the callout. Animation can be used only for IE9+ */
+ close(useAnimation: bool);
+ /** Display if hidden, hide if shown. */
+ toggle(): void;
+ /** Do not call this directly. Instead, use CalloutManager.remove */
+ destroy(): void;
+}
+
+declare class CalloutOpenOptions {
+ /** HTML event name, e.g. "click" */
+ event: string;
+ /** Callout will be closed on blur */
+ closeCalloutOnBlur: bool;
+ /** Close button will be shown within the callout window */
+ showCloseButton: bool;
+}
+
+declare class CalloutOptions {
+ /** Some unique id for the callout. */
+ ID: string;
+ /** Element on that the callout is shown. */
+ launchPoint: HTMLElement;
+ /** One of the following: "topBottom" (default) or "leftRight". */
+ beakOrientation: string;
+ /** String (HTML allowed) that represents contents of the callout window. */
+ content: string;
+ /** Title for the callout */
+ title: string;
+ /** HTML element that represents contents of the callout window. */
+ contentElement: HTMLElement;
+ /** If defined, callout will be inscribed into the bounding element. */
+ boundingBox: HTMLElement;
+ /** Content element's width in pixels. By default = 350. */
+ contentWidth: number;
+ /** Defines opening behavior */
+ openOptions: CalloutOpenOptions;
+ /** Fires after the callout is rendered but before it is positioned and shown */
+ onOpeningCallback: (callout: Callout) => void;
+ /** Fires right after the callout is shown */
+ onOpenedCallback: (callout: Callout) => void;
+ /** Fires right before the callout is closed */
+ onClosingCallback: (callout: Callout) => void;
+ /** Fires right after the callout is closed */
+ onClosedCallback: (callout: Callout) => void;
+ /** Sets the position of the callout during its opening phase. For an example of a position algorithm function, please explore defaultPositionAlgorithm function from the callout.debug.js file */
+ positionAlgorithm: (callout: Callout) => void;
+}
+
+
+declare class CalloutManager {
+ /** Creates a new callout */
+ static createNew(options: CalloutOptions): Callout;
+ /** Checks if callout with specified ID already exists. If it doesn't, creates it, otherwise returns the existing one. */
+ static createNewIfNecessary(options: CalloutOptions): Callout;
+ /** Detaches callout from the launch point and destroys it. */
+ static remove(callout: Callout);
+ /** Searches for a callout associated with the specified launch point. Throws error if not found. */
+ static getFromLaunchPoint(launchPoint: HTMLElement): Callout;
+ /** Searches for a callout associated with the specified launch point. Returns null if not found. */
+ static getFromLaunchPointIfExists(launchPoint: HTMLElement): Callout;
+ /** Gets the first launch point within the specified ancestor element, and returns true if the associated with it callout is opened or opening.
+ If the launch point is not found or the callout is hidden, returns false. */
+ static containsOneCalloutOpen(ancestor: HTMLElement): bool;
+ /** Finds the closest launch point based on the specified descendant element, and returns callout associated with the launch point. */
+ static getFromCalloutDescendant(descendant: HTMLElement): Callout;
+ /** Perform some action for each callout on the page. */
+ static forEach(callback: (callout: Callout) => void);
+ /** Closes all callouts on the page */
+ static closeAll(): bool;
+ /** Returns true if at least one of the defined on page callouts is opened. */
+ static isAtLeastOneCalloutOpen(): bool;
+ /** Returns true if at least one of the defined on page callouts is opened or opening. */
+ static isAtLeastOneCalloutOn(): bool;
+}
+
+
+declare module SPClientTemplates {
+
+ export enum FileSystemObjectType {
+ Invalid,
+ File,
+ Folder,
+ Web
+ }
+ export enum ChoiceFormatType {
+ Dropdown,
+ Radio
+ }
+
+ export enum ClientControlMode {
+ Invalid,
+ DisplayForm,
+ EditForm,
+ NewForm,
+ View
+ }
+
+ export enum RichTextMode {
+ Compatible,
+ FullHtml,
+ HtmlAsXml,
+ ThemeHtml
+ }
+ export enum UrlFormatType {
+ Hyperlink,
+ Image
+ }
+
+ export enum DateTimeDisplayFormat {
+ DateOnly,
+ DateTime,
+ TimeOnly
+ }
+
+ export enum DateTimeCalendarType {
+ None,
+ Gregorian,
+ Japan,
+ Taiwan,
+ Korea,
+ Hijri,
+ Thai,
+ Hebrew,
+ GregorianMEFrench,
+ GregorianArabic,
+ GregorianXLITEnglish,
+ GregorianXLITFrench,
+ KoreaJapanLunar,
+ ChineseLunar,
+ SakaEra,
+ UmAlQura
+ }
+ export enum UserSelectionMode {
+ PeopleOnly,
+ PeopleAndGroups
+ }
+
+ /** Represents schema for a Choice field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Choice extends FieldSchema_InForm {
+ /** List of choices for this field. */
+ Choices: string[];
+ /** Display format for the choice field */
+ FormatType: ChoiceFormatType;
+ }
+ /** Represents schema for a Lookup field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Lookup extends FieldSchema_InForm {
+ /** Specifies if the field allows multiple values */
+ AllowMultipleValues: bool;
+ /** Returns base url for a list display form, e.g. "http://portal/web/_layouts/15/listform.aspx?PageType=4"
+ You must add "ListId" (Guid of the list) and "ID" (integer Id of the item) parameters in order to use this Url */
+ BaseDisplayFormUrl: string;
+ /** Indicates if the field is a dependent lookup */
+ DependentLookup: bool;
+ /** Indicates wherever the lookup list is throttled (contains more items than value of the "List Throttle Limit" setting). */
+ Throttled: bool;
+ /** Returns string representation of a number that represents the current value for the "List Throttle Limit" web application setting.
+ Only appears if Throttled property is true, i.e. the target lookup list is throttled. */
+ MaxQueryResult: string;
+ /** List of choices for this field.
+ For a lookup field, contains array of possible values pulled from the target lookup list. */
+ Choices: string[];
+ /** Number of choices. Appears only for Lookup field. */
+ ChoiceCount: number;
+
+ LookupListId: string;
+
+ }
+ /** Represents schema for a DateTime field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_DateTime extends FieldSchema_InForm {
+ /** Type of calendar to use */
+ CalendarType: DateTimeCalendarType;
+ /** Display format for DateTime field. */
+ DisplayFormat: DateTimeDisplayFormat;
+ /** Indicates wherever current user regional settings specify to display week numbers in day or week views of a calendar.
+ Only appears for DateTime fields. */
+ ShowWeekNumber: bool;
+ TimeSeparator: string;
+ TimeZoneDifference: string;
+ FirstDayOfWeek: number;
+ FirstWeekOfYear: number;
+ HijriAdjustment: number;
+ WorkWeek: string;
+ LocaleId: string;
+ LanguageId: string;
+ MinJDay: number;
+ MaxJDay: number;
+ HoursMode24: bool;
+ HoursOptions: string[];
+ }
+ /** Represents schema for a DateTime field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Geolocation extends FieldSchema_InForm {
+ BingMapsKey: string;
+ IsBingMapBlockedInCurrentRegion: bool;
+ }
+ /** Represents schema for a Choice field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_MultiChoice extends FieldSchema_InForm {
+ /** List of choices for this field. */
+ MultiChoices: string[];
+ /** Indicates wherever fill-in choice is allowed */
+ FillInChoice: bool;
+ }
+ /** Represents schema for a Choice field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_MultiLineText extends FieldSchema_InForm {
+ /** Specifies whether rich text formatting can be used in the field */
+ RichText: bool;
+ /** Changes are appended to the existing text. */
+ AppendOnly: bool;
+ /** Rich text mode for the field */
+ RichTextMode: RichTextMode;
+ /** Number of lines configured to display */
+ NumberOfLines: number;
+ /** A boolean value that specifies whether hyperlinks can be used in this fields. */
+ AllowHyperlink: bool;
+ /** WebPartAdderId for the ScriptEditorWebPart */
+ ScriptEditorAdderId: string;
+ }
+ /** Represents schema for a Number field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Number extends FieldSchema_InForm {
+ ShowAsPercentage: bool;
+ }
+ /** Represents schema for a Number field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Text extends FieldSchema_InForm {
+ MaxLength: number;
+ }
+ /** Represents schema for a Number field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_Url extends FieldSchema_InForm {
+ DisplayFormat: UrlFormatType;
+ }
+ /** Represents schema for a Number field in list form or in list view in grid mode */
+ export interface FieldSchema_InForm_User extends FieldSchema_InForm {
+ Presence: bool;
+ WithPicture: bool;
+ DefaultRender: bool;
+ WithPictureDetail: bool;
+ /** Server relative Url for ~site/_layouts/listform.aspx */
+ ListFormUrl: string;
+ /** Server relative Url for ~site/_layouts/userdisp.aspx */
+ UserDisplayUrl: string;
+ EntitySeparator: string;
+ PictureOnly: bool;
+ PictureSize: string;
+ }
+ /** Represents field schema in Grid mode and on list forms.
+ Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */
+ export interface FieldSchema_InForm {
+ /** Specifies if the field can be edited while list view is in the Grid mode */
+ AllowGridEditing: bool;
+ /** Description for this field. */
+ Description: string;
+ /** Direction of the reading order for the field. */
+ Direction: string;
+ /** String representation of the field type, e.g. "Lookup". Same as SPField.TypeAsString */
+ FieldType: string;
+ /** Indicates whether the field is hidden */
+ Hidden: bool;
+ /** Guid of the field */
+ Id: string;
+ /** Specifies Input Method Editor (IME) mode bias to use for the field.
+ The IME enables conversion of keystrokes between languages when one writing system has more characters than can be encoded for the given keyboard. */
+ IMEMode: any;
+ /** Internal name of the field */
+ Name: string;
+ /** Specifies if the field is read only */
+ ReadOnlyField: bool;
+ /** Specifies wherever field requires values */
+ Required: bool;
+ RestrictedMode: bool;
+ /** Title of the field */
+ Title: string;
+ /** For OOTB fields, returns the type of field. For "UserMulti" returns "User", for "LookupMulti" returns "Lookup".
+ For custom field types, returns base type of the field. */
+ Type: string;
+ /** If SPFarm.Local.UseMinWidthForHtmlPicker is true, UseMinWidth will be set to true. Undefined in other cases. */
+ UseMinWidth: bool;
+ }
+ export interface ListSchema_InForm {
+ Field: FieldSchema_InForm[];
+ }
+ export interface ListData_InForm {
+ Items: Item[];
+ }
+ export interface RenderContext_FieldInForm extends RenderContext_Form {
+ CurrentGroupIdx: number;
+ CurrentGroup: Group;
+ CurrentItems: Item[];
+ CurrentFieldSchema: FieldSchema_InForm;
+ CurrentFieldValue: any;
+ }
+ export interface RenderContext_Form extends RenderContext {
+ CurrentItem: Item;
+ FieldControlModes: { [fieldInternalName: string]: ClientControlMode; };
+ FormContext: ClientFormContext;
+ FormUniqueId: string;
+ ListData: ListData_InForm;
+ ListSchema: ListSchema_InForm;
+ }
+
+
+
+ export interface FieldSchema_InView_LookupField extends FieldSchema_InView {
+ /** Either "TRUE" or "FALSE" */
+ AllowMultipleValues: string;
+ /** Target lookup list display form URL, including PageType and List attributes. */
+ DispFormUrl: string;
+ /** Either "TRUE" or "FALSE" */
+ HasPrefix: string;
+ }
+ export interface FieldSchema_InView_UserField extends FieldSchema_InView {
+ /** Either "TRUE" or "FALSE" */
+ AllowMultipleValues: string;
+ /** Either "TRUE" or "FALSE" */
+ ImnHeader: string;
+ /** Either "TRUE" or "FALSE" */
+ HasPrefix: string;
+ /** Either "1" or "0" */
+ HasUserLink: string;
+ /** Either "1" or "0" */
+ DefaultRender: string;
+ }
+ /** Represents field schema in a list view. */
+ export interface FieldSchema_InView {
+ /** Either "TRUE" or "FALSE" */
+ AllowGridEditing: string;
+ /** Either "TRUE" or "FALSE" */
+ CalloutMenu: string;
+ ClassInfo: string; // e.g. "Menu"
+ css: string;
+ DisplayName: string;
+ /** Either "TRUE" or "FALSE" */
+ Explicit: string;
+ fieldRenderer: any;
+ FieldTitle: string;
+ /** Represents SPField.TypeAsString, e.g. "Computed", "UserMulti", etc. */
+ FieldType: string;
+ /** Indicates whether the field can be filtered. Either "TRUE" or "FALSE" */
+ Filterable: string;
+ /** Set to "TRUE" for fields that comply to the following Xpath query:
+ ViewFields/FieldRef[@Explicit='TRUE'] | Query/GroupBy/FieldRef[not(@Name=ViewFields/FieldRef/@Name)] */
+ GroupField: string;
+ /** Either "TRUE" or "FALSE" */
+ GridActiveAndReadOnly: string;
+ /** Guid of the field */
+ ID: string;
+ /** Specifies if the field contains list item menu.
+ Corresponds to ViewFields/FieldRef/@ListItemMenu attribute. Either "TRUE" or "FALSE" and might be missing. */
+ listItemMenu: string;
+ Name: string;
+ RealFieldName: string;
+ /** Either "TRUE" or "FALSE" */
+ ReadOnly: string;
+ ResultType: string;
+ /** Indicates whether the field can be sorted. Either "TRUE" or "FALSE" */
+ Sortable: string;
+ Type: string;
+ }
+ export interface ListSchema_InView {
+ /** Key-value object that represents all aggregations defined for the view.
+ Key specifies the field internal name, and value specifies the type of the aggregation. */
+ Aggregate: { [name: string]: string; };
+ /** Either "TRUE" or false (for grouping) */
+ Collapse: string;
+ /** Specifies whether to open items in a client application ("1") or in browser ("0"). */
+ DefaultItemOpen: string;
+ Direction: string;
+ /** Either "0" or "1" */
+ EffectivePresenceEnabled: string;
+ /** If in grid mode (context.inGridMode == true), cast to FieldSchema_InForm[], otherwise cast to FieldSchema_InView[] */
+ Field: any[];
+ FieldSortParam: string;
+ Filter: any;
+ /** Either "0" or "1" */
+ ForceCheckout: string;
+ /** Internal name for the first group by field, if any */
+ group1: string;
+ /** Internal name for the second group by field, if any */
+ group2: string;
+ /** "1" if the view contains "Title" field, otherwise not defined. */
+ HasTitle: string;
+ HttpVDir: string;
+ /** Either "0" or "1" */
+ InplaceSearchEnabled: string;
+ /** Either "0" or "1" */
+ IsDocLib: string;
+ /** e.g. "1033" */
+ LCID: string;
+ /** Either "0" or "1" */
+ ListRight_AddListItems: string;
+ NoListItem: string;
+ NoListItemHowTo: string;
+ /** Server-relative path to the current page */
+ PagePath: string;
+ /** Internal name of the field inside which the hierarchy buttons are displayed */
+ ParentHierarchyDisplayField: string;
+ PresenceAlt: string;
+ /** Represents SPList.RootFolder.Properties. Exists only if SPList.FetchPropertyBagForListView property is set to true. */
+ PropertyBag: { [key: string]: string; };
+ /** Either "True" or "False" */
+ RenderSaveAsNewViewButton: string;
+ /** Either "True" or "False" */
+ RenderViewSelectorPivotMenu: string;
+ /** Either "True" or "False" */
+ RenderViewSelectorPivotMenuAsync: string;
+ /** Query string parameters that specify GUID of the current view and the current root folder */
+ RootFolderParam: string;
+ SelectedID: string; // number
+ ShowWebPart: string;
+ /** Either "1" or undefined. */
+ StrikeThroughOnCompletedEnabled: string;
+ /** Either "0" or "1" */
+ TabularView: string;
+ Toolbar: string;
+ UIVersion: string; // number
+ Userid: string; // number
+ UserVanilla: any;
+ /** Server relative path to "/_layouts/userdisp.aspx" in the current web */
+ UserDispUrl: string;
+ /** Either "1" or "" */
+ UseParentHierarchy: string;
+ /** Guid of the view */
+ View: string;
+ /** JSON string */
+ ViewSelectorPivotMenuOptions: string;
+ /** Query string parameters that specify current root folder (RootFolder) and folder content type id (FolderCTID) */
+ ViewSelector_ViewParameters: string;
+ }
+ export interface ListData_InView {
+ FilterLink: string;
+ FilterFields: string;
+ FirstRow: number;
+ /** Either "0" or "1" */
+ ForceNoHierarchy: string;
+ HierarchyHasIndention: string;
+ /** Link to the previous page (not defined if not available) */
+ PrevHref: string;
+ /** Link to the next page (not defined if not available) */
+ NextHref: string;
+ SortField: string;
+ SortDir: string;
+ LastRow: number;
+ Row: Item[];
+ }
+ export interface RenderContext_GroupInView extends RenderContext_InView {
+ CurrentGroupIdx: number;
+ CurrentGroup: Group;
+ CurrentItems: Item[];
+ }
+ export interface RenderContext_InView extends RenderContext {
+ AllowCreateFolder: bool;
+ AllowGridMode: bool;
+ BasePermissions: { [PermissionName: string]: bool; }; // SP.BasePermissions?
+ bInitialRender: bool;
+ CanShareLinkForNewDocument: bool;
+ CascadeDeleteWarningMessage: string;
+ clvp: HTMLElement; // not in View
+ ContentTypesEnabled: bool;
+ ctxId: number;
+ ctxType: any; // not in View
+ CurrentUserId: number;
+ CurrentUserIsSiteAdmin: bool;
+ dictSel: any;
+ /** Absolute path for the list display form */
+ displayFormUrl: string;
+ /** Absolute path for the list edit form */
+ editFormUrl: string;
+ EnableMinorVersions: bool;
+ ExternalDataList: bool;
+ enteringGridMode: bool;
+ existingServerFilterHash: any;
+ HasRelatedCascadeLists: number;
+ heroId: string; // e.g. "idHomePageNewItem"
+ HttpPath: string;
+ HttpRoot: string;
+ imagesPath: string;
+ inGridFullRender: any; // not in View
+ inGridMode: bool;
+ IsAppWeb: bool;
+ IsClientRendering: bool;
+ isForceCheckout: bool;
+ isModerated: bool;
+ isPortalTemplate: any;
+ isWebEditorPreview: number;
+ isVersions: number;
+ isXslView: bool;
+ LastRowIndexSelected: any; // not in View
+ LastSelectableRowIdx: any;
+ LastSelectedItemId: any; // not in View
+ leavingGridMode: bool;
+ listBaseType: number;
+ ListData: ListData_InView;
+ ListDataJSONItemsKey: string; // ="Row"
+ /** Guid of the list */
+ listName: string;
+ ListSchema: ListSchema_InView;
+ listTemplate: string;
+ ListTitle: string;
+ listUrlDir: string;
+ loadingAsyncData: bool;
+ ModerationStatus: number;
+ NavigateForFormsPages: bool;
+ /** Absolute path for the list new form */
+ newFormUrl: string;
+ NewWOPIDocumentEnabled: any;
+ NewWOPIDocumentUrl: any;
+ noGroupCollapse: bool;
+ OfficialFileName: string;
+ OfficialFileNames: string;
+ overrideDeleteConfirmation: string; // not in View
+ overrideFilterQstring: string; // not in View
+ PortalUrl: string;
+ queryString: any;
+ recursiveView: bool;
+ /** either 1 or 0 */
+ RecycleBinEnabled: number;
+ RegionalSettingsTimeZoneBias: string;
+ rootFolder: string;
+ rootFolderForDisplay: any;
+ RowFocusTimerID: any;
+ SelectAllCbx: any;
+ SendToLocationName: string;
+ SendToLocationUrl: string;
+ serverUrl: any;
+ SiteTitle: string;
+ StateInitDone: bool;
+ TableCbxFocusHandler: any;
+ TableMouseOverHandler: any;
+ TotalListItems: any;
+ verEnabled: number;
+ /** Guid of the view. */
+ view: string;
+ viewTitle: string;
+ WorkflowAssociated: bool;
+ wpq: string;
+ WriteSecurity: string;
+ }
+ export interface RenderContext_ItemInView extends RenderContext_InView {
+ CurrentItem: Item;
+ CurrentItemIdx: number;
+ }
+ export interface RenderContext_FieldInView extends RenderContext_ItemInView {
+ /** If in grid mode (context.inGridMode == true), cast to FieldSchema_InForm, otherwise cast to FieldSchema_InView */
+ CurrentFieldSchema: any;
+ CurrentFieldValue: any;
+ FieldControlsModes: { [fieldInternalName: string]: ClientControlMode; };
+ FormContext: any;
+ FormUniqueId: string;
+ }
+
+ export interface Item {
+ [fieldInternalName: string]: any;
+ }
+ export interface Group {
+ Items: Item[];
+ }
+
+ export interface RenderContext {
+ BaseViewID: number;
+ ControlMode: ClientControlMode;
+ CurrentCultureName: string;
+ CurrentLanguage: number;
+ CurrentSelectedItems: any;
+ CurrentUICultureName: string;
+ ListTemplateType: number;
+ OnPostRender: any;
+ OnPreRender: any;
+ onRefreshFailed: any;
+ RenderBody: (renderContext: RenderContext) => string;
+ RenderFieldByName: (renderContext: RenderContext, fieldName: string) => string;
+ RenderFields: (renderContext: RenderContext) => string;
+ RenderFooter: (renderContext: RenderContext) => string;
+ RenderGroups: (renderContext: RenderContext) => string;
+ RenderHeader: (renderContext: RenderContext) => string;
+ RenderItems: (renderContext: RenderContext) => string;
+ RenderView: (renderContext: RenderContext) => string;
+ SiteClientTag: string;
+ Templates: TemplateOverrides;
+ }
+
+ export interface SingleTemplateCallback {
+ /** Must return null in order to fall back to a more common template or to a system default template */
+ (renderContext: RenderContext_InView): string;
+ }
+ export interface GroupCallback {
+ /** Must return null in order to fall back to a more common template or to a system default template */
+ (renderContext: RenderContext_GroupInView): string;
+ }
+ export interface ItemCallback {
+ /** Must return null in order to fall back to a more common template or to a system default template */
+ (renderContext: RenderContext): string;
+ }
+ export interface FieldInFormCallback {
+ /** Must return null in order to fall back to a more common template or to a system default template */
+ (renderContext: RenderContext_FieldInForm): string;
+ }
+ export interface FieldInViewCallback {
+ /** Must return null in order to fall back to a more common template or to a system default template */
+ (renderContext: RenderContext_FieldInView): string;
+ }
+
+ export interface FieldTemplateOverrides {
+ /** Defines templates for rendering the field on a display form. */
+ DisplayForm?: FieldInFormCallback;
+ /** Defines templates for rendering the field on an edit form. */
+ EditForm?: FieldInFormCallback;
+ /** Defines templates for rendering the field on a new form. */
+ NewForm?: FieldInFormCallback;
+ /** Defines templates for rendering the field on a list view. */
+ View?: FieldInViewCallback;
+ }
+
+ export interface FieldTemplateMap {
+ [fieldInternalName: string]: FieldTemplateOverrides;
+ }
+
+ export interface TemplateOverrides {
+ View?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template
+ Body?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template
+ /** Defines templates for rendering groups (aggregations). */
+ Group?: GroupCallback;
+ /** Defines templates for list items rendering. */
+ Item?: ItemCallback;
+ /** Defines template for rendering list view header.
+ Can be either string or SingleTemplateCallback */
+ Header?: SingleTemplateCallback;
+ /** Defines template for rendering list view footer.
+ Can be either string or SingleTemplateCallback */
+ Footer?: SingleTemplateCallback;
+ /** Defines templates for fields rendering. The field is specified by it's internal name. */
+ Fields?: FieldTemplateMap;
+ }
+ export interface TemplateOverridesOptions {
+ /** Template overrides */
+ Templates?: TemplateOverrides;
+
+ /** �allbacks called before rendering starts. Can be function (ctx: RenderContext) => void or array of functions.*/
+ OnPreRender?: any;
+
+ /** �allbacks called after rendered html inserted into DOM. Can be function (ctx: RenderContext) => void or array of functions.*/
+ OnPostRender?: any;
+
+ /** View style (SPView.StyleID) for which the templates should be applied.
+ If not defined, the templates will be applied only to default view style. */
+ ViewStyle?: number;
+ /** List template type (SPList.BaseTemplate) for which the template should be applied.
+ If not defined, the templates will be applied to all lists. */
+ ListTemplateType?: number;
+ /** Base view ID (SPView.BaseViewID) for which the template should be applied.
+ If not defined, the templates will be applied to all views. */
+ BaseViewID?: number;
+ }
+ export class TemplateManager {
+ static RegisterTemplateOverrides(renderCtx: TemplateOverridesOptions): void;
+ }
+
+ export interface ClientUserValue {
+ lookupId: number;
+ lookupValue: string;
+ displayStr: string;
+ email: string;
+ sip: string;
+ title: string;
+ picture: string;
+ department: string;
+ jobTitle: string;
+ }
+ export interface ClientLookupValue {
+ LookupId: number;
+ LookupValue: string;
+ }
+ export interface ClientUrlValue {
+ URL: string;
+ Description: string;
+ }
+ export class Utility {
+ static ComputeRegisterTypeInfo(renderCtx: TemplateOverridesOptions): any;
+ static ControlModeToString(mode: SPClientTemplates.ClientControlMode): string;
+ static FileSystemObjectTypeToString(fileSystemObjectType: SPClientTemplates.FileSystemObjectType): string;
+ static ChoiceFormatTypeToString(fileSystemObjectType: SPClientTemplates.ChoiceFormatType): string;
+ static RichTextModeToString(fileSystemObjectType: SPClientTemplates.RichTextMode): string;
+ static IsValidControlMode(mode: number): bool;
+ /** Removes leading and trailing spaces */
+ static Trim(str: string): string;
+ /** Creates SP.ClientContext based on the specified Web URL. If the SP.Runtime.js script is not loaded, returns null */
+ static InitContext(webUrl: string): SP.ClientContext;
+ static GetControlOptions(control: HTMLElement): any;
+ static TryParseInitialUserValue(userStr: string): ClientUserValue[];
+ /** Tries to resolve user names from string. Pushes either ClientUserValue (if resolved successfully) or original string (if not) to the resulting array. */
+ static TryParseUserControlValue(userStr: string, separator: string): any[];
+ static GetPropertiesFromPageContextInfo(context: RenderContext): void;
+ /** Replaces tokens "~site/", "~sitecollection/", "~sitecollectionmasterpagegallery", "{lcid}", "{locale}" and "{siteclienttag}" with appropriate context values */
+ static ReplaceUrlTokens(tokenUrl: string): string;
+ static ParseLookupValue(valueStr: string): ClientLookupValue;
+ static ParseMultiLookupValues(valueStr: string): ClientLookupValue[];
+ /** Represents lookup values array in some strange format */
+ static BuildLookupValuesAsString(choiceArray: ClientLookupValue[], isMultiLookup: bool, setGroupDesc: bool): string;
+ static ParseURLValue(value: string): ClientUrlValue;
+ static GetFormContextForCurrentField(context: RenderContext_Form): ClientFormContext;
+ }
+
+ export class ClientFormContext {
+ fieldValue: any;
+ fieldSchema: SPClientTemplates.FieldSchema_InForm;
+ fieldName: string;
+ controlMode: number;
+ webAttributes: {
+ AllowScriptableWebParts: bool;
+ CurrentUserId: number;
+ EffectivePresenceEnabled: bool;
+ LCID: string;
+ PermissionCustomizePages: bool;
+ WebUrl: string;
+ };
+ itemAttributes: {
+ ExternalListItem: boolean;
+ FsObjType: number;
+ Id: number;
+ Url: string;
+ };
+ listAttributes: {
+ BaseType: number;
+ DefaultItemOpen: number;
+ Direction: string;
+ EnableVesioning: bool;
+ Id: string;
+ };
+ registerInitCallback(fieldname: string, callback: () => void ): void;
+ registerFocusCallback(fieldname: string, callback: () => void ): void;
+ registerValidationErrorCallback(fieldname: string, callback: (error: any) => void ): void;
+ registerGetValueCallback(fieldname: string, callback: () => any): void;
+ updateControlValue(fieldname: string, value: any): void;
+ registerClientValidator(fieldname: string, validator: SPClientForms.ClientValidation.ValidatorSet): void;
+ registerHasValueChangedCallback(fieldname: string, callback: (eventArg?: any) => void );
+ }
+
+}
+
+declare function GenerateIID(renderCtx: SPClientTemplates.RenderContext_ItemInView): string;
+declare function GenerateIIDForListItem(renderCtx: SPClientTemplates.RenderContext_InView, listItem: SPClientTemplates.Item): string;
+
+declare function SPFormControl_AppendValidationErrorMessage(nodeId: string, errorResult: any): void;
+declare function CoreRender(template: any, context: any): string;
+
+declare module SPClientForms {
+ module ClientValidation {
+ export class ValidationResult {
+ constructor(hasErrors: bool, errorMsg: string);
+ }
+
+ export class ValidatorSet {
+ public RegisterValidator(validator: IValidator);
+ }
+
+ export interface IValidator {
+ Validate(value: any): ValidationResult;
+ }
+
+ export class RequiredValidator implements IValidator {
+ Validate(value: any): ValidationResult;
+ }
+ }
+}
+
+
+
+interface IEnumerator {
+ get_current(): T;
+ moveNext(): bool;
+ reset(): void;
+}
+
+interface IEnumerable {
+ getEnumerator(): IEnumerator;
+}
+
+declare module SP {
+ export class ScriptUtility {
+ static isNullOrEmptyString(str: string): bool;
+ static isNullOrUndefined(obj: any): bool;
+ static isUndefined(obj: any): bool;
+ static truncateToInt(n: number): number;
+ }
+ export class Guid {
+ constructor(guidText: string);
+ static get_empty(): SP.Guid;
+ static newGuid(): SP.Guid;
+ static isValid(uuid: string): bool;
+ toString(): string;
+ toString(format: string): string;
+ equals(uuid: SP.Guid): bool;
+ toSerialized(): string;
+ }
+ /** Specifies permissions that are used to define user roles. Represents SPBasePermissions class. */
+ export enum PermissionKind {
+ /** Has no permissions on the Web site. Not available through the user interface. */
+ emptyMask,
+ /** View items in lists, documents in document libraries, and view Web discussion comments. */
+ viewListItems,
+ /** Add items to lists, add documents to document libraries, and add Web discussion comments. */
+ addListItems,
+ /** Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries. */
+ editListItems,
+ /** Delete items from a list, documents from a document library, and Web discussion comments in documents. */
+ deleteListItems,
+ /** Approve a minor version of a list item or document. */
+ approveItems,
+ /** View the source of documents with server-side file handlers. */
+ openItems,
+ /** View past versions of a list item or document. */
+ viewVersions,
+ /** Delete past versions of a list item or document. */
+ deleteVersions,
+ /** Discard or check in a document which is checked out to another user. */
+ cancelCheckout,
+ /** Create, change, and delete personal views of lists. */
+ managePersonalViews,
+ /** Create and delete lists, add or remove columns in a list, and add or remove public views of a list. */
+ manageLists,
+ /** View forms, views, and application pages, and enumerate lists. */
+ viewFormPages,
+ /** 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,
+ /** Allow users to open a Web site, list, or folder to access items inside that container. */
+ open,
+ /** View pages in a Web site. */
+ viewPages,
+ /** Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a SharePoint Foundation?compatible editor. */
+ addAndCustomizePages,
+ /** Apply a theme or borders to the entire Web site. */
+ applyThemeAndBorder,
+ /** Apply a style sheet (.css file) to the Web site. */
+ applyStyleSheets,
+ /** View reports on Web site usage. */
+ viewUsageData,
+ /** Create a Web site using Self-Service Site Creation. */
+ createSSCSite,
+ /** Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. */
+ manageSubwebs,
+ /** Create a group of users that can be used anywhere within the site collection. */
+ createGroups,
+ /** Create and change permission levels on the Web site and assign permissions to users and groups. */
+ managePermissions,
+ /** Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces. */
+ browseDirectories,
+ /** View information about users of the Web site. */
+ browseUserInfo,
+ /** Add or remove personal Web Parts on a Web Part Page. */
+ addDelPrivateWebParts,
+ /** Update Web Parts to display personalized information. */
+ updatePersonalWebParts,
+ /** Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web 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,
+ /** 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,
+ /** Use features that launch client applications; otherwise, users must work on documents locally and upload changes. */
+ useClientIntegration,
+ /** Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site. */
+ useRemoteAPIs,
+ /** Manage alerts for all users of the Web site. */
+ manageAlerts,
+ /** Create e-mail alerts. */
+ createAlerts,
+ /** Allows a user to change his or her user information, such as adding a picture. */
+ editMyUserInfo,
+ /** Enumerate permissions on the Web site, list, folder, document, or list item. */
+ enumeratePermissions,
+ /** Has all permissions on the Web site. Not available through the user interface. */
+ fullMask,
+ }
+
+ export class BaseCollection implements IEnumerable {
+ getEnumerator(): IEnumerator;
+ get_count(): number;
+ itemAtIndex(index: number): T;
+ constructor();
+ }
+ export interface IFromJson {
+ fromJson(initValue: any): void;
+ customFromJson(initValue: any): bool;
+ }
+ export class Base64EncodedByteArray {
+ constructor();
+ constructor(base64Str: string);
+ get_length(): number;
+ toBase64String(): string;
+ append(b: any): void;
+ getByteAt(index: number): any;
+ setByteAt(index: number, b: any): void;
+ }
+ export class ConditionalScopeBase {
+ startScope(): any;
+ startIfTrue(): any;
+ startIfFalse(): any;
+ get_testResult(): bool;
+ fromJson(initValue: any): void;
+ customFromJson(initValue: any): bool;
+ }
+ export class ClientObjectPropertyConditionalScope extends SP.ConditionalScopeBase {
+ constructor(clientObject: SP.ClientObject, propertyName: string, comparisonOperator: string, valueToCompare: any);
+ constructor(clientObject: SP.ClientObject, propertyName: string, comparisonOperator: string, valueToCompare: any, allowAllActions: bool);
+ }
+ export class ClientResult {
+ get_value(): any;
+ setValue(value: any): void;
+ constructor();
+ }
+ export class BooleanResult {
+ get_value(): bool;
+ constructor();
+ }
+ export class CharResult {
+ get_value(): any;
+ constructor();
+ }
+ export class IntResult {
+ get_value(): number;
+ constructor();
+ }
+ export class DoubleResult {
+ get_value(): number;
+ constructor();
+ }
+ export class StringResult {
+ get_value(): string;
+ constructor();
+ }
+ export class DateTimeResult {
+ get_value(): Date;
+ constructor();
+ }
+ export class GuidResult {
+ get_value(): SP.Guid;
+ constructor();
+ }
+ export class JsonObjectResult {
+ get_value(): any;
+ constructor();
+ }
+ export class ClientDictionaryResultHandler {
+ constructor(dict: SP.ClientResult);
+ }
+ export class ClientUtility {
+ static urlPathEncodeForXmlHttpRequest(url: string): string;
+ static getOrCreateObjectPathForConstructor(context: SP.ClientRuntimeContext, typeId: string, args: any[]): SP.ObjectPath;
+ }
+ export class XElement {
+ get_name(): string;
+ set_name(value: string): void;
+ get_attributes(): any;
+ set_attributes(value: any): void;
+ get_children(): any;
+ set_children(value: any): void;
+ constructor();
+ }
+ export class ClientXElement {
+ get_element(): SP.XElement;
+ set_element(value: SP.XElement): void;
+ constructor();
+ }
+ export class ClientXDocument {
+ get_root(): SP.XElement;
+ set_root(value: SP.XElement): void;
+ constructor();
+ }
+ export class DataConvert {
+ static writePropertiesToXml(writer: SP.XmlWriter, obj: any, propNames: string[], serializationContext: SP.SerializationContext): void;
+ static populateDictionaryFromObject(dict: any, parentNode: any): void;
+ static fixupTypes(context: SP.ClientRuntimeContext, dict: any): void;
+ static populateArray(context: SP.ClientRuntimeContext, dest: any, jsonArrayFromServer: any): void;
+ static fixupType(context: SP.ClientRuntimeContext, obj: any): any;
+ static writeDictionaryToXml(writer: SP.XmlWriter, dict: any, topLevelElementTagName: string, keys: any, serializationContext: SP.SerializationContext): void;
+ static writeValueToXmlElement(writer: SP.XmlWriter, objValue: any, serializationContext: SP.SerializationContext): void;
+ static invokeSetProperty(obj: any, propName: string, propValue: any): void;
+ static invokeGetProperty(obj: any, propName: string): any;
+ static specifyDateTimeKind(datetime: Date, kind: SP.DateTimeKind): void;
+ static getDateTimeKind(datetime: Date): SP.DateTimeKind;
+ static createUnspecifiedDateTime(year: number, month: number, day: number, hour: number, minute: number, second: number, milliseconds: number): Date;
+ static createUtcDateTime(milliseconds: number): Date;
+ static createLocalDateTime(milliseconds: number): Date;
+ }
+ export interface IWebRequestExecutorFactory {
+ createWebRequestExecutor(): Sys.Net.WebRequestExecutor;
+ }
+ export class PageRequestFailedEventArgs extends Sys.EventArgs {
+ get_executor(): Sys.Net.WebRequestExecutor;
+ get_errorMessage(): string;
+ get_isErrorPage(): bool;
+ }
+ export class PageRequestSucceededEventArgs extends Sys.EventArgs {
+ get_executor(): Sys.Net.WebRequestExecutor;
+ }
+ export class PageRequest {
+ get_request(): Sys.Net.WebRequest;
+ get_url(): string;
+ set_url(value: string): void;
+ get_expectedContentType(): string;
+ set_expectedContentType(value: string): void;
+ post(body: string): void;
+ get (): void;
+ static doPost(url: string, body: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void , failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void;
+ static doGet(url: string, expectedContentType: string, succeededHandler: (sender: any, args: SP.PageRequestSucceededEventArgs) => void , failedHandler: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void;
+ add_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void ): void;
+ remove_succeeded(value: (sender: any, args: SP.PageRequestSucceededEventArgs) => void ): void;
+ add_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void;
+ remove_failed(value: (sender: any, args: SP.PageRequestFailedEventArgs) => void ): void;
+ constructor();
+ }
+ export class ResResources {
+ static getString(resourceId: string, args: any[]): string;
+ }
+ /** Defines a writer that provides a set of methods to append text in XML format. Use the static SP.XmlWriter.create(sb) Method to create an SP.XmlWriter object with the Sys.StringBuilder object you pass in. */
+ export class XmlWriter {
+ /** Creates a new instance of the XmlWriter class with the specified string builder. */
+ static create(sb: Sys.StringBuilder): SP.XmlWriter;
+ /** Appends a start element tag with the specified name in XML format to the object?s string builder. */
+ writeStartElement(tagName: string): void;
+ /** Appends an element with the specified tag name and value in XML format to the string builder. */
+ writeElementString(tagName: string, value: string): void;
+ /** Appends an end element tag in XML format to the object?s string builder. This method appends the end element tag ?/>? if the start element tag is not closed; otherwise, it appends a full end element tag ?? to the string builder. */
+ writeEndElement(): void;
+ /** Appends an attribute with the specified name and value in XML format to the object?s string builder. */
+ writeAttributeString(localName: string, value: string): void;
+ /** This method only appends the name of the attribute. You can append the value of the attribute by calling the SP.XmlWriter.writeString(value) Method, and close the attribute by calling the SP.XmlWriter.writeEndAttribute() Method. */
+ writeStartAttribute(localName: string): void;
+ /** Appends an end of an attribute in XML format to the object?s string builder. */
+ writeEndAttribute(): void;
+ /** Appends the specified value for an element tag or attribute to the object?s string builder. */
+ writeString(value: string): void;
+ /** Appends the specified text to the object?s string builder. */
+ writeRaw(xml: string): void;
+ /** This member is reserved for internal use and is not intended to be used directly from your code. */
+ close(): void;
+ }
+
+ export class ClientConstants {
+ AddExpandoFieldTypeSuffix: string;
+ Actions: string;
+ ApplicationName: string;
+ Body: string;
+ CatchScope: string;
+ ChildItemQuery: string;
+ ChildItems: string;
+ ConditionalScope: string;
+ Constructor: string;
+ Context: string;
+ ErrorInfo: string;
+ ErrorMessage: string;
+ ErrorStackTrace: string;
+ ErrorCode: string;
+ ErrorTypeName: string;
+ ErrorValue: string;
+ ErrorDetails: string;
+ ErrorTraceCorrelationId: string;
+ ExceptionHandlingScope: string;
+ ExceptionHandlingScopeSimple: string;
+ QueryableExpression: string;
+ FinallyScope: string;
+ HasException: string;
+ Id: string;
+ Identity: string;
+ IfFalseScope: string;
+ IfTrueScope: string;
+ IsNull: string;
+ LibraryVersion: string;
+ TraceCorrelationId: string;
+ Count: string;
+ Method: string;
+ Methods: string;
+ Name: string;
+ Object: string;
+ ObjectPathId: string;
+ ObjectPath: string;
+ ObjectPaths: string;
+ ObjectType: string;
+ ObjectIdentity: string;
+ ObjectIdentityQuery: string;
+ ObjectVersion: string;
+ Parameter: string;
+ Parameters: string;
+ ParentId: string;
+ Processed: string;
+ Property: string;
+ Properties: string;
+ Query: string;
+ QueryResult: string;
+ Request: string;
+ Results: string;
+ ScalarProperty: string;
+ SchemaVersion: string;
+ ScopeId: string;
+ SelectAll: string;
+ SelectAllProperties: string;
+ SetProperty: string;
+ SetStaticProperty: string;
+ StaticMethod: string;
+ StaticProperty: string;
+ SuffixChar: string;
+ SuffixByte: string;
+ SuffixInt16: string;
+ SuffixUInt16: string;
+ SuffixInt32: string;
+ SuffixUInt32: string;
+ SuffixInt64: string;
+ SuffixUInt64: string;
+ SuffixSingle: string;
+ SuffixDouble: string;
+ SuffixDecimal: string;
+ SuffixTimeSpan: string;
+ SuffixArray: string;
+ Test: string;
+ TryScope: string;
+ Type: string;
+ TypeId: string;
+ Update: string;
+ Version: string;
+ XmlElementName: string;
+ XmlElementAttributes: string;
+ XmlElementChildren: string;
+ XmlNamespace: string;
+ FieldValuesMethodName: string;
+ RequestTokenHeader: string;
+ FormDigestHeader: string;
+ useWebLanguageHeader: string;
+ useWebLanguageHeaderValue: string;
+ ClientTagHeader: string;
+ TraceCorrelationIdRequestHeader: string;
+ TraceCorrelationIdResponseHeader: string;
+ greaterThan: string;
+ lessThan: string;
+ equal: string;
+ notEqual: string;
+ greaterThanOrEqual: string;
+ lessThanOrEqual: string;
+ andAlso: string;
+ orElse: string;
+ not: string;
+ expressionParameter: string;
+ expressionProperty: string;
+ expressionStaticProperty: string;
+ expressionMethod: string;
+ expressionStaticMethod: string;
+ expressionConstant: string;
+ expressionConvert: string;
+ expressionTypeIs: string;
+ ofType: string;
+ take: string;
+ where: string;
+ orderBy: string;
+ orderByDescending: string;
+ thenBy: string;
+ thenByDescending: string;
+ queryableObject: string;
+ ServiceFileName: string;
+ ServiceMethodName: string;
+ fluidApplicationInitParamUrl: string;
+ fluidApplicationInitParamViaUrl: string;
+ fluidApplicationInitParamRequestToken: string;
+ fluidApplicationInitParamFormDigestTimeoutSeconds: string;
+ fluidApplicationInitParamFormDigest: string;
+
+ }
+ export class ClientSchemaVersions {
+ version14: string;
+ version15: string;
+ currentVersion: string;
+ }
+ export class ClientErrorCodes {
+ genericError: number;
+ accessDenied: number;
+ docAlreadyExists: number;
+ versionConflict: number;
+ listItemDeleted: number;
+ invalidFieldValue: number;
+ notSupported: number;
+ redirect: number;
+ notSupportedRequestVersion: number;
+ fieldValueFailedValidation: number;
+ itemValueFailedValidation: number;
+ }
+ export class ClientAction {
+ get_id(): number;
+ get_path(): SP.ObjectPath;
+ get_name(): string;
+ }
+ export class ClientActionSetProperty extends SP.ClientAction {
+ constructor(obj: SP.ClientObject, propName: string, propValue: any);
+ }
+ export class ClientActionSetStaticProperty extends SP.ClientAction {
+ constructor(context: SP.ClientRuntimeContext, typeId: string, propName: string, propValue: any);
+ }
+ export class ClientActionInvokeMethod extends SP.ClientAction {
+ constructor(obj: SP.ClientObject, methodName: string, parameters: any[]);
+ }
+ export class ClientActionInvokeStaticMethod extends SP.ClientAction {
+ constructor(context: SP.ClientRuntimeContext, typeId: string, methodName: string, parameters: any[]);
+ }
+ export class ClientObject {
+ get_context(): SP.ClientRuntimeContext;
+ get_path(): SP.ObjectPath;
+ get_objectVersion(): string;
+ set_objectVersion(value: string): void;
+ fromJson(initValue: any): void;
+ customFromJson(initValue: any): bool;
+ retrieve(): void;
+ refreshLoad(): void;
+ retrieve(propertyNames: string[]): void;
+ isPropertyAvailable(propertyName: string): bool;
+ isObjectPropertyInstantiated(propertyName: string): bool;
+ get_serverObjectIsNull(): bool;
+ get_typedObject(): SP.ClientObject;
+ }
+ export class ClientObjectData {
+ get_properties(): any;
+ get_clientObjectProperties(): any;
+ get_methodReturnObjects(): any;
+ constructor();
+ }
+ /** Provides a base class for a collection of objects on a remote client. */
+ export class ClientObjectCollection extends SP.ClientObject implements IEnumerable {
+ get_areItemsAvailable(): bool;
+ /** Gets the data for all of the items in the collection. */
+ retrieveItems(): SP.ClientObjectPrototype;
+ /** Returns an enumerator that iterates through the collection. */
+ getEnumerator(): IEnumerator;
+ /** Returns number of items in the collection. */
+ get_count(): number;
+ get_data(): T[];
+ addChild(obj: T): void;
+ getItemAtIndex(index: number): T;
+ fromJson(obj: any): void;
+ }
+ export class ClientObjectList extends SP.ClientObjectCollection {
+ constructor(context: SP.ClientRuntimeContext, objectPath: SP.ObjectPath, childItemType: any);
+ fromJson(initValue: any): void;
+ customFromJson(initValue: any): bool;
+ }
+ export class ClientObjectPrototype {
+ retrieve(): void;
+ retrieve(propertyNames: string[]): void;
+ retrieveObject(propertyName: string): SP.ClientObjectPrototype;
+ retrieveCollectionObject(propertyName: string): SP.ClientObjectCollectionPrototype;
+ }
+ export class ClientObjectCollectionPrototype extends SP.ClientObjectPrototype {
+ retrieveItems(): SP.ClientObjectPrototype;
+ }
+ export enum ClientRequestStatus {
+ active,
+ inProgress,
+ completedSuccess,
+ completedException,
+ }
+ export class WebRequestEventArgs extends Sys.EventArgs {
+ constructor(webRequest: Sys.Net.WebRequest);
+ get_webRequest(): Sys.Net.WebRequest;
+ }
+ export class ClientRequest {
+ static get_nextSequenceId(): number;
+ get_webRequest(): Sys.Net.WebRequest;
+ add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void;
+ remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void;
+ add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void;
+ remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void;
+ get_navigateWhenServerRedirect(): bool;
+ set_navigateWhenServerRedirect(value: bool): void;
+ }
+ export class ClientRequestEventArgs extends Sys.EventArgs {
+ get_request(): SP.ClientRequest;
+ }
+ export class ClientRequestFailedEventArgs extends SP.ClientRequestEventArgs {
+ constructor(request: SP.ClientRequest, message: string, stackTrace: string, errorCode: number, errorValue: string, errorTypeName: string, errorDetails: any);
+ constructor(request: SP.ClientRequest, message: string, stackTrace: string, errorCode: number, errorValue: string, errorTypeName: string, errorDetails: any, errorTraceCorrelationId: string);
+ get_message(): string;
+ get_stackTrace(): string;
+ get_errorCode(): number;
+ get_errorValue(): string;
+ get_errorTypeName(): string;
+ get_errorDetails(): any;
+ get_errorTraceCorrelationId(): string;
+ }
+ export class ClientRequestSucceededEventArgs extends SP.ClientRequestEventArgs {
+ }
+ export class ClientRuntimeContext implements Sys.IDisposable {
+ constructor(serverRelativeUrlOrFullUrl: string);
+ get_url(): string;
+ get_viaUrl(): string;
+ set_viaUrl(value: string): void;
+ get_formDigestHandlingEnabled(): bool;
+ set_formDigestHandlingEnabled(value: bool): void;
+ get_applicationName(): string;
+ set_applicationName(value: string): void;
+ get_clientTag(): string;
+ set_clientTag(value: string): void;
+ get_webRequestExecutorFactory(): SP.IWebRequestExecutorFactory;
+ set_webRequestExecutorFactory(value: SP.IWebRequestExecutorFactory): void;
+ get_pendingRequest(): SP.ClientRequest;
+ get_hasPendingRequest(): bool;
+ add_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void ): void;
+ remove_executingWebRequest(value: (sender: any, args: SP.WebRequestEventArgs) => void ): void;
+ add_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void;
+ remove_requestSucceeded(value: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void;
+ add_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void;
+ remove_requestFailed(value: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void;
+ add_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void ): void;
+ remove_beginningRequest(value: (sender: any, args: SP.ClientRequestEventArgs) => void ): void;
+ get_requestTimeout(): number;
+ set_requestTimeout(value: number): void;
+ executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void , failedCallback: (sender: any, args: SP.ClientRequestFailedEventArgs) => void ): void;
+ executeQueryAsync(succeededCallback: (sender: any, args: SP.ClientRequestSucceededEventArgs) => void ): void;
+ executeQueryAsync(): void;
+ get_staticObjects(): any;
+ castTo(obj: SP.ClientObject, type: any): SP.ClientObject;
+ addQuery(query: SP.ClientAction): void;
+ addQueryIdAndResultObject(id: number, obj: any): void;
+ parseObjectFromJsonString(json: string): any;
+ parseObjectFromJsonString(json: string, skipTypeFixup: bool): any;
+ load(clientObject: SP.ClientObject): void;
+ loadQuery(clientObjectCollection: SP.ClientObjectCollection, exp: string): any;
+ load(clientObject: SP.ClientObject, ...exps: string[]): void;
+ loadQuery(clientObjectCollection: SP.ClientObjectCollection): any;
+ get_serverSchemaVersion(): string;
+ get_serverLibraryVersion(): string;
+ get_traceCorrelationId(): string;
+ set_traceCorrelationId(value: string): void;
+ dispose(): void;
+ }
+ export class SimpleDataTable {
+ get_rows(): any[];
+ constructor();
+ }
+ export class ClientValueObject {
+ fromJson(obj: any): void;
+ customFromJson(obj: any): bool;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ customWriteToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): bool;
+ get_typeId(): string;
+ }
+ export class ClientValueObjectCollection extends SP.ClientValueObject implements IEnumerable {
+ get_count(): number;
+ getEnumerator(): IEnumerator;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ }
+ export class ExceptionHandlingScope {
+ constructor(context: SP.ClientRuntimeContext);
+ startScope(): any;
+ startTry(): any;
+ startCatch(): any;
+ startFinally(): any;
+ get_processed(): bool;
+ get_hasException(): bool;
+ get_errorMessage(): string;
+ get_serverStackTrace(): string;
+ get_serverErrorCode(): number;
+ get_serverErrorValue(): string;
+ get_serverErrorTypeName(): string;
+ get_serverErrorDetails(): any;
+ }
+ export class ObjectIdentityQuery extends SP.ClientAction {
+ constructor(objectPath: SP.ObjectPath);
+ }
+ export class ObjectPath {
+ setPendingReplace(): void;
+ }
+ export class ObjectPathProperty extends SP.ObjectPath {
+ constructor(context: SP.ClientRuntimeContext, parent: SP.ObjectPath, propertyName: string);
+ }
+ export class ObjectPathStaticProperty extends SP.ObjectPath {
+ constructor(context: SP.ClientRuntimeContext, typeId: string, propertyName: string);
+ }
+ export class ObjectPathMethod extends SP.ObjectPath {
+ constructor(context: SP.ClientRuntimeContext, parent: SP.ObjectPath, methodName: string, parameters: any[]);
+ }
+ export class ObjectPathStaticMethod extends SP.ObjectPath {
+ constructor(context: SP.ClientRuntimeContext, typeId: string, methodName: string, parameters: any[]);
+ }
+ export class ObjectPathConstructor extends SP.ObjectPath {
+ constructor(context: SP.ClientRuntimeContext, typeId: string, parameters: any[]);
+ }
+ export class SerializationContext {
+ addClientObject(obj: SP.ClientObject): void;
+ addObjectPath(path: SP.ObjectPath): void;
+ }
+ export class ResourceStrings {
+ argumentExceptionMessage: string;
+ argumentNullExceptionMessage: string;
+ cC_AppIconAlt: string;
+ cC_AppWebUrlNotSet: string;
+ cC_ArrowImageAlt: string;
+ cC_BackToSite: string;
+ cC_ErrorGettingThemeInfo: string;
+ cC_HelpLinkToolTip: string;
+ cC_HostSiteUrlNotSet: string;
+ cC_InvalidArgument: string;
+ cC_InvalidJSON: string;
+ cC_InvalidOperation: string;
+ cC_PlaceHolderElementNotFound: string;
+ cC_RequiredScriptNotLoaded: string;
+ cC_SendFeedback: string;
+ cC_SettingsLinkToolTip: string;
+ cC_TimeoutGettingThemeInfo: string;
+ cC_Welcome: string;
+ cannotFindContextWebServerRelativeUrl: string;
+ collectionHasNotBeenInitialized: string;
+ collectionModified: string;
+ invalidUsageOfConditionalScope: string;
+ invalidUsageOfConditionalScopeNowAllowedAction: string;
+ invalidUsageOfExceptionHandlingScope: string;
+ namedPropertyHasNotBeenInitialized: string;
+ namedServerObjectIsNull: string;
+ noObjectPathAssociatedWithObject: string;
+ notSameClientContext: string;
+ notSupportedQueryExpressionWithExpressionDetail: string;
+ objectNameIdentity: string;
+ objectNameMethod: string;
+ objectNameProperty: string;
+ objectNameType: string;
+ propertyHasNotBeenInitialized: string;
+ rE_BrowserBinaryDataNotSupported: string;
+ rE_BrowserNotSupported: string;
+ rE_CannotAccessSite: string;
+ rE_CannotAccessSiteCancelled: string;
+ rE_CannotAccessSiteOpenWindowFailed: string;
+ rE_DismissOpenWindowMessageLinkText: string;
+ rE_DomainDoesNotMatch: string;
+ rE_FixitHelpMessage: string;
+ rE_InvalidArgumentOrField: string;
+ rE_InvalidOperation: string;
+ rE_NoTrustedOrigins: string;
+ rE_OpenWindowButtonText: string;
+ rE_OpenWindowMessage: string;
+ rE_RequestAbortedOrTimedout: string;
+ rE_RequestUnexpectedResponse: string;
+ rE_RequestUnexpectedResponseWithContentTypeAndStatus: string;
+ requestAbortedOrTimedOut: string;
+ requestEmptyQueryName: string;
+ requestHasBeenExecuted: string;
+ requestUnexpectedResponse: string;
+ requestUnexpectedResponseWithContentTypeAndStatus: string;
+ requestUnexpectedResponseWithStatus: string;
+ requestUnknownResponse: string;
+ serverObjectIsNull: string;
+ unknownError: string;
+ unknownResponseData: string;
+ }
+ export class RuntimeRes {
+ cC_PlaceHolderElementNotFound: string;
+ rE_CannotAccessSiteOpenWindowFailed: string;
+ noObjectPathAssociatedWithObject: string;
+ cC_TimeoutGettingThemeInfo: string;
+ unknownResponseData: string;
+ requestUnexpectedResponseWithStatus: string;
+ objectNameProperty: string;
+ requestUnknownResponse: string;
+ rE_RequestUnexpectedResponseWithContentTypeAndStatus: string;
+ rE_BrowserNotSupported: string;
+ argumentExceptionMessage: string;
+ namedServerObjectIsNull: string;
+ objectNameType: string;
+ requestUnexpectedResponseWithContentTypeAndStatus: string;
+ cC_InvalidJSON: string;
+ invalidUsageOfExceptionHandlingScope: string;
+ serverObjectIsNull: string;
+ cC_AppWebUrlNotSet: string;
+ rE_OpenWindowMessage: string;
+ argumentNullExceptionMessage: string;
+ cC_HelpLinkToolTip: string;
+ propertyHasNotBeenInitialized: string;
+ rE_RequestAbortedOrTimedout: string;
+ invalidUsageOfConditionalScope: string;
+ cC_ErrorGettingThemeInfo: string;
+ rE_DismissOpenWindowMessageLinkText: string;
+ rE_CannotAccessSiteCancelled: string;
+ objectNameIdentity: string;
+ cC_HostSiteUrlNotSet: string;
+ rE_FixitHelpMessage: string;
+ notSupportedQueryExpressionWithExpressionDetail: string;
+ rE_RequestUnexpectedResponse: string;
+ rE_DomainDoesNotMatch: string;
+ cC_BackToSite: string;
+ rE_NoTrustedOrigins: string;
+ rE_InvalidOperation: string;
+ collectionModified: string;
+ cC_Welcome: string;
+ cC_AppIconAlt: string;
+ cC_SendFeedback: string;
+ cC_ArrowImageAlt: string;
+ cC_InvalidOperation: string;
+ requestAbortedOrTimedOut: string;
+ invalidUsageOfConditionalScopeNowAllowedAction: string;
+ cannotFindContextWebServerRelativeUrl: string;
+ rE_OpenWindowButtonText: string;
+ unknownError: string;
+ cC_InvalidArgument: string;
+ rE_InvalidArgumentOrField: string;
+ cC_SettingsLinkToolTip: string;
+ requestEmptyQueryName: string;
+ cC_RequiredScriptNotLoaded: string;
+ rE_CannotAccessSite: string;
+ notSameClientContext: string;
+ requestUnexpectedResponse: string;
+ rE_BrowserBinaryDataNotSupported: string;
+ collectionHasNotBeenInitialized: string;
+ namedPropertyHasNotBeenInitialized: string;
+ requestHasBeenExecuted: string;
+ objectNameMethod: string;
+ }
+ export class ParseJSONUtil {
+ static parseObjectFromJsonString(json: string): any;
+ static validateJson(text: string): bool;
+ }
+ export enum DateTimeKind {
+ unspecified,
+ utc,
+ local,
+ }
+ export class OfficeVersion {
+ majorBuildVersion: number;
+ previousMajorBuildVersion: number;
+ majorVersion: string;
+ previousVersion: string;
+ majorVersionDotZero: string;
+ previousVersionDotZero: string;
+ assemblyVersion: string;
+ wssMajorVersion: string;
+ }
+ export class ClientContext extends SP.ClientRuntimeContext {
+ constructor(serverRelativeUrlOrFullUrl: string);
+ static get_current(): SP.ClientContext;
+ constructor();
+ get_web(): SP.Web;
+ get_site(): SP.Site;
+ get_serverVersion(): string;
+ }
+ export enum ULSTraceLevel {
+ verbose,
+ }
+ /** Provides a Unified Logging Service (ULS) that monitors log messages. */
+ export class ULS {
+ /** Gets a value that indicates whether the Unified Logging Service (ULS) is enabled. */
+ static get_enabled(): bool;
+ /** Sets a value that indicates whether the Unified Logging Service (ULS) is enabled. */
+ static set_enabled(value: bool): void;
+ /** Logs the specified debug message.
+ This method logs the message with a time stamp. If any log messages are pending, this method also logs them. If the message cannot be logged, the message is added to the list of pending log messages. */
+ static log(debugMessage: string): void;
+ /** Increases the indentation for subsequent log messages. */
+ static increaseIndent(): void;
+ /** Decreases the indentation for subsequent log messages. */
+ static decreaseIndent(): void;
+ /** Traces when the function was entered. */
+ static traceApiEnter(functionName: string, args: any[]): void;
+ /** Traces when the function was entered. */
+ static traceApiEnter(functionName: string): void;
+ /** Traces when the function has finished. */
+ static traceApiLeave(): void;
+ }
+ export class AccessRequests {
+ static changeRequestStatus(context: SP.ClientRuntimeContext, itemId: number, newStatus: number, convStr: string, permType: string, permissionLevel: number): void;
+ static changeRequestStatusBulk(context: SP.ClientRuntimeContext, requestIds: number[], newStatus: number): void;
+ }
+ export enum AddFieldOptions {
+ defaultValue,
+ addToDefaultContentType,
+ addToNoContentType,
+ addToAllContentTypes,
+ addFieldInternalNameHint,
+ addFieldToDefaultView,
+ addFieldCheckDisplayName,
+ }
+ export class AlternateUrl extends SP.ClientObject {
+ get_uri(): string;
+ get_urlZone(): SP.UrlZone;
+ }
+ export class App extends SP.ClientObject {
+ get_assetId(): string;
+ get_contentMarket(): string;
+ get_versionString(): string;
+ }
+ export class AppCatalog {
+ static getAppInstances(context: SP.ClientRuntimeContext, web: SP.Web): SP.ClientObjectList;
+ static getDeveloperSiteAppInstancesByIds(context: SP.ClientRuntimeContext, site: SP.Site, appInstanceIds: SP.Guid[]): SP.ClientObjectList;
+ static isAppSideloadingEnabled(context: SP.ClientRuntimeContext): SP.BooleanResult;
+ }
+ export class AppContextSite extends SP.ClientObject {
+ constructor(context: SP.ClientRuntimeContext, siteUrl: string);
+ get_site(): SP.Site;
+ get_web(): SP.Web;
+ static newObject(context: SP.ClientRuntimeContext, siteUrl: string): SP.AppContextSite;
+ }
+ export class AppInstance extends SP.ClientObject {
+ get_appPrincipalId(): string;
+ get_appWebFullUrl(): string;
+ get_id(): SP.Guid;
+ get_inError(): bool;
+ get_startPage(): string;
+ get_remoteAppUrl(): string;
+ get_settingsPageUrl(): string;
+ get_siteId(): SP.Guid;
+ get_status(): SP.AppInstanceStatus;
+ get_title(): string;
+ get_webId(): SP.Guid;
+ getErrorDetails(): SP.ClientObjectList;
+ uninstall(): SP.GuidResult;
+ upgrade(appPackageStream: any[]): void;
+ cancelAllJobs(): SP.BooleanResult;
+ install(): SP.GuidResult;
+ getPreviousAppVersion(): SP.App;
+ retryAllJobs(): void;
+ }
+ export class AppInstanceErrorDetails extends SP.ClientObject {
+ get_correlationId(): SP.Guid;
+ set_correlationId(value: SP.Guid): void;
+ get_errorDetail(): string;
+ get_errorType(): SP.AppInstanceErrorType;
+ set_errorType(value: SP.AppInstanceErrorType): void;
+ get_errorTypeName(): string;
+ get_exceptionMessage(): string;
+ get_source(): SP.AppInstanceErrorSource;
+ set_source(value: SP.AppInstanceErrorSource): void;
+ get_sourceName(): string;
+ }
+ export enum AppInstanceErrorSource {
+ common,
+ appWeb,
+ parentWeb,
+ remoteWebSite,
+ database,
+ officeExtension,
+ eventCallouts,
+ finalization,
+ }
+ export enum AppInstanceErrorType {
+ transient,
+ configuration,
+ app,
+ }
+ export enum AppInstanceStatus {
+ invalidStatus,
+ installing,
+ canceling,
+ uninstalling,
+ installed,
+ upgrading,
+ initialized,
+ upgradeCanceling,
+ disabling,
+ disabled,
+ }
+ export class AppLicense extends SP.ClientValueObject {
+ get_rawXMLLicenseToken(): string;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class AppLicenseCollection extends SP.ClientValueObjectCollection {
+ add(item: SP.AppLicense): void;
+ get_item(index: number): SP.AppLicense;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum AppLicenseType {
+ perpetualMultiUser,
+ perpetualAllUsers,
+ trialMultiUser,
+ trialAllUsers,
+ }
+ export class Attachment extends SP.ClientObject {
+ get_fileName(): string;
+ get_serverRelativeUrl(): string;
+ deleteObject(): void;
+ }
+ export class AttachmentCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.Attachment;
+ get_item(index: number): SP.Attachment;
+ getByFileName(fileName: string): SP.Attachment;
+ }
+ export class AttachmentCreationInformation extends SP.ClientValueObject {
+ get_contentStream(): any[];
+ set_contentStream(value: any[]): void;
+ get_fileName(): string;
+ set_fileName(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class BasePermissions extends SP.ClientValueObject {
+ set (perm: SP.PermissionKind): void;
+ clear(perm: SP.PermissionKind): void;
+ clearAll(): void;
+ has(perm: SP.PermissionKind): bool;
+ equals(perm: SP.BasePermissions): bool;
+ hasPermissions(high: number, low: number): bool;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ /** Specifies the base type for a list. */
+ export enum BaseType {
+ none,
+ genericList,
+ documentLibrary,
+ unused,
+ discussionBoard,
+ survey,
+ issue,
+ }
+ export enum BrowserFileHandling {
+ permissive,
+ strict,
+ }
+ export enum CalendarType {
+ none,
+ gregorian,
+ japan,
+ taiwan,
+ korea,
+ hijri,
+ thai,
+ hebrew,
+ gregorianMEFrench,
+ gregorianArabic,
+ gregorianXLITEnglish,
+ gregorianXLITFrench,
+ koreaJapanLunar,
+ chineseLunar,
+ sakaEra,
+ umAlQura,
+ }
+ /** Specifies a Collaborative Application Markup Language (CAML) query on a list. */
+ export class CamlQuery extends SP.ClientValueObject {
+ constructor();
+ /** This method creates a Collaborative Application Markup Language (CAML) string
+ that can be used to recursively get all of the items in a list, including
+ the items in the subfolders. */
+ static createAllItemsQuery(): SP.CamlQuery;
+ /** This method creates a Collaborative Application Markup Language (CAML) string
+ that can be used to recursively get all of the folders in a list, including
+ the subfolders. */
+ static createAllFoldersQuery(): SP.CamlQuery;
+ /** Returns true if the query returns dates in Coordinated Universal Time (UTC) format. */
+ get_datesInUtc(): bool;
+ /** Sets a value that indicates whether the query returns dates in Coordinated Universal Time (UTC) format. */
+ set_datesInUtc(value: bool): void;
+ /** Server relative URL of a list folder from which results will be returned. */
+ get_folderServerRelativeUrl(): string;
+ /** Sets a value that specifies the server relative URL of a list folder from which results will be returned. */
+ set_folderServerRelativeUrl(value: string): void;
+ get_listItemCollectionPosition(): SP.ListItemCollectionPosition;
+ /** Sets a value that specifies the information required to get the next page of data for the list view. */
+ set_listItemCollectionPosition(value: SP.ListItemCollectionPosition): void;
+ /** Gets value that specifies the XML schema that defines the list view. */
+ get_viewXml(): string;
+ /** Sets value that specifies the XML schema that defines the list view. It must be null, empty, or an XML fragment that conforms to the ViewDefinition type. */
+ set_viewXml(value: string): void;
+ /** This member is reserved for internal use and is not intended to be used directly from your code. */
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ }
+ export class Change extends SP.ClientObject {
+ get_changeToken(): SP.ChangeToken;
+ get_changeType(): SP.ChangeType;
+ get_siteId(): SP.Guid;
+ get_time(): Date;
+ }
+ export class ChangeAlert extends SP.Change {
+ get_alertId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.Change;
+ get_item(index: number): SP.Change;
+ }
+ export class ChangeContentType extends SP.Change {
+ get_contentTypeId(): SP.ContentTypeId;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeField extends SP.Change {
+ get_fieldId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeFile extends SP.Change {
+ get_uniqueId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeFolder extends SP.Change {
+ get_uniqueId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeGroup extends SP.Change {
+ get_groupId(): number;
+ }
+ export class ChangeItem extends SP.Change {
+ get_itemId(): number;
+ get_listId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeList extends SP.Change {
+ get_listId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeLogItemQuery extends SP.ClientValueObject {
+ get_changeToken(): string;
+ set_changeToken(value: string): void;
+ get_contains(): string;
+ set_contains(value: string): void;
+ get_query(): string;
+ set_query(value: string): void;
+ get_queryOptions(): string;
+ set_queryOptions(value: string): void;
+ get_rowLimit(): string;
+ set_rowLimit(value: string): void;
+ get_viewFields(): string;
+ set_viewFields(value: string): void;
+ get_viewName(): string;
+ set_viewName(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class ChangeQuery extends SP.ClientValueObject {
+ constructor();
+ constructor(allChangeObjectTypes: bool, allChangeTypes: bool);
+ get_add(): bool;
+ set_add(value: bool): void;
+ get_alert(): bool;
+ set_alert(value: bool): void;
+ get_changeTokenEnd(): SP.ChangeToken;
+ set_changeTokenEnd(value: SP.ChangeToken): void;
+ get_changeTokenStart(): SP.ChangeToken;
+ set_changeTokenStart(value: SP.ChangeToken): void;
+ get_contentType(): bool;
+ set_contentType(value: bool): void;
+ get_deleteObject(): bool;
+ set_deleteObject(value: bool): void;
+ get_field(): bool;
+ set_field(value: bool): void;
+ get_file(): bool;
+ set_file(value: bool): void;
+ get_folder(): bool;
+ set_folder(value: bool): void;
+ get_group(): bool;
+ set_group(value: bool): void;
+ get_groupMembershipAdd(): bool;
+ set_groupMembershipAdd(value: bool): void;
+ get_groupMembershipDelete(): bool;
+ set_groupMembershipDelete(value: bool): void;
+ get_item(): bool;
+ set_item(value: bool): void;
+ get_list(): bool;
+ set_list(value: bool): void;
+ get_move(): bool;
+ set_move(value: bool): void;
+ get_navigation(): bool;
+ set_navigation(value: bool): void;
+ get_rename(): bool;
+ set_rename(value: bool): void;
+ get_restore(): bool;
+ set_restore(value: bool): void;
+ get_roleAssignmentAdd(): bool;
+ set_roleAssignmentAdd(value: bool): void;
+ get_roleAssignmentDelete(): bool;
+ set_roleAssignmentDelete(value: bool): void;
+ get_roleDefinitionAdd(): bool;
+ set_roleDefinitionAdd(value: bool): void;
+ get_roleDefinitionDelete(): bool;
+ set_roleDefinitionDelete(value: bool): void;
+ get_roleDefinitionUpdate(): bool;
+ set_roleDefinitionUpdate(value: bool): void;
+ get_securityPolicy(): bool;
+ set_securityPolicy(value: bool): void;
+ get_site(): bool;
+ set_site(value: bool): void;
+ get_systemUpdate(): bool;
+ set_systemUpdate(value: bool): void;
+ get_update(): bool;
+ set_update(value: bool): void;
+ get_user(): bool;
+ set_user(value: bool): void;
+ get_view(): bool;
+ set_view(value: bool): void;
+ get_web(): bool;
+ set_web(value: bool): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ }
+ export class ChangeSite extends SP.Change {
+ }
+ export class ChangeToken extends SP.ClientValueObject {
+ get_stringValue(): string;
+ set_stringValue(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum ChangeType {
+ noChange,
+ add,
+ update,
+ deleteObject,
+ rename,
+ moveAway,
+ moveInto,
+ restore,
+ roleAdd,
+ roleDelete,
+ roleUpdate,
+ assignmentAdd,
+ assignmentDelete,
+ memberAdd,
+ memberDelete,
+ systemUpdate,
+ navigation,
+ scopeAdd,
+ scopeDelete,
+ listContentTypeAdd,
+ listContentTypeDelete,
+ }
+ export class ChangeUser extends SP.Change {
+ get_activate(): bool;
+ get_userId(): number;
+ }
+ export class ChangeView extends SP.Change {
+ get_viewId(): SP.Guid;
+ get_listId(): SP.Guid;
+ get_webId(): SP.Guid;
+ }
+ export class ChangeWeb extends SP.Change {
+ get_webId(): SP.Guid;
+ }
+ export enum CheckinType {
+ minorCheckIn,
+ majorCheckIn,
+ overwriteCheckIn,
+ }
+ export enum CheckOutType {
+ online,
+ offline,
+ none,
+ }
+ export enum ChoiceFormatType {
+ dropdown,
+ radioButtons,
+ }
+ export class CompatibilityRange extends SP.ClientObject {
+ }
+ export class ContentType extends SP.ClientObject {
+ get_description(): string;
+ set_description(value: string): void;
+ get_displayFormTemplateName(): string;
+ set_displayFormTemplateName(value: string): void;
+ get_displayFormUrl(): string;
+ set_displayFormUrl(value: string): void;
+ get_documentTemplate(): string;
+ set_documentTemplate(value: string): void;
+ get_documentTemplateUrl(): string;
+ get_editFormTemplateName(): string;
+ set_editFormTemplateName(value: string): void;
+ get_editFormUrl(): string;
+ set_editFormUrl(value: string): void;
+ get_fieldLinks(): SP.FieldLinkCollection;
+ get_fields(): SP.FieldCollection;
+ get_group(): string;
+ set_group(value: string): void;
+ get_hidden(): bool;
+ set_hidden(value: bool): void;
+ get_id(): SP.ContentTypeId;
+ get_jSLink(): string;
+ set_jSLink(value: string): void;
+ get_name(): string;
+ set_name(value: string): void;
+ get_newFormTemplateName(): string;
+ set_newFormTemplateName(value: string): void;
+ get_newFormUrl(): string;
+ set_newFormUrl(value: string): void;
+ get_parent(): SP.ContentType;
+ get_readOnly(): bool;
+ set_readOnly(value: bool): void;
+ get_schemaXml(): string;
+ get_schemaXmlWithResourceTokens(): string;
+ set_schemaXmlWithResourceTokens(value: string): void;
+ get_scope(): string;
+ get_sealed(): bool;
+ set_sealed(value: bool): void;
+ get_stringId(): string;
+ get_workflowAssociations(): SP.Workflow.WorkflowAssociationCollection;
+ update(updateChildren: bool): void;
+ deleteObject(): void;
+ }
+ export class ContentTypeCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.ContentType;
+ get_item(index: number): SP.ContentType;
+ getById(contentTypeId: string): SP.ContentType;
+ addExistingContentType(contentType: SP.ContentType): SP.ContentType;
+ add(parameters: SP.ContentTypeCreationInformation): SP.ContentType;
+ }
+ export class ContentTypeCreationInformation extends SP.ClientValueObject {
+ get_description(): string;
+ set_description(value: string): void;
+ get_group(): string;
+ set_group(value: string): void;
+ get_name(): string;
+ set_name(value: string): void;
+ get_parentContentType(): SP.ContentType;
+ set_parentContentType(value: SP.ContentType): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class ContentTypeId extends SP.ClientValueObject {
+ toString(): string;
+ get_stringValue(): string;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum CustomizedPageStatus {
+ none,
+ uncustomized,
+ customized,
+ }
+ export enum DateTimeFieldFormatType {
+ dateOnly,
+ dateTime,
+ }
+ export enum DateTimeFieldFriendlyFormatType {
+ unspecified,
+ disabled,
+ relative,
+ }
+ export enum DraftVisibilityType {
+ reader,
+ author,
+ approver,
+ }
+ export class EventReceiverDefinition extends SP.ClientObject {
+ get_receiverAssembly(): string;
+ get_receiverClass(): string;
+ get_receiverId(): SP.Guid;
+ get_receiverName(): string;
+ get_sequenceNumber(): number;
+ get_synchronization(): SP.EventReceiverSynchronization;
+ get_eventType(): SP.EventReceiverType;
+ get_receiverUrl(): string;
+ update(): void;
+ deleteObject(): void;
+ }
+ export class EventReceiverDefinitionCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.EventReceiverDefinition;
+ get_item(index: number): SP.EventReceiverDefinition;
+ getById(eventReceiverId: SP.Guid): SP.EventReceiverDefinition;
+ add(eventReceiverCreationInformation: SP.EventReceiverDefinitionCreationInformation): SP.EventReceiverDefinition;
+ }
+ export class EventReceiverDefinitionCreationInformation extends SP.ClientValueObject {
+ get_receiverAssembly(): string;
+ set_receiverAssembly(value: string): void;
+ get_receiverClass(): string;
+ set_receiverClass(value: string): void;
+ get_receiverName(): string;
+ set_receiverName(value: string): void;
+ get_sequenceNumber(): number;
+ set_sequenceNumber(value: number): void;
+ get_synchronization(): SP.EventReceiverSynchronization;
+ set_synchronization(value: SP.EventReceiverSynchronization): void;
+ get_eventType(): SP.EventReceiverType;
+ set_eventType(value: SP.EventReceiverType): void;
+ get_receiverUrl(): string;
+ set_receiverUrl(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum EventReceiverSynchronization {
+ defaultSynchronization,
+ synchronous,
+ asynchronous,
+ }
+ export enum EventReceiverType {
+ invalidReceiver,
+ itemAdding,
+ itemUpdating,
+ itemDeleting,
+ itemCheckingIn,
+ itemCheckingOut,
+ itemUncheckingOut,
+ itemAttachmentAdding,
+ itemAttachmentDeleting,
+ itemFileMoving,
+ itemVersionDeleting,
+ fieldAdding,
+ fieldUpdating,
+ fieldDeleting,
+ listAdding,
+ listDeleting,
+ siteDeleting,
+ webDeleting,
+ webMoving,
+ webAdding,
+ groupAdding,
+ groupUpdating,
+ groupDeleting,
+ groupUserAdding,
+ groupUserDeleting,
+ roleDefinitionAdding,
+ roleDefinitionUpdating,
+ roleDefinitionDeleting,
+ roleAssignmentAdding,
+ roleAssignmentDeleting,
+ inheritanceBreaking,
+ inheritanceResetting,
+ workflowStarting,
+ itemAdded,
+ itemUpdated,
+ itemDeleted,
+ itemCheckedIn,
+ itemCheckedOut,
+ itemUncheckedOut,
+ itemAttachmentAdded,
+ itemAttachmentDeleted,
+ itemFileMoved,
+ itemFileConverted,
+ itemVersionDeleted,
+ fieldAdded,
+ fieldUpdated,
+ fieldDeleted,
+ listAdded,
+ listDeleted,
+ siteDeleted,
+ webDeleted,
+ webMoved,
+ webProvisioned,
+ groupAdded,
+ groupUpdated,
+ groupDeleted,
+ groupUserAdded,
+ groupUserDeleted,
+ roleDefinitionAdded,
+ roleDefinitionUpdated,
+ roleDefinitionDeleted,
+ roleAssignmentAdded,
+ roleAssignmentDeleted,
+ inheritanceBroken,
+ inheritanceReset,
+ workflowStarted,
+ workflowPostponed,
+ workflowCompleted,
+ entityInstanceAdded,
+ entityInstanceUpdated,
+ entityInstanceDeleted,
+ appInstalled,
+ appUpgraded,
+ appUninstalling,
+ emailReceived,
+ contextEvent,
+ }
+ export class Feature extends SP.ClientObject {
+ get_definitionId(): SP.Guid;
+ }
+ export class FeatureCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.Feature;
+ get_item(index: number): SP.Feature;
+ getById(featureId: SP.Guid): SP.Feature;
+ add(featureId: SP.Guid, force: bool, featdefScope: SP.FeatureDefinitionScope): SP.Feature;
+ remove(featureId: SP.Guid, force: bool): void;
+ }
+ export enum FeatureDefinitionScope {
+ none,
+ farm,
+ site,
+ web,
+ }
+ export class Field extends SP.ClientObject {
+ get_canBeDeleted(): bool;
+ get_defaultValue(): string;
+ set_defaultValue(value: string): void;
+ get_description(): string;
+ set_description(value: string): void;
+ get_direction(): string;
+ set_direction(value: string): void;
+ get_enforceUniqueValues(): bool;
+ set_enforceUniqueValues(value: bool): void;
+ get_entityPropertyName(): string;
+ get_filterable(): bool;
+ get_fromBaseType(): bool;
+ get_group(): string;
+ set_group(value: string): void;
+ get_hidden(): bool;
+ set_hidden(value: bool): void;
+ get_id(): SP.Guid;
+ get_indexed(): bool;
+ set_indexed(value: bool): void;
+ get_internalName(): string;
+ get_jSLink(): string;
+ set_jSLink(value: string): void;
+ get_readOnlyField(): bool;
+ set_readOnlyField(value: bool): void;
+ get_required(): bool;
+ set_required(value: bool): void;
+ get_schemaXml(): string;
+ set_schemaXml(value: string): void;
+ get_schemaXmlWithResourceTokens(): string;
+ get_scope(): string;
+ get_sealed(): bool;
+ get_sortable(): bool;
+ get_staticName(): string;
+ set_staticName(value: string): void;
+ get_title(): string;
+ set_title(value: string): void;
+ get_fieldTypeKind(): SP.FieldType;
+ set_fieldTypeKind(value: SP.FieldType): void;
+ get_typeAsString(): string;
+ set_typeAsString(value: string): void;
+ get_typeDisplayName(): string;
+ get_typeShortDescription(): string;
+ get_validationFormula(): string;
+ set_validationFormula(value: string): void;
+ get_validationMessage(): string;
+ set_validationMessage(value: string): void;
+ validateSetValue(item: SP.ListItem, value: string): void;
+ updateAndPushChanges(pushChangesToLists: bool): void;
+ update(): void;
+ deleteObject(): void;
+ setShowInDisplayForm(value: bool): void;
+ setShowInEditForm(value: bool): void;
+ setShowInNewForm(value: bool): void;
+ }
+ export class FieldCalculated extends SP.Field {
+ get_dateFormat(): SP.DateTimeFieldFormatType;
+ set_dateFormat(value: SP.DateTimeFieldFormatType): void;
+ get_formula(): string;
+ set_formula(value: string): void;
+ get_outputType(): SP.FieldType;
+ set_outputType(value: SP.FieldType): void;
+ }
+ export class FieldCalculatedErrorValue extends SP.ClientValueObject {
+ get_errorMessage(): string;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldMultiChoice extends SP.Field {
+ get_fillInChoice(): bool;
+ set_fillInChoice(value: bool): void;
+ get_mappings(): string;
+ get_choices(): string[];
+ set_choices(value: string[]): void;
+ }
+ export class FieldChoice extends SP.FieldMultiChoice {
+ get_editFormat(): SP.ChoiceFormatType;
+ set_editFormat(value: SP.ChoiceFormatType): void;
+ }
+ export class FieldCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.Field;
+ get_item(index: number): SP.Field;
+ get_schemaXml(): string;
+ getByTitle(title: string): SP.Field;
+ getById(id: SP.Guid): SP.Field;
+ add(field: SP.Field): SP.Field;
+ addDependentLookup(displayName: string, primaryLookupField: SP.Field, lookupField: string): SP.Field;
+ addFieldAsXml(schemaXml: string, addToDefaultView: bool, options: SP.AddFieldOptions): SP.Field;
+ getByInternalNameOrTitle(strName: string): SP.Field;
+ }
+ export class FieldComputed extends SP.Field {
+ get_enableLookup(): bool;
+ set_enableLookup(value: bool): void;
+ }
+ export class FieldNumber extends SP.Field {
+ get_maximumValue(): number;
+ set_maximumValue(value: number): void;
+ get_minimumValue(): number;
+ set_minimumValue(value: number): void;
+ }
+ export class FieldCurrency extends SP.FieldNumber {
+ get_currencyLocaleId(): number;
+ set_currencyLocaleId(value: number): void;
+ }
+ export class FieldDateTime extends SP.Field {
+ get_dateTimeCalendarType(): SP.CalendarType;
+ set_dateTimeCalendarType(value: SP.CalendarType): void;
+ get_displayFormat(): SP.DateTimeFieldFormatType;
+ set_displayFormat(value: SP.DateTimeFieldFormatType): void;
+ get_friendlyDisplayFormat(): SP.DateTimeFieldFriendlyFormatType;
+ set_friendlyDisplayFormat(value: SP.DateTimeFieldFriendlyFormatType): void;
+ }
+ export class FieldGeolocation extends SP.Field {
+ }
+ export class FieldGeolocationValue extends SP.ClientValueObject {
+ get_altitude(): number;
+ set_altitude(value: number): void;
+ get_latitude(): number;
+ set_latitude(value: number): void;
+ get_longitude(): number;
+ set_longitude(value: number): void;
+ get_measure(): number;
+ set_measure(value: number): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldGuid extends SP.Field {
+ }
+ export class FieldLink extends SP.ClientObject {
+ get_hidden(): bool;
+ set_hidden(value: bool): void;
+ get_id(): SP.Guid;
+ get_name(): string;
+ get_required(): bool;
+ set_required(value: bool): void;
+ deleteObject(): void;
+ }
+ export class FieldLinkCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.FieldLink;
+ get_item(index: number): SP.FieldLink;
+ getById(id: SP.Guid): SP.FieldLink;
+ add(parameters: SP.FieldLinkCreationInformation): SP.FieldLink;
+ reorder(internalNames: string[]): void;
+ }
+ export class FieldLinkCreationInformation extends SP.ClientValueObject {
+ get_field(): SP.Field;
+ set_field(value: SP.Field): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldLookup extends SP.Field {
+ get_allowMultipleValues(): bool;
+ set_allowMultipleValues(value: bool): void;
+ get_isRelationship(): bool;
+ set_isRelationship(value: bool): void;
+ get_lookupField(): string;
+ set_lookupField(value: string): void;
+ get_lookupList(): string;
+ set_lookupList(value: string): void;
+ get_lookupWebId(): SP.Guid;
+ set_lookupWebId(value: SP.Guid): void;
+ get_primaryFieldId(): string;
+ set_primaryFieldId(value: string): void;
+ get_relationshipDeleteBehavior(): SP.RelationshipDeleteBehaviorType;
+ set_relationshipDeleteBehavior(value: SP.RelationshipDeleteBehaviorType): void;
+ }
+ export class FieldLookupValue extends SP.ClientValueObject {
+ get_lookupId(): number;
+ set_lookupId(value: number): void;
+ get_lookupValue(): string;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldMultiLineText extends SP.Field {
+ get_allowHyperlink(): bool;
+ set_allowHyperlink(value: bool): void;
+ get_appendOnly(): bool;
+ set_appendOnly(value: bool): void;
+ get_numberOfLines(): number;
+ set_numberOfLines(value: number): void;
+ get_restrictedMode(): bool;
+ set_restrictedMode(value: bool): void;
+ get_richText(): bool;
+ set_richText(value: bool): void;
+ get_wikiLinking(): bool;
+ }
+ export class FieldRatingScale extends SP.FieldMultiChoice {
+ get_gridEndNumber(): number;
+ set_gridEndNumber(value: number): void;
+ get_gridNAOptionText(): string;
+ set_gridNAOptionText(value: string): void;
+ get_gridStartNumber(): number;
+ set_gridStartNumber(value: number): void;
+ get_gridTextRangeAverage(): string;
+ set_gridTextRangeAverage(value: string): void;
+ get_gridTextRangeHigh(): string;
+ set_gridTextRangeHigh(value: string): void;
+ get_gridTextRangeLow(): string;
+ set_gridTextRangeLow(value: string): void;
+ get_rangeCount(): number;
+ }
+ export class FieldRatingScaleQuestionAnswer extends SP.ClientValueObject {
+ get_answer(): number;
+ set_answer(value: number): void;
+ get_question(): string;
+ set_question(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldStringValues extends SP.ClientObject {
+ get_fieldValues(): any;
+ get_item(fieldName: string): string;
+ refreshLoad(): void;
+ }
+ export class FieldText extends SP.Field {
+ get_maxLength(): number;
+ set_maxLength(value: number): void;
+ }
+ export enum FieldType {
+ invalid,
+ integer,
+ text,
+ note,
+ dateTime,
+ counter,
+ choice,
+ lookup,
+ boolean,
+ number,
+ currency,
+ uRL,
+ computed,
+ threading,
+ guid,
+ multiChoice,
+ gridChoice,
+ calculated,
+ file,
+ attachments,
+ user,
+ recurrence,
+ crossProjectLink,
+ modStat,
+ error,
+ contentTypeId,
+ pageSeparator,
+ threadIndex,
+ workflowStatus,
+ allDayEvent,
+ workflowEventType,
+ geolocation,
+ outcomeChoice,
+ maxItems,
+ }
+ export class FieldUrl extends SP.Field {
+ get_displayFormat(): SP.UrlFieldFormatType;
+ set_displayFormat(value: SP.UrlFieldFormatType): void;
+ }
+ export class FieldUrlValue extends SP.ClientValueObject {
+ get_description(): string;
+ set_description(value: string): void;
+ get_url(): string;
+ set_url(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export class FieldUser extends SP.FieldLookup {
+ get_allowDisplay(): bool;
+ set_allowDisplay(value: bool): void;
+ get_presence(): bool;
+ set_presence(value: bool): void;
+ get_selectionGroup(): number;
+ set_selectionGroup(value: number): void;
+ get_selectionMode(): SP.FieldUserSelectionMode;
+ set_selectionMode(value: SP.FieldUserSelectionMode): void;
+ }
+ export enum FieldUserSelectionMode {
+ peopleOnly,
+ peopleAndGroups,
+ }
+ export class FieldUserValue extends SP.FieldLookupValue {
+ static fromUser(userName: string): SP.FieldUserValue;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ /** Represents a file in a SharePoint Web site that can be a Web Part Page, an item in a document library, or a file in a folder. */
+ export class File extends SP.ClientObject {
+ get_author(): SP.User;
+ /** Returns the user who has checked out the file. */
+ get_checkedOutByUser(): SP.User;
+ /** Returns the comment that was specified when the document was checked into the document library. */
+ get_checkInComment(): string;
+ /** The type of checkout that exists on the document. */
+ get_checkOutType(): SP.CheckOutType;
+ get_contentTag(): string;
+ /** Gets the customization(ghost) status of the SPFile. */
+ get_customizedPageStatus(): SP.CustomizedPageStatus;
+ /** Gets the ETag of the file */
+ get_eTag(): string;
+ /** Specifies whether the file exists */
+ get_exists(): bool;
+ get_length(): number;
+ get_level(): SP.FileLevel;
+ /** Specifies the SPListItem corresponding to this file if this file belongs to a doclib. Values for all fields are returned also. */
+ get_listItemAllFields(): SP.ListItem;
+ /** Returns the user that owns the current lock on the file. MUST return null if there is no lock. */
+ get_lockedByUser(): SP.User;
+ /** Specifies the major version of the file. */
+ get_majorVersion(): number;
+ /** Specifies the minor version of the file. */
+ get_minorVersion(): number;
+ get_modifiedBy(): SP.User;
+ get_name(): string;
+ get_serverRelativeUrl(): string;
+ /** Specifies when the file was created. */
+ get_timeCreated(): Date;
+ /** Specifies when the file was created. */
+ get_timeLastModified(): Date;
+ get_title(): string;
+ /** Specifies the implementation-specific version identifier of the file. */
+ get_uIVersion(): number;
+ /** Specifies the implementation-specific version identifier of the file. */
+ get_uIVersionLabel(): string;
+ /** Returns a collection of file version objects that represent the versions of the file. */
+ get_versions(): SP.FileVersionCollection;
+ /** Reverts an existing online or offline checkout for the file. */
+ undoCheckOut(): void;
+ checkIn(comment: string, checkInType: SP.CheckinType): void;
+ publish(comment: string): void;
+ /** Removes the file from content approval with the specified comment. */
+ unPublish(comment: string): void;
+ /** Approves the file submitted for content approval with the specified comment. */
+ approve(comment: string): void;
+ /** Denies the file submitted for content approval. */
+ deny(comment: string): void;
+ static getContentVerFromTag(context: SP.ClientRuntimeContext, contentTag: string): SP.IntResult;
+ getLimitedWebPartManager(scope: SP.WebParts.PersonalizationScope): SP.WebParts.LimitedWebPartManager;
+ moveTo(newUrl: string, flags: SP.MoveOperations): void;
+ copyTo(strNewUrl: string, bOverWrite: bool): void;
+ saveBinary(parameters: SP.FileSaveBinaryInformation): void;
+ deleteObject(): void;
+ /** Moves the file to the recycle bin. MUST return the identifier of the new Recycle Bin item */
+ recycle(): SP.GuidResult;
+ checkOut(): void;
+ }
+ export class FileCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.File;
+ get_item(index: number): SP.File;
+ getByUrl(url: string): SP.File;
+ add(parameters: SP.FileCreationInformation): SP.File;
+ addTemplateFile(urlOfFile: string, templateFileType: SP.TemplateFileType): SP.File;
+ }
+ export class FileCreationInformation extends SP.ClientValueObject {
+ get_content(): SP.Base64EncodedByteArray;
+ set_content(value: SP.Base64EncodedByteArray): void;
+ get_overwrite(): bool;
+ set_overwrite(value: bool): void;
+ get_url(): string;
+ set_url(value: string): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum FileLevel {
+ published,
+ draft,
+ checkout,
+ }
+ export class FileSaveBinaryInformation extends SP.ClientValueObject {
+ get_checkRequiredFields(): bool;
+ set_checkRequiredFields(value: bool): void;
+ get_content(): SP.Base64EncodedByteArray;
+ set_content(value: SP.Base64EncodedByteArray): void;
+ get_eTag(): string;
+ set_eTag(value: string): void;
+ get_fieldValues(): any;
+ set_fieldValues(value: any): void;
+ get_typeId(): string;
+ writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
+ constructor();
+ }
+ export enum FileSystemObjectType {
+ invalid,
+ file,
+ folder,
+ web,
+ }
+ export class FileVersion extends SP.ClientObject {
+ get_checkInComment(): string;
+ get_created(): Date;
+ get_createdBy(): SP.User;
+ get_iD(): number;
+ get_isCurrentVersion(): bool;
+ get_size(): number;
+ get_url(): string;
+ get_versionLabel(): string;
+ deleteObject(): void;
+ }
+ export class FileVersionCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.FileVersion;
+ get_item(index: number): SP.FileVersion;
+ getById(versionid: number): SP.FileVersion;
+ deleteByID(vid: number): void;
+ deleteByLabel(versionlabel: string): void;
+ deleteAll(): void;
+ restoreByLabel(versionlabel: string): void;
+ }
+ export class Folder extends SP.ClientObject {
+ get_contentTypeOrder(): SP.ContentTypeId[];
+ get_files(): SP.FileCollection;
+ get_listItemAllFields(): SP.ListItem;
+ get_itemCount(): number;
+ get_name(): string;
+ get_parentFolder(): SP.Folder;
+ get_properties(): SP.PropertyValues;
+ get_serverRelativeUrl(): string;
+ get_folders(): SP.FolderCollection;
+ get_uniqueContentTypeOrder(): SP.ContentTypeId[];
+ set_uniqueContentTypeOrder(value: SP.ContentTypeId[]): void;
+ get_welcomePage(): string;
+ set_welcomePage(value: string): void;
+ update(): void;
+ deleteObject(): void;
+ recycle(): SP.GuidResult;
+ }
+ export class FolderCollection extends SP.ClientObjectCollection {
+ itemAt(index: number): SP.Folder;
+ get_item(index: number): SP.Folder;
+ getByUrl(url: string): SP.Folder;
+ add(url: string): SP.Folder;
+ }
+ export class Form extends SP.ClientObject {
+ get_id(): SP.Guid;
+ get_serverRelativeUrl(): string;
+ get_formType(): SP.PageType;
+ }
+ export class FormCollection extends SP.ClientObjectCollection