From d833d06ca03fbb4397e93afcd02fdeccd3169ef2 Mon Sep 17 00:00:00 2001 From: bglee Date: Sat, 8 Apr 2017 22:34:15 +0900 Subject: [PATCH] update v2.1.2 --- types/react-ga/index.d.ts | 122 ++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/types/react-ga/index.d.ts b/types/react-ga/index.d.ts index 3913840ad0..f0644c18d3 100644 --- a/types/react-ga/index.d.ts +++ b/types/react-ga/index.d.ts @@ -1,71 +1,65 @@ -// Type definitions for react-ga v2.1.2 +// Type definitions for react-ga 2.1.2 // Project: https://github.com/react-ga/react-ga // Definitions by: Tim Aldridge // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace __reactGA { - export interface EventArgs { - category: string; - action: string; - label?: string; - value?: number; - nonInteraction?: boolean; - } - - interface GaOptions { - name?: string; - clientId?: string; - sampleRate?: number; - siteSpeedSampleRate?: number; - alwaysSendReferrer?: boolean; - allowAnchor?: boolean; - cookieName?: string; - cookieDomain?: string; - cookieExpires?: number; - legacyCookieDomain?: string; - legacyHistoryImport?: boolean; - allowLinker?: boolean; - } - - export interface InitializeOptions { - debug?: boolean; - titleCase?: boolean; - gaOptions?: GaOptions; - } - - export interface FieldsObject { - [i: string]: any; - } - - interface TimingArgs { - category: string; - variable: string; - value: number; - label?: string; - } - - interface Plugin { - require(name: string, options: any): void; - execute(pluginName: string, action: string, actionTypeOrPayload: string|Object, payload?: Object): void; - } - - interface OutboundLinkArgs { - label: string; - } - - export function initialize(trackingCode: string, options?: InitializeOptions): void; - export function ga(): Function; - export function set(fieldsObject: FieldsObject): void; - export function send(fieldsObject: FieldsObject): void; - export function pageview(path: string): void; - export function modalview(name: string): void; - export function timing(args: TimingArgs): void; - export function event(args: EventArgs): void; - export function exception(fieldsObject: FieldsObject): void; - export const plugin: Plugin; - export function outboundLink(args: OutboundLinkArgs, hitCallback: Function): void; +export interface EventArgs { + category: string; + action: string; + label?: string; + value?: number; + nonInteraction?: boolean; } -declare module 'react-ga' { - export = __reactGA; +interface GaOptions { + name?: string; + clientId?: string; + sampleRate?: number; + siteSpeedSampleRate?: number; + alwaysSendReferrer?: boolean; + allowAnchor?: boolean; + cookieName?: string; + cookieDomain?: string; + cookieExpires?: number; + legacyCookieDomain?: string; + legacyHistoryImport?: boolean; + allowLinker?: boolean; } + +export interface InitializeOptions { + debug?: boolean; + titleCase?: boolean; + gaOptions?: GaOptions; +} + +export interface FieldsObject { + [i: string]: any; +} + +interface TimingArgs { + category: string; + variable: string; + value: number; + label?: string; +} + +interface Plugin { + require(name: string, options: any): void; + execute(pluginName: string, action: string, actionTypeOrPayload: string|Object, payload?: Object): void; +} + +interface OutboundLinkArgs { + label: string; +} + +export function initialize(trackingCode: string, options?: InitializeOptions): void; +export function ga(): Function; +export function set(fieldsObject: FieldsObject): void; +export function send(fieldsObject: FieldsObject): void; +export function pageview(path: string): void; +export function modalview(name: string): void; +export function timing(args: TimingArgs): void; +export function event(args: EventArgs): void; +export function exception(fieldsObject: FieldsObject): void; +export const plugin: Plugin; +export function outboundLink(args: OutboundLinkArgs, hitCallback: Function): void;