mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
@@ -0,0 +1,12 @@
|
||||
import 'browser-report';
|
||||
|
||||
function test_sync() {
|
||||
var browserInfo = window.browserReportSync();
|
||||
console.log(browserInfo.browser.name);
|
||||
}
|
||||
|
||||
function test_async() {
|
||||
window.browserReport((error, result) => {
|
||||
console.log(result.ip + ' ' + result.browser.name);
|
||||
});
|
||||
}
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
// Type definitions for browser-report v2.2.9
|
||||
// Project: https://github.com/JTOne123/browser-report
|
||||
// Definitions by: Paul Datsiuk <https://github.com/JTOne123>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Window {
|
||||
browserReport(result: (error: ErrorEvent, report: ReportResult) => any): void;
|
||||
browserReportSync(): ReportResult;
|
||||
}
|
||||
|
||||
interface ReportResult {
|
||||
"browser": {
|
||||
"name": string,
|
||||
"version": string
|
||||
},
|
||||
"cookies": boolean,
|
||||
"flash": {
|
||||
"version": string
|
||||
},
|
||||
"ip": string,
|
||||
"country": {
|
||||
"name": string,
|
||||
"code": string,
|
||||
"city": string,
|
||||
"latitude" : string,
|
||||
"longitude": string,
|
||||
"timezone": string
|
||||
},
|
||||
"java": {
|
||||
"version": string
|
||||
},
|
||||
"lang": Array<string>,
|
||||
"os": {
|
||||
"name": string,
|
||||
"version": string
|
||||
},
|
||||
"screen": {
|
||||
"colors": number,
|
||||
"dppx": number,
|
||||
"height": number,
|
||||
"width": number
|
||||
},
|
||||
"scripts": boolean,
|
||||
"timestamp": string,
|
||||
"userAgent": string,
|
||||
"viewport": {
|
||||
"height": number,
|
||||
"layout": {
|
||||
"height": number,
|
||||
"width": number
|
||||
}
|
||||
"width": number,
|
||||
"zoom": number
|
||||
}
|
||||
"websockets": boolean
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"browser-report-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user