Helper Methods

less than 1 minute read


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>


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

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


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>


A generic method for creating requests using the XMLHttpRequest object.

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


Sets the field links associated with a content type.

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


  • 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.