mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-02 21:10:30 +00:00
Added typings
This commit is contained in:
Vendored
+36
-5
@@ -1,12 +1,43 @@
|
||||
// Type definitions for google-images 1.2
|
||||
// Project: https://github.com/beatgammit/base64-js
|
||||
// Type definitions for google-images 2.1
|
||||
// Project: https://github.com/vadimdemedes/google-images
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace GoogleImages {
|
||||
interface GoogleImages {
|
||||
export as namespace GoogleImages;
|
||||
export = GoogleImages;
|
||||
|
||||
declare namespace GoogleImages {
|
||||
type SearchImageSize = "icon" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "huge";
|
||||
type SearchImageType = "clipart" | "face" | "lineart" | "news" | "photo";
|
||||
type SearchDominantColor = "black" | "blue" | "brown" | "gray" | "green" | "pink" | "purple" | "teal" | "white" | "yellow";
|
||||
type SearchColorType = "color" | "gray" | "mono";
|
||||
type SearchSafe = "high" | "medium" | "off";
|
||||
|
||||
interface SearchOptions {
|
||||
page?: number;
|
||||
size?: SearchImageSize;
|
||||
type?: SearchImageType;
|
||||
dominantColor?: SearchDominantColor;
|
||||
colorType?: SearchColorType;
|
||||
safe?: SearchSafe;
|
||||
}
|
||||
|
||||
interface Image {
|
||||
url: string;
|
||||
type: string;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
thumbnail: {
|
||||
url: string,
|
||||
width: number,
|
||||
height: number
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export = GoogleImages;
|
||||
declare class GoogleImages {
|
||||
constructor(engineId: string, apiKey: string);
|
||||
|
||||
search(searchTerm: string, options?: GoogleImages.SearchOptions): Promise<GoogleImages.Image[]>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user