DefinitelyTyped/types/google-translate-api/index.d.ts
maple 9dc89875c4 Create Type Definitions for google-translate-api (#28589)
* Create Type Definitions for google-translate-api

* Add semicolons to google-translate-api
2018-09-10 16:04:04 -07:00

28 lines
649 B
TypeScript

// Type definitions for google-translate-api 2.3
// Project: https://github.com/matheuss/google-translate-api#readme
// Definitions by: maple3142 <https://github.com/maple3142>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface TranslateOption {
from?: string;
to?: string;
raw?: boolean;
}
interface TranslateResult {
text: string;
from: {
language: {
didYouMean: boolean;
iso: string;
}
text: {
autoCorrected: boolean;
value: string;
didYouMean: boolean;
}
};
raw: string;
}
declare function translate(text: string, options?: TranslateOption): Promise<TranslateResult>;
export = translate;