mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
@@ -68,9 +68,13 @@ List of Definitions
|
||||
* [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz))
|
||||
* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt))
|
||||
* [Grunt JS](http://gruntjs.com/) (by [Basarat Ali Syed](https://github.com/basarat))
|
||||
* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame))
|
||||
* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper))
|
||||
* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone))
|
||||
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog))
|
||||
@@ -178,7 +182,9 @@ List of Definitions
|
||||
* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/))
|
||||
* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42))
|
||||
* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/))
|
||||
* [Zepto.js] (http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy))
|
||||
* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/))
|
||||
* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith))
|
||||
|
||||
|
||||
+279
@@ -0,0 +1,279 @@
|
||||
// Type definitions for Google Page Speed Online Api
|
||||
// Project: https://developers.google.com/speed/pagespeed/
|
||||
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
///<reference path="../gapi/gapi.d.ts" />
|
||||
|
||||
declare module gapi.client.pagespeedonline {
|
||||
|
||||
export interface pagespeedapi {
|
||||
|
||||
/**
|
||||
* Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.
|
||||
*/
|
||||
runpagespeed(object: {
|
||||
/**
|
||||
* The URL of the page for which the PageSpeed Insights API should generate results.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* The locale that results should be generated in.
|
||||
*/
|
||||
locale?: string;
|
||||
/**
|
||||
* The PageSpeed rules to run. Can be specified multiple times
|
||||
*/
|
||||
rule?: string[];
|
||||
/**
|
||||
* Indicates if binary data containing a screenshot should be included
|
||||
*/
|
||||
screenshot?: boolean;
|
||||
/**
|
||||
* The strategy to use when analyzing the page. Valid values are desktop and mobile.
|
||||
*/
|
||||
stategy?: string;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
fields?: string;
|
||||
}): HttpRequest<GoogleApiPageSpeedOnlineResource>;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface GoogleApiPageSpeedOnlineResource {
|
||||
/**
|
||||
* Kind of result.
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
* Canonicalized and final URL for the document, after following page redirects (if any).
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Response code for the document. 200 indicates a normal page load. 4xx/5xx indicates an error.
|
||||
*/
|
||||
responseCode: number;
|
||||
/**
|
||||
* Title of the page, as displayed in the browser's title bar.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* The PageSpeed Score (0-100), which indicates how much faster a page could be. A high score indicates little room for improvement, while a lower score indicates more room for improvement.
|
||||
*/
|
||||
score: number;
|
||||
/**
|
||||
* Summary statistics for the page, such as number of JavaScript bytes, number of HTML bytes, etc.
|
||||
*/
|
||||
pageStats:
|
||||
{
|
||||
/**
|
||||
* Number of HTTP resources loaded by the page.
|
||||
*/
|
||||
numberResources: number;
|
||||
/**
|
||||
* Number of unique hosts referenced by the page.
|
||||
*/
|
||||
numberHosts: number;
|
||||
/**
|
||||
* Total size of all request bytes sent by the page.
|
||||
*/
|
||||
totalRequestBytes: string;
|
||||
/**
|
||||
* Number of static (that is, cacheable) resources on the page.
|
||||
*/
|
||||
numberStaticResources: number;
|
||||
/**
|
||||
* Number of uncompressed response bytes for the main HTML document and all iframes on the page.
|
||||
*/
|
||||
htmlResponseBytes: string;
|
||||
/**
|
||||
* Number of uncompressed response bytes for text resources on the page that aren't covered by other statistics; that is, non-HTML, non-script, non-CSS resources.
|
||||
*/
|
||||
textResponseBytes: string;
|
||||
/**
|
||||
* Number of uncompressed response bytes for CSS resources on the page.
|
||||
*/
|
||||
cssResponsebytes: string;
|
||||
/**
|
||||
* Number of response bytes for image resources on the page.
|
||||
*/
|
||||
imageResponseBytes: string;
|
||||
/**
|
||||
* Number of uncompressed response bytes for JS resources on the page.
|
||||
*/
|
||||
javascriptResponsebytes: string;
|
||||
/**
|
||||
* Number of response bytes for Flash resources on the page.
|
||||
*/
|
||||
flashResponseBytes: string;
|
||||
/**
|
||||
* Number of response bytes for other resources on the page.
|
||||
*/
|
||||
otherResponsebytes: string;
|
||||
/**
|
||||
* Number of JavaScript resources referenced by the page.
|
||||
*/
|
||||
numberJsResources: number;
|
||||
/**
|
||||
* Number of CSS resources referenced by the page.
|
||||
*/
|
||||
numberCssResources: number;
|
||||
}
|
||||
/**
|
||||
* Localized PageSpeed results. Contains a ruleResults entry for each PageSpeed rule instantiated and run by the server.
|
||||
*/
|
||||
formattedResults: {
|
||||
/**
|
||||
* The locale of the formattedResults, such as en_US.
|
||||
*/
|
||||
locale: string;
|
||||
/**
|
||||
* Dictionary of formatted rule results, with one entry for each PageSpeed rule instantiated and run by the server.
|
||||
*/
|
||||
ruleResults: {
|
||||
AvoidBadRequests: GoogleApiPageSpeedOnlineRuleResource;
|
||||
AvoidCharsetInMetaTag: GoogleApiPageSpeedOnlineRuleResource;
|
||||
AvoidCssImport: GoogleApiPageSpeedOnlineRuleResource;
|
||||
AvoidLandingPageRedirects: GoogleApiPageSpeedOnlineRuleResource;
|
||||
AvoidLongRunningScripts: GoogleApiPageSpeedOnlineRuleResource;
|
||||
DeferParsingJavaScript: GoogleApiPageSpeedOnlineRuleResource;
|
||||
EnableGzipCompression: GoogleApiPageSpeedOnlineRuleResource;
|
||||
InlineSmallCss: GoogleApiPageSpeedOnlineRuleResource;
|
||||
InlineSmallJavaScript: GoogleApiPageSpeedOnlineRuleResource;
|
||||
LeverageBrowserCaching: GoogleApiPageSpeedOnlineRuleResource;
|
||||
MinifyCss: GoogleApiPageSpeedOnlineRuleResource;
|
||||
MinifyHTML: GoogleApiPageSpeedOnlineRuleResource;
|
||||
MinifyJavaScript: GoogleApiPageSpeedOnlineRuleResource;
|
||||
MinimizeRedirects: GoogleApiPageSpeedOnlineRuleResource;
|
||||
MinimizeRequestSize: GoogleApiPageSpeedOnlineRuleResource;
|
||||
OptimizeImages: GoogleApiPageSpeedOnlineRuleResource;
|
||||
OptimizeTheOrderOfStylesAndScripts: GoogleApiPageSpeedOnlineRuleResource;
|
||||
PreferAsyncResources: GoogleApiPageSpeedOnlineRuleResource;
|
||||
PutCssInTheDocumentHead: GoogleApiPageSpeedOnlineRuleResource;
|
||||
RemoveQueryStringsFromStaticResources: GoogleApiPageSpeedOnlineRuleResource;
|
||||
ServerResourcesFromAConsistentUrl: GoogleApiPageSpeedOnlineRuleResource;
|
||||
ServerScaledImages: GoogleApiPageSpeedOnlineRuleResource;
|
||||
ServeResponseTime: GoogleApiPageSpeedOnlineRuleResource;
|
||||
SpecifyACacheValidator: GoogleApiPageSpeedOnlineRuleResource;
|
||||
SpecifyAVaryAcceptEncodingHeader: GoogleApiPageSpeedOnlineRuleResource;
|
||||
SpecifyCharsetEarly: GoogleApiPageSpeedOnlineRuleResource;
|
||||
SpecifyImageDimensions: GoogleApiPageSpeedOnlineRuleResource;
|
||||
SpriteImages: GoogleApiPageSpeedOnlineRuleResource;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The version of the PageSpeed SDK used to generate these results.
|
||||
*/
|
||||
version: {
|
||||
/**
|
||||
* The major version number of the PageSpeed SDK used to generate these results.
|
||||
*/
|
||||
major: number;
|
||||
/**
|
||||
* The minor version number of the PageSpeed SDK used to generate these results.
|
||||
*/
|
||||
minor: number;
|
||||
}
|
||||
/**
|
||||
* List of rules that were specified in the request, but which the server did not know how to instantiate.
|
||||
*/
|
||||
invalidRules: string[];
|
||||
}
|
||||
|
||||
interface GoogleApiPageSpeedOnlineRuleResource {
|
||||
/**
|
||||
* Localized name of the rule, intended for presentation to a user.
|
||||
*/
|
||||
localizedRuleName: string;
|
||||
/**
|
||||
* The score (0-100) for this rule. The rule score indicates how well a page implements the recommendations for the given rule.
|
||||
*/
|
||||
ruleScore: number;
|
||||
/**
|
||||
* The impact (unbounded floating point value) that implementing the suggestions for this rule would have on making the page faster.
|
||||
*/
|
||||
ruleImpact: number;
|
||||
/**
|
||||
* List of blocks of URLs. Each block may contain a heading and a list of URLs. Each URL may optionally include additional details.
|
||||
*/
|
||||
urlBlocks: {
|
||||
/**
|
||||
* Heading to be displayed with the list of URLs.
|
||||
*/
|
||||
header: {
|
||||
/**
|
||||
* A localized format string with $N placeholders, where N is the 1-indexed argument number.
|
||||
*/
|
||||
format: string;
|
||||
/**
|
||||
* List of arguments for the format string.
|
||||
*/
|
||||
args: {
|
||||
/**
|
||||
* Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Argument value, as a localized string.
|
||||
*/
|
||||
value: string;
|
||||
}[];
|
||||
}
|
||||
/**
|
||||
* List of entries that provide information about URLs in the URL block. Optional.
|
||||
*/
|
||||
urls: {
|
||||
/**
|
||||
* A format string that gives information about the URL, and a list of arguments for that format string.
|
||||
*/
|
||||
result: {
|
||||
/**
|
||||
* A localized format string with $N placeholders, where N is the 1-indexed argument number. For example: 'Minifying the resource at URL $1 can save $2 bytes'.
|
||||
*/
|
||||
format: string;
|
||||
/**
|
||||
* List of arguments for the format string.
|
||||
*/
|
||||
args: {
|
||||
/**
|
||||
* Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Argument value, as a localized string.
|
||||
*/
|
||||
value: string;
|
||||
}[];
|
||||
}
|
||||
/**
|
||||
* List of entries that provide additional details about a single URL. Optional.
|
||||
*/
|
||||
details: {
|
||||
/**
|
||||
* A localized format string with $N placeholders, where N is the 1-indexed argument number.
|
||||
*/
|
||||
format: string;
|
||||
/**
|
||||
* List of arguments for the format string.
|
||||
*/
|
||||
args: {
|
||||
/**
|
||||
* Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, or DURATION.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Argument value, as a localized string.
|
||||
*/
|
||||
value: string;
|
||||
}[];
|
||||
}[];
|
||||
}[];
|
||||
}[];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Vendored
+117
@@ -0,0 +1,117 @@
|
||||
// Type definitions for Google Translate API
|
||||
// Project: https://developers.google.com/translate/
|
||||
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../gapi/gapi.d.ts" />
|
||||
|
||||
declare module gapi.client.language {
|
||||
|
||||
export interface detections {
|
||||
|
||||
/**
|
||||
* Detect the language of text.
|
||||
*/
|
||||
list(object: {
|
||||
/**
|
||||
* The text to detect
|
||||
*/
|
||||
q: string[];
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
fields?: string;
|
||||
}): HttpRequest<GoogleApiTranslateDetectionListResponse>;
|
||||
}
|
||||
|
||||
export interface languages {
|
||||
|
||||
|
||||
/**
|
||||
* List the source/target languages supported by the API
|
||||
*/
|
||||
list(object: {
|
||||
/**
|
||||
* the language and collation in which the localized results should be returned
|
||||
*/
|
||||
target?: string;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
fields?: string;
|
||||
}): HttpRequest<GoogleApiTranslateLanguageListResponse>
|
||||
|
||||
}
|
||||
|
||||
export interface translations {
|
||||
|
||||
/**
|
||||
* Returns text translations from one language to another.
|
||||
*/
|
||||
list(object: {
|
||||
/**
|
||||
* The text to translate
|
||||
*/
|
||||
q: string[];
|
||||
/**
|
||||
* The target language into which the text should be translated
|
||||
*/
|
||||
target: string;
|
||||
/**
|
||||
* The customization id for translate
|
||||
*/
|
||||
cid?: string[];
|
||||
/**
|
||||
* This optional parameter allows you to indicate that the text to be translated is either plain-text or HTML. A value of html indicates HTML and a value of text indicates plain-text
|
||||
*/
|
||||
format?: string;
|
||||
/**
|
||||
* The source language of the text
|
||||
*/
|
||||
source?: string;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
fields?: string;
|
||||
/**
|
||||
* If prettyprint=true, the results returned by the server will be human readable (pretty printed).
|
||||
*/
|
||||
prettyprint?: string;
|
||||
}): HttpRequest<GoogleApiTranslateTranslationListResponse>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface GoogleApiTranslateTranslationListResponse {
|
||||
|
||||
data: {
|
||||
translations: {
|
||||
translatedText: string;
|
||||
detectedSourceLanguage: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface GoogleApiTranslateLanguageListResponse {
|
||||
|
||||
data: {
|
||||
languages: {
|
||||
language: string;
|
||||
name: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
interface GoogleApiTranslateDetectionListResponse {
|
||||
|
||||
data: {
|
||||
detections: {
|
||||
language: string;
|
||||
confidence: number;
|
||||
}[][];
|
||||
}
|
||||
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
// Type definitions for Google Url Shortener API
|
||||
// Project: https://developers.google.com/url-shortener/
|
||||
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../gapi/gapi.d.ts" />
|
||||
|
||||
declare module gapi.client.urlshortener {
|
||||
|
||||
export interface url {
|
||||
|
||||
/**
|
||||
* Expands a short URL or gets creation time and analytics.
|
||||
*/
|
||||
get(object: {
|
||||
/**
|
||||
* The short URL, including the protocol.
|
||||
*/
|
||||
'shortUrl': string;
|
||||
/**
|
||||
* Additional information to return. ANALYTICS_CLICKS, ANALYTICS_TOP_STRINGS, FULL
|
||||
*/
|
||||
'projection'?: string;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
'fields'?: string
|
||||
}): HttpRequest<GoogleApiUrlShortenerUrlResource>;
|
||||
/**
|
||||
* Creates a new short URL.
|
||||
*/
|
||||
insert(object: {
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
'fields'?: string;
|
||||
/**
|
||||
* HTTP Request Body
|
||||
*/
|
||||
'RequestBody'?: string
|
||||
}): HttpRequest<GoogleApiUrlShortenerUrlResource>;
|
||||
/**
|
||||
* Retrieves a list of URLs shortened by a user.
|
||||
*/
|
||||
list(object: {
|
||||
/**
|
||||
* Additional information to return. ANALYTICS_CLICKS, FULL
|
||||
*/
|
||||
'projection'?: string;
|
||||
/**
|
||||
* Token for requesting successive pages of results.
|
||||
*/
|
||||
'start-token'?: string;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
'fields'?: string
|
||||
}): HttpRequest<GoogleApiUrlShortenerUrlResource>;
|
||||
}
|
||||
}
|
||||
|
||||
interface GoogleApiUrlShortenerUrlResource {
|
||||
/**
|
||||
* The fixed string "urlshortener#url".
|
||||
*/
|
||||
kind: string;
|
||||
/**
|
||||
* Short URL
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Long URL
|
||||
*/
|
||||
longUrl: string;
|
||||
/**
|
||||
* Status of the target URL. Possible values: "OK", "MALWARE", "PHISHING", or "REMOVED".
|
||||
*/
|
||||
status: string;
|
||||
/**
|
||||
* Time the short URL was created; ISO 8601 representation using the yyyy-MM-dd'T'HH:mm:ss.SSSZZ format.
|
||||
*/
|
||||
created: string;
|
||||
/**
|
||||
* A summary of the click analytics for the short and long URL. Might not be present if not requested or currently unavailable.
|
||||
*/
|
||||
analytics: {
|
||||
/**
|
||||
* Click analytics over all time.
|
||||
*/
|
||||
allTime: GoogleApiUrlShortenerUrlResourceAnalyticsObject;
|
||||
/**
|
||||
* Click analytics over the last month.
|
||||
*/
|
||||
month: GoogleApiUrlShortenerUrlResourceAnalyticsObject;
|
||||
/**
|
||||
* Click analytics over the last week.
|
||||
*/
|
||||
week: GoogleApiUrlShortenerUrlResourceAnalyticsObject;
|
||||
/**
|
||||
* Click analytics over the last day.
|
||||
*/
|
||||
day: GoogleApiUrlShortenerUrlResourceAnalyticsObject;
|
||||
/**
|
||||
* Click analytics over the last two hours.
|
||||
*/
|
||||
twoHours: GoogleApiUrlShortenerUrlResourceAnalyticsObject;
|
||||
}
|
||||
}
|
||||
|
||||
interface GoogleApiUrlShortenerUrlResourceAnalyticsObject {
|
||||
/**
|
||||
* Number of clicks on this short URL.
|
||||
*/
|
||||
shortUrlClicks: string;
|
||||
/**
|
||||
* Number of clicks on all goo.gl short URLs pointing to this long URL.
|
||||
*/
|
||||
longUrlClicks: string;
|
||||
/**
|
||||
* Top referring hosts, e.g. "www.google.com"; sorted by (descending) click counts. Only present if this data is available.
|
||||
*/
|
||||
referrers: GoogleApiUrlShortenerUrlResourceAnalyticsArrayObject[];
|
||||
/**
|
||||
* Top countries (expressed as country codes), e.g. "US" or "DE"; sorted by (descending) click counts. Only present if this data is available.
|
||||
*/
|
||||
countries: GoogleApiUrlShortenerUrlResourceAnalyticsArrayObject[];
|
||||
/**
|
||||
* Top browsers, e.g. "Chrome"; sorted by (descending) click counts. Only present if this data is available.
|
||||
*/
|
||||
browsers: GoogleApiUrlShortenerUrlResourceAnalyticsArrayObject[];
|
||||
/**
|
||||
* Top platforms or OSes, e.g. "Windows"; sorted by (descending) click counts. Only present if this data is available.
|
||||
*/
|
||||
platforms: GoogleApiUrlShortenerUrlResourceAnalyticsArrayObject[];
|
||||
}
|
||||
|
||||
interface GoogleApiUrlShortenerUrlResourceAnalyticsArrayObject {
|
||||
/**
|
||||
* Number of clicks for this top entry, e.g. for this particular country or browser.
|
||||
*/
|
||||
count: string;
|
||||
/**
|
||||
* Label assigned to this top entry, e.g. "US" or "Chrome".
|
||||
*/
|
||||
id: string;
|
||||
}
|
||||
Vendored
+2337
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
||||
// Type definitions for YouTube Analytics API
|
||||
// Project: https://developers.google.com/youtube/analytics/
|
||||
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../gapi/gapi.d.ts" />
|
||||
|
||||
declare module gapi.client.youtubeAnalytics {
|
||||
|
||||
export interface reports {
|
||||
|
||||
/**
|
||||
* Retrieve your YouTube Analytics reports.
|
||||
*/
|
||||
query(object: {
|
||||
/**
|
||||
* Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.
|
||||
*/
|
||||
ids: string;
|
||||
/**
|
||||
* The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
|
||||
*/
|
||||
'start-date': string;
|
||||
/**
|
||||
* The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.
|
||||
*/
|
||||
'end-date': string;
|
||||
/**
|
||||
* A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes.
|
||||
*/
|
||||
metrics: string;
|
||||
/**
|
||||
* A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender.
|
||||
*/
|
||||
dimensions?: string;
|
||||
/**
|
||||
* A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters.
|
||||
*/
|
||||
filters?: string;
|
||||
/**
|
||||
* The maximum number of rows to include in the response.
|
||||
*/
|
||||
'max-results'?: number;
|
||||
/**
|
||||
* A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order.
|
||||
*/
|
||||
sort?: string;
|
||||
/**
|
||||
* An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).
|
||||
*/
|
||||
'start-index'?: number;
|
||||
/**
|
||||
* Selector specifying which fields to include in a partial response.
|
||||
*/
|
||||
fields?: string;
|
||||
}): HttpRequest<any>
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+207
@@ -0,0 +1,207 @@
|
||||
// Type definitions for Google API Client
|
||||
// Project: https://code.google.com/p/google-api-javascript-client/
|
||||
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
/**
|
||||
* The OAuth 2.0 token object represents the OAuth 2.0 token and any associated data.
|
||||
*/
|
||||
interface GoogleApiOAuth2TokenObject {
|
||||
/**
|
||||
* The OAuth 2.0 token. Only present in successful responses
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* Details about the error. Only present in error responses
|
||||
*/
|
||||
error: string;
|
||||
/**
|
||||
* The duration, in seconds, the token is valid for. Only present in successful responses
|
||||
*/
|
||||
expires_in: string;
|
||||
/**
|
||||
* The Google API scopes related to this token
|
||||
*/
|
||||
state: string;
|
||||
}
|
||||
|
||||
declare module gapi.auth {
|
||||
/**
|
||||
* Initiates the OAuth 2.0 authorization process. The browser displays a popup window prompting the user authenticate and authorize. After the user authorizes, the popup closes and the callback function fires.
|
||||
* @param params A key/value map of parameters for the request. If the key is not one of the expected OAuth 2.0 parameters, it is added to the URI as a query parameter.
|
||||
* @param callback The function to call once the login process is complete. The function takes an OAuth 2.0 token object as its only parameter.
|
||||
*/
|
||||
export function authorize(params: {
|
||||
/**
|
||||
* The application's client ID.
|
||||
*/
|
||||
client_id?: string;
|
||||
/**
|
||||
* If true, then login uses "immediate mode", which means that the token is refreshed behind the scenes, and no UI is shown to the user.
|
||||
*/
|
||||
immediate?: boolean;
|
||||
/**
|
||||
* The OAuth 2.0 response type property. Default: token
|
||||
*/
|
||||
response_type?: string;
|
||||
/**
|
||||
* The auth scope or scopes to authorize. Auth scopes for individual APIs can be found in their documentation.
|
||||
*/
|
||||
scope?: any[]
|
||||
}, callback: (token: GoogleApiOAuth2TokenObject) => any): void;
|
||||
/**
|
||||
* Initializes the authorization feature. Call this when the client loads to prevent popup blockers from blocking the auth window on gapi.auth.authorize calls.
|
||||
* @param callback A callback to execute when the auth feature is ready to make authorization calls.
|
||||
*/
|
||||
export function init(callback: () => any): void;
|
||||
/**
|
||||
* Retrieves the OAuth 2.0 token for the application.
|
||||
* @return The OAuth 2.0 token.
|
||||
*/
|
||||
export function getToken(): GoogleApiOAuth2TokenObject;
|
||||
/**
|
||||
* Sets the OAuth 2.0 token for the application.
|
||||
* @param token The token to set.
|
||||
*/
|
||||
export function setToken(token: GoogleApiOAuth2TokenObject): void;
|
||||
}
|
||||
|
||||
declare module gapi.client {
|
||||
/**
|
||||
* Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method.
|
||||
* @param name The name of the API to load.
|
||||
* @param version The version of the API to load
|
||||
* @param callback the function that is called once the API interface is loaded
|
||||
*/
|
||||
export function load(name: string, version: string, callback?: () => any): void;
|
||||
/**
|
||||
* Creates a HTTP request for making RESTful requests.
|
||||
* An object encapsulating the various arguments for this method.
|
||||
*/
|
||||
export function request(args: {
|
||||
/**
|
||||
* The URL to handle the request
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* The HTTP request method to use. Default is GET
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* URL params in key-value pair form
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* Additional HTTP request headers
|
||||
*/
|
||||
headers?: any;
|
||||
/**
|
||||
* The HTTP request body (applies to PUT or POST).
|
||||
*/
|
||||
body?: string;
|
||||
/**
|
||||
* If supplied, the request is executed immediately and no gapi.client.HttpRequest object is returned
|
||||
*/
|
||||
callback?: () => any;
|
||||
}): HttpRequest;
|
||||
/**
|
||||
* Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation.
|
||||
* @param method The method to be executed.
|
||||
* @param version The version of the API which defines the method to be executed. Defaults to v1
|
||||
* @param rpcParams A key-value pair of the params to supply to this RPC
|
||||
*/
|
||||
export function rpcRequest(method: string, version?: string, rpcParams?: any): RpcRequest;
|
||||
/**
|
||||
* Sets the API key for the application.
|
||||
* @param apiKey The API key to set
|
||||
*/
|
||||
export function setApiKey(apiKey: string): void;
|
||||
|
||||
/**
|
||||
* An object encapsulating an HTTP request. This object is not instantiated directly, rather it is returned by gapi.client.request.
|
||||
*/
|
||||
export class HttpRequest<T> {
|
||||
/**
|
||||
* Executes the request and runs the supplied callback on response.
|
||||
* @param callback The callback function which executes when the request succeeds or fails.
|
||||
*/
|
||||
execute(callback: (
|
||||
/**
|
||||
* contains the response parsed as JSON. If the response is not JSON, this field will be false.
|
||||
*/
|
||||
jsonResp: T,
|
||||
/**
|
||||
* is the HTTP response. It is JSON, and can be parsed to an object
|
||||
*/
|
||||
rawResp: {
|
||||
body: string;
|
||||
headers: any[];
|
||||
status: number;
|
||||
statusText: string;
|
||||
}
|
||||
) => any);
|
||||
}
|
||||
/**
|
||||
* Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute.
|
||||
*/
|
||||
export class HttpBatch {
|
||||
/**
|
||||
* Adds a gapi.client.HttpRequest to the batch.
|
||||
* @param httpRequest The HTTP request to add to this batch.
|
||||
* @param opt_params extra parameters for this batch entry.
|
||||
*/
|
||||
add(httpRequest: HttpRequest<any>, opt_params?: {
|
||||
/**
|
||||
* Identifies the response for this request in the map of batch responses. If one is not provided, the system generates a random ID.
|
||||
*/
|
||||
id: string;
|
||||
callback: (
|
||||
/**
|
||||
* is the response for this request only. Its format is defined by the API method being called.
|
||||
*/
|
||||
individualResponse: any,
|
||||
/**
|
||||
* is the raw batch ID-response map as a string. It contains all responses to all requests in the batch.
|
||||
*/
|
||||
rawBatchResponse: any
|
||||
) => any
|
||||
});
|
||||
/**
|
||||
* Executes all requests in the batch. The supplied callback is executed on success or failure.
|
||||
* @param callback The callback to execute when the batch returns.
|
||||
*/
|
||||
execute(callback: (
|
||||
/**
|
||||
* is an ID-response map of each requests response.
|
||||
*/
|
||||
responseMap: any,
|
||||
/**
|
||||
* is the same response, but as an unparsed JSON-string.
|
||||
*/
|
||||
rawBatchResponse: string
|
||||
) => any);
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to gapi.client.HttpRequest except this object encapsulates requests generated by registered methods.
|
||||
*/
|
||||
export class RpcRequest {
|
||||
|
||||
/**
|
||||
* Executes the request and runs the supplied callback with the response.
|
||||
* @param callback The callback function which executes when the request succeeds or fails.
|
||||
*/
|
||||
callback(callback: (
|
||||
/**
|
||||
* contains the response parsed as JSON. If the response is not JSON, this field will be false.
|
||||
*/
|
||||
jsonResp: any,
|
||||
/**
|
||||
* is the same as jsonResp, except it is a raw string that has not been parsed. It is typically used when the response is not JSON.
|
||||
*/
|
||||
rawResp: string
|
||||
) => void );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user