Add Query and QueryResponse definitions

This commit is contained in:
Gregory Moore
2016-07-14 13:09:04 -07:00
parent 0d501b1ff9
commit e1b93de867

View File

@@ -1,6 +1,6 @@
// Type definitions for Google Visualisation Apis
// Project: https://developers.google.com/chart/
// Definitions by: Dan Ludwig <https://github.com/danludwig>
// Definitions by: Dan Ludwig <https://github.com/danludwig>, Gregory Moore <https://github.com/gmoore-sjcorg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace google {
@@ -186,6 +186,42 @@ declare namespace google {
function arrayToDataTable(data: any[], firstRowIsData?: boolean): DataTable;
//#endregion
//#region Query
// https://developers.google.com/chart/interactive/docs/reference#query
export class Query {
constructor(dataSourceUrl: string, options?: QueryOptions);
abort(): void;
setRefreshInterval(intervalSeconds: number): void;
setTimeout(timeoutSeconds: number): void;
setQuery(queryString:string): void;
send(responseHandler): void;
}
export interface QueryOptions {
sendMethod?: string,
makeRequestParams?: Object
}
//#endregion
//#region QueryResponse
// https://developers.google.com/chart/interactive/docs/reference#queryresponse
export class QueryResponse {
constructor(responseObject: Object);
getDataTable(): DataTable;
getDetailedMessage(): string;
getMessage(): string;
getReasons(): string[];
hasWarning(): boolean;
isError(): boolean;
}
//#endregion
//#region DataView