Add use-ackee types (#46968)

This commit is contained in:
Spencer Elliott 2020-08-26 22:11:30 -04:00 committed by GitHub
parent 8c2f251186
commit f55496b5df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 0 deletions

15
types/use-ackee/index.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
// Type definitions for use-ackee 1.0
// Project: https://github.com/electerious/use-ackee
// Definitions by: Spencer Elliott <https://github.com/elliottsj>
// Pablo Sáez <https://github.com/PabloSzx>
// 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;

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -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',
});