-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComponent.types.ts
77 lines (63 loc) · 1.97 KB
/
Component.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
export type Formats = "json" | "xml";
export interface IFormatParam {
format?: Formats;
}
export interface IMainDomainOnlyParam {
// Return values for the main domain only ('true'), or include also the subdomains ('false')
main_domain_only?: boolean;
}
export interface IShowVerifiedParam {
// Show shared Google Analytics data when available. Default value is 'false'
show_verified?: boolean;
}
export type DateGranularity = "Daily" | "Weekly" | "Monthly";
export interface IDateGranularityParam {
// Show shared Google Analytics data when available. Default value is 'false'
granularity: DateGranularity;
}
export type CountryOption = "world" | string;
export interface ICountryParam {
// Country filter, as a 2-letter ISO country code, or "world" for worldwide.
// To see the country filters you have access to, please refer to the Check Capabilities endpoint.
country: CountryOption;
}
export interface IDateRangeParams {
start_date: string; // 2017-11 format: YYYY-MM-DD or YYYY-MM
end_date: string; // 2018-01 format: YYYY-MM-DD or YYYY-MM
}
export interface ILimitParam {
limit: number;
}
export interface IMeta<Params> {
meta: {
request: IMetaRequest<Params>;
status: "Success" | "Error";
error_code?: number;
error_message?: string;
last_updated?: string; // "2019-02-28"
};
}
export type IMetaRequest<Params> = Params & {
domain?: string;
keyword?: string;
limit: null | any;
};
export interface IGlobalRanking {
global_ranking: number | null; // 154;
}
export interface ICategoryRanking {
category: string | null; // "News_and_Media";
category_ranking: number | null; // 21;
}
export interface IRankings extends IGlobalRanking, ICategoryRanking {}
export interface ICountry {
code: string; // "AR" | "world"
name: string; // "Argentina" | "world"
}
export interface IDateRange {
start_date: string; // "2016-01-01",
end_date: string; // "2019-01-31"
}
export interface IChange {
change: number | null | "NaN" | "Infinity";
}