Helper Methods

createContentType

Creates a content type in a web or specified list.

createContentType(ctInfo: SP.ContentTypeCreationInformation, parentInfo: { Id: string, Url?: string }, webUrl?: string, listName?: string) => PromiseLike<SP.ContentType>

createDocSet

Creates a document set folder using the _vti_bin/listdata.svc endpoint.

createDocSet(name: string, listName: string, webUrl?: string) => PromiseLike<IListItemResult>

parse

Each object returned from this library contains a “stringify” method. This parse method will convert the string result back to the object.

parse<T>(jsonString: string) => PromiseLike<T>

request

A generic method for creating requests using the XMLHttpRequest object.

request(props:IRequest}) => PromiseLike<IListResult>

setContentTypeFields

Sets the field links associated with a content type.

setContentTypeFields(ctInfo: { id: string, fields: Array<string>, listName?: string, webUrl?: string }) => PromiseLike<void>

IRequest

  • data?:any - The data to pass in the request.
  • headers?:object - The request headers.
  • method?: string - The request method. (Default is ‘GET’)
  • url: string - The request url.