mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Add typings for duckduckgo-images-api (#36803)
* Add typings for duckduckgo-images-api * Fix linting issues * Code Review comments solved * Code Review comments solved
This commit is contained in:
parent
6723deba32
commit
dc8a044062
@ -0,0 +1,3 @@
|
||||
import * as duckDuckGoImagesApi from 'duckduckgo-images-api';
|
||||
duckDuckGoImagesApi.image_search({query: 'John Duck', moderate: true, retries: 1, iterations: 1 });
|
||||
duckDuckGoImagesApi.image_search_generator({query: 'John Duck', moderate: true, retries: 1, iterations: 1 });
|
||||
28
types/duckduckgo-images-api/index.d.ts
vendored
Normal file
28
types/duckduckgo-images-api/index.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
// Type definitions for duckduckgo-images-api 1.0
|
||||
// Project: https://github.com/KshitijMhatre/duckduckgo-images-api
|
||||
// Definitions by: Bart Duisters <https://github.com/bartduisters>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface DuckDuckGoImage {
|
||||
image: string;
|
||||
title: string;
|
||||
height: number;
|
||||
thumbnail: string;
|
||||
width: number;
|
||||
url: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
export function image_search(params: {
|
||||
query: string;
|
||||
moderate?: boolean;
|
||||
retries?: number;
|
||||
iterations?: number;
|
||||
}): Promise<DuckDuckGoImage[]>;
|
||||
|
||||
export function image_search_generator(params: {
|
||||
query: string;
|
||||
moderate?: boolean;
|
||||
retries?: number;
|
||||
iterations?: number;
|
||||
}): Promise<DuckDuckGoImage[]>;
|
||||
23
types/duckduckgo-images-api/tsconfig.json
Normal file
23
types/duckduckgo-images-api/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"duckduckgo-images-api-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/duckduckgo-images-api/tslint.json
Normal file
1
types/duckduckgo-images-api/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user