mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
@@ -0,0 +1,14 @@
|
||||
/// <reference path="mobile-detect.d.ts" />
|
||||
|
||||
var md: MobileDetect = new MobileDetect(window.navigator.userAgent);
|
||||
|
||||
var mobie: string = md.mobile()
|
||||
var phone: string = md.phone()
|
||||
var tablet: string = md.tablet()
|
||||
var userAgent: string = md.userAgent()
|
||||
var os: string = md.os()
|
||||
var isPhone: boolean = md.is('iPhone')
|
||||
var bot: boolean = md.is('bot')
|
||||
var version: number = md.version('Webkit')
|
||||
var versionStr: string = md.versionStr('Build')
|
||||
var match: boolean = md.match('playstation|xbox')
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for mobile-detect v1.2.0
|
||||
// Project: http://hgoebl.github.io/mobile-detect.js/
|
||||
// Definitions by: Martin McWhorter <https://github.com/martinmcwhorter/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare class MobileDetect {
|
||||
|
||||
constructor(userAgent: string, maxPhoneWidth?: number);
|
||||
|
||||
is(key: string): boolean;
|
||||
match(pattern: string|RegExp): boolean
|
||||
mobile(): string;
|
||||
mobileGrade(): string;
|
||||
os(): string;
|
||||
phone(): string;
|
||||
tablet(): string;
|
||||
userAgent(): string;
|
||||
version(value: string): number;
|
||||
versionStr(value: string): string;
|
||||
}
|
||||
Reference in New Issue
Block a user