diff --git a/dist/sprestlib.d.ts b/dist/sprestlib.d.ts index b0b54f8..986e309 100644 --- a/dist/sprestlib.d.ts +++ b/dist/sprestlib.d.ts @@ -18,22 +18,20 @@ declare namespace sprLib { interface FileInfoOptions { version?: number; } - class file { - constructor(fileName: string); - + interface IFile { get(): Promise; info(options: FileInfoOptions): Promise; perms(): Promise; } + function file(fileName: string): IFile; - class folder { - constructor(folderName: string); - - files(): Promise; - folders(): Promise; + interface IFolder { + files(): Promise; + folders(): Promise; info(): Promise; - perms(): Promise; + perms(): Promise; } + function folder(folderName: string): IFolder; /** * SharePoint List/Library API. @@ -42,7 +40,8 @@ declare namespace sprLib { * @since 1.0 */ interface ListOptions { - name: string; + name?: string; + guid?: string; baseUrl?: string; requestDigest?: string; } @@ -54,11 +53,7 @@ declare namespace sprLib { queryNext?: Object; queryOrderBy?: string; } - class list { - constructor(listName: string); - constructor(listGuid: string); - constructor(options: ListOptions); - + interface IList { cols(): Promise; info(): Promise; perms(): Promise; @@ -69,6 +64,9 @@ declare namespace sprLib { delete(options: Object): Promise; recycle(options: Object): Promise; } + function list(listName: string): IList; + function list(listGuid: string): IList; + function list(options: ListOptions): IList; interface RestOptions { url: string; @@ -79,9 +77,7 @@ declare namespace sprLib { } function rest(options: RestOptions): Promise; - class site { - constructor(siteUrl?: string); - + interface ISite { info(): Promise; lists(): Promise; subsites(): Promise; @@ -90,19 +86,20 @@ declare namespace sprLib { groups(): Promise; users(): Promise; } - + function site(siteUrl?: string): ISite; + interface UserOptions { + baseUrl?: string; id?: string; email?: string; login?: string; title?: string; } - class user { - constructor(options?: UserOptions); - + interface IUser { info(): Promise; groups(): Promise; - profile(arrProfileKeys: Object): Object; + profile(arrProfileKeys?: Object): Promise; } + function user(options?: UserOptions): IUser; }