diff --git a/types/use-ackee/index.d.ts b/types/use-ackee/index.d.ts new file mode 100644 index 0000000000..a4d31d6275 --- /dev/null +++ b/types/use-ackee/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for use-ackee 1.0 +// Project: https://github.com/electerious/use-ackee +// Definitions by: Spencer Elliott +// Pablo Sáez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { ServerDetails, TrackingOptions } from 'ackee-tracker'; + +declare function useAckee(pathname: string | null, server: ServerDetails, opts?: TrackingOptions): void; + +declare namespace useAckee { + function useAckee(pathname: string | null, server: ServerDetails, opts?: TrackingOptions): void; +} + +export = useAckee; diff --git a/types/use-ackee/tsconfig.json b/types/use-ackee/tsconfig.json new file mode 100644 index 0000000000..1443fb00fc --- /dev/null +++ b/types/use-ackee/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "use-ackee-tests.ts" + ] +} diff --git a/types/use-ackee/tslint.json b/types/use-ackee/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/use-ackee/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/use-ackee/use-ackee-tests.ts b/types/use-ackee/use-ackee-tests.ts new file mode 100644 index 0000000000..343a9ea68a --- /dev/null +++ b/types/use-ackee/use-ackee-tests.ts @@ -0,0 +1,20 @@ +import { useAckee as useAckeeNamed } from 'use-ackee'; +// tslint:disable-next-line no-duplicate-imports +import * as useAckee from 'use-ackee'; + +useAckeeNamed( + '/current/path', + { + server: 'https://example.com', + domainId: 'hd11f820-68a1-11e6-8047-79c0c2d9bce0', + }, + { + ignoreLocalhost: true, + detailed: false, + }, +); + +useAckee('/', { + server: 'https://example.com', + domainId: 'hd11f820-68a1-11e6-8047-79c0c2d9bce0', +});