@types/useragent
Advanced tools
Comparing version 2.1.1 to 2.3.0
@@ -1,9 +0,18 @@ | ||
// Type definitions for useragent v2.1 | ||
// Type definitions for useragent 2.3 | ||
// Project: https://github.com/3rd-Eden/useragent | ||
// Definitions by: Joshua DeVinney <https://github.com/geoffreak> | ||
// Piotr Błażejewicz <https://github.com/peterblazejewicz> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
declare namespace Useragent { | ||
/** | ||
* Small nifty thick that allows us to download a fresh set regexs from t3h | ||
* Int3rNetz when we want to. We will be using the compiled version by default | ||
* but users can opt-in for updates. | ||
* | ||
* @param [refresh] Refresh the dataset from the remote | ||
*/ | ||
declare function useragent(refresh?: boolean): void; | ||
export class Agent { | ||
declare namespace useragent { | ||
class Agent { | ||
family: string; | ||
@@ -19,7 +28,7 @@ major: string; | ||
* The representation of a parsed user agent. | ||
* @param family The name of the browser | ||
* @param major Major version of the browser | ||
* @param minor Minor version of the browser | ||
* @param patch Patch version of the browser | ||
* @param source The actual user agent string | ||
* @param [family=`Other`] The name of the browser | ||
* @param [major='0'] Major version of the browser | ||
* @param [minor='0'] Minor version of the browser | ||
* @param [patch='0'] Patch version of the browser | ||
* @param [source] The actual user agent string | ||
*/ | ||
@@ -56,3 +65,3 @@ constructor(family?: string, major?: string, minor?: string, patch?: string, source?: string); | ||
export class OperatingSystem { | ||
class OperatingSystem { | ||
family: string; | ||
@@ -65,6 +74,6 @@ major: string; | ||
* The representation of a parsed Operating System. | ||
* @param family The name of the os | ||
* @param major Major version of the os | ||
* @param minor Minor version of the os | ||
* @param patch Patch version of the os | ||
* @param [family='Other'] The name of the os | ||
* @param [major='0'] Major version of the os | ||
* @param [minor='0'] Minor version of the os | ||
* @param [patch='0'] Patch version of the os | ||
*/ | ||
@@ -94,3 +103,3 @@ constructor(family?: string, major?: string, minor?: string, patch?: string); | ||
export class Device { | ||
class Device { | ||
family: string; | ||
@@ -103,6 +112,6 @@ major: string; | ||
* The representation of a parsed Device. | ||
* @param family The name of the device | ||
* @param major Major version of the device | ||
* @param minor Minor version of the device | ||
* @param patch Patch version of the device | ||
* @param [family='Other'] The name of the device | ||
* @param [major='0'] Major version of the device | ||
* @param [minor='0'] Minor version of the device | ||
* @param [patch='0'] Patch version of the device | ||
*/ | ||
@@ -137,4 +146,4 @@ constructor(family?: string, major?: string, minor?: string, patch?: string); | ||
*/ | ||
export function parse(userAgent?: string, jsAgent?: string): Agent; | ||
function parse(userAgent?: string, jsAgent?: string): Agent; | ||
/** | ||
@@ -145,3 +154,3 @@ * If you are doing a lot of lookups you might want to cache the results of the parsed user agent string instead, in memory. | ||
*/ | ||
export function lookup(userAgent?: string, jsAgent?: string): Agent; | ||
function lookup(userAgent?: string, jsAgent?: string): Agent; | ||
@@ -152,4 +161,4 @@ /** | ||
*/ | ||
export function is(useragent?: string): Details; | ||
export interface Details { | ||
function is(useragent?: string): Details; | ||
interface Details { | ||
chrome: boolean; | ||
@@ -171,10 +180,14 @@ firefox: boolean; | ||
*/ | ||
export function fromJSON(obj: string | { | ||
family: string; | ||
major: string; | ||
minor: string; | ||
patch: string; | ||
device?: string; | ||
os?: string; | ||
}): Agent; | ||
function fromJSON( | ||
obj: | ||
| string | ||
| { | ||
family: string; | ||
major: string; | ||
minor: string; | ||
patch: string; | ||
device?: string; | ||
os?: string; | ||
}, | ||
): Agent; | ||
@@ -184,5 +197,5 @@ /** | ||
*/ | ||
export const version: number; | ||
const version: number; | ||
} | ||
export = Useragent; | ||
export = useragent; |
{ | ||
"name": "@types/useragent", | ||
"version": "2.1.1", | ||
"description": "TypeScript definitions for useragent v2.1", | ||
"version": "2.3.0", | ||
"description": "TypeScript definitions for useragent", | ||
"license": "MIT", | ||
"author": "Joshua DeVinney <https://github.com/geoffreak>", | ||
"contributors": [ | ||
{ | ||
"name": "Joshua DeVinney", | ||
"url": "https://github.com/geoffreak", | ||
"githubUsername": "geoffreak" | ||
}, | ||
{ | ||
"name": "Piotr Błażejewicz", | ||
"url": "https://github.com/peterblazejewicz", | ||
"githubUsername": "peterblazejewicz" | ||
} | ||
], | ||
"main": "", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/useragent" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"peerDependencies": {}, | ||
"typings": "index.d.ts", | ||
"typesPublisherContentHash": "6eaabb69e18bb450db2367271849f61d90927f3f31fd3db702a82a1a2fd3f153" | ||
"typesPublisherContentHash": "617bbae994a57fca94fb87c4287c3c208d785cf2aa498f4926029cdbea30162b", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -5,15 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for useragent v2.1 (https://github.com/3rd-Eden/useragent). | ||
This package contains type definitions for useragent (https://github.com/3rd-Eden/useragent). | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/useragent | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/useragent. | ||
Additional Details | ||
* Last updated: Wed, 26 Oct 2016 19:23:31 GMT | ||
* File structure: ProperModule | ||
* Library Dependencies: none | ||
* Module Dependencies: none | ||
* Global values: Useragent | ||
### Additional Details | ||
* Last updated: Mon, 09 Nov 2020 23:49:39 GMT | ||
* Dependencies: none | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Joshua DeVinney <https://github.com/geoffreak>. | ||
These definitions were written by [Joshua DeVinney](https://github.com/geoffreak), and [Piotr Błażejewicz](https://github.com/peterblazejewicz). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8283
168
17