mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Fixing react-ga .ga() signature (#20438)
* Fixing react-ga ga signature * Adding additional overload
This commit is contained in:
committed by
Sheetal Nandi
parent
160b4e5701
commit
e0c06b3b71
Vendored
+3
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for react-ga 2.1
|
||||
// Project: https://github.com/react-ga/react-ga
|
||||
// Definitions by: Tim Aldridge <https://github.com/telshin>
|
||||
// Definitions by: Tim Aldridge <https://github.com/telshin>, Vasya Aksyonov <https://github.com/outring>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface EventArgs {
|
||||
@@ -54,7 +54,8 @@ export interface OutboundLinkArgs {
|
||||
}
|
||||
|
||||
export function initialize(trackingCode: string, options?: InitializeOptions): void;
|
||||
export function ga(): any;
|
||||
export function ga(): (...args: any[]) => any;
|
||||
export function ga(...args: any[]): any;
|
||||
export function set(fieldsObject: FieldsObject): void;
|
||||
export function send(fieldsObject: FieldsObject): void;
|
||||
export function pageview(path: string): void;
|
||||
|
||||
@@ -63,6 +63,12 @@ describe("Testing react-ga v2.1.2", () => {
|
||||
it("Able to make ga calls", () => {
|
||||
ga.ga();
|
||||
});
|
||||
it("Able to make ga calls with any arguments", () => {
|
||||
ga.ga("create", "UA-65432-1", "auto", "trackerName");
|
||||
});
|
||||
it("Able to make returned ga calls with any arguments", () => {
|
||||
ga.ga()("create", "UA-65432-1", "auto", "trackerName");
|
||||
});
|
||||
it("Able to make send calls", () => {
|
||||
const fieldObject: ga.FieldsObject = {
|
||||
page: '/users'
|
||||
|
||||
Reference in New Issue
Block a user