Installation
npm install --save @types/user-agents
Summary
This package contains type definitions for user-agents (https://github.com/intoli/user-agents#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/user-agents.
declare class UserAgent {
constructor(filters?: Filter | Filter[]);
toString(): string;
random(): UserAgent;
data: Data;
appName: string;
}
type Filter = Partial<Data> | RegExp | ((data: Data) => boolean) | string;
interface Data {
appName: string;
connection?: Connection | undefined;
cpuClass?: string | undefined;
deviceCategory?: string | undefined;
oscpu?: string | undefined;
platform: string;
pluginsLength: number;
screenHeight: number;
screenWidth: number;
vendor: string;
userAgent: string;
viewportHeight: number;
viewportWidth: number;
}
interface Connection {
downlink?: number | undefined;
downlinkMax?: any;
effectiveType?: string | undefined;
rtt?: number | undefined;
type?: string | undefined;
}
export = UserAgent;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by Nick Chursin, and Jan Peer Stöcklmair.