This repository was archived by the owner on Jan 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Modified declaration file #37
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,22 +18,20 @@ declare namespace sprLib { | |
interface FileInfoOptions { | ||
version?: number; | ||
} | ||
class file { | ||
constructor(fileName: string); | ||
|
||
interface IFile { | ||
get(): Promise<Blob>; | ||
info(options: FileInfoOptions): Promise<Object>; | ||
perms(): Promise<Object[]>; | ||
} | ||
function file(fileName: string): IFile; | ||
|
||
class folder { | ||
constructor(folderName: string); | ||
|
||
files(): Promise<Object[]>; | ||
folders(): Promise<Object[]>; | ||
interface IFolder { | ||
files(): Promise<Object[]>; | ||
folders(): Promise<Object[]>; | ||
info(): Promise<Object>; | ||
perms(): Promise<Object[]>; | ||
perms(): Promise<Object[]>; | ||
} | ||
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<Object[]>; | ||
info(): Promise<Object>; | ||
perms(): Promise<Object[]>; | ||
|
@@ -69,6 +64,9 @@ declare namespace sprLib { | |
delete(options: Object): Promise<number>; | ||
recycle(options: Object): Promise<number>; | ||
} | ||
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<Object[]>; | ||
|
||
class site { | ||
constructor(siteUrl?: string); | ||
|
||
interface ISite { | ||
info(): Promise<Object>; | ||
lists(): Promise<Object[]>; | ||
subsites(): Promise<Object[]>; | ||
|
@@ -90,19 +86,20 @@ declare namespace sprLib { | |
groups(): Promise<Object[]>; | ||
users(): Promise<Object[]>; | ||
} | ||
|
||
function site(siteUrl?: string): ISite; | ||
|
||
interface UserOptions { | ||
baseUrl?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'baseUrl' was in the documentation, but not in the declaration file. |
||
id?: string; | ||
email?: string; | ||
login?: string; | ||
title?: string; | ||
} | ||
|
||
class user { | ||
constructor(options?: UserOptions); | ||
|
||
interface IUser { | ||
info(): Promise<Object>; | ||
groups(): Promise<Object[]>; | ||
profile(arrProfileKeys: Object): Object; | ||
profile(arrProfileKeys?: Object): Promise<Object>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Returned a promise for the profile func. |
||
} | ||
function user(options?: UserOptions): IUser; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed these classes. Added IFile interface and file function to replace the 'file' class. This was repeated in the other classes.