From 741a12130dda2a2db8cf4ac5bf284f034383e3cb Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 28 Feb 2019 21:41:17 +0500 Subject: [PATCH] fix(unsplash-js): some types --- types/unsplash-js/index.d.ts | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/types/unsplash-js/index.d.ts b/types/unsplash-js/index.d.ts index de2272c422..4fb2fb9175 100644 --- a/types/unsplash-js/index.d.ts +++ b/types/unsplash-js/index.d.ts @@ -6,9 +6,9 @@ export default class Unsplash { public auth: Auth; public categories: CategoriesApi; - public collections: CollectionApi; + public collections: CollectionsApi; public currentUser: CurrentUserApi; - public users: UserApi; + public users: UsersApi; public photos: PhotoApi; public search: SearchApi; public stats: StatsApi; @@ -85,7 +85,7 @@ export class PhotoApi { }): Promise; } -export class CollectionApi { +export class CollectionsApi { public listCollections( page?: number, perPage?: number, @@ -96,10 +96,12 @@ export class CollectionApi { page?: number, perPage?: number ): Promise; + public listFeaturedCollections( page?: number, perPage?: number ): Promise; + public getCollection(id: number): Promise; public getCollectionPhotos( @@ -145,6 +147,8 @@ export class CollectionApi { } export class SearchApi { + public all(keyword: string, page: number, per_page: number): Promise; + public photos( keyword: string, page?: number, @@ -172,18 +176,18 @@ export class CurrentUserApi { public profile(): Promise; public updateProfile(options: { - username: string; - firstName: string; - lastName: string; - email: string; - url: string; - location: string; - bio: string; - instagramUsername: string; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + url?: string; + location?: string; + bio?: string; + instagramUsername?: string; }): Promise; } -export class UserApi { +export class UsersApi { public profile(username: string): Promise; public statistics( @@ -217,7 +221,9 @@ export class UserApi { export class CategoriesApi { public listCategories(): Promise; + public category(id: any): Promise; + public categoryPhotos( id: any, page?: number, @@ -227,6 +233,8 @@ export class CategoriesApi { export class Auth { public getAuthenticationUrl(scopes?: ReadonlyArray): string; - public userAuthentication(code: string): object; + + public userAuthentication(code: string): Promise; + public setBearerToken(accessToken: string): void; }