ngx-device-detector
Version:
<p align="center"> <img src="https://raw.githubusercontent.com/AhsanAyaz/ngx-device-detector/master/assets/logo.svg" width="200"> </p>
322 lines (317 loc) • 8.19 kB
TypeScript
import * as i0 from '@angular/core';
/**
* Created by ahsanayaz on 08/11/2016.
*/
declare const GENERAL: {
UKNOWN: string;
};
declare const BROWSERS: {
CHROME: string;
FIREFOX: string;
SAFARI: string;
OPERA: string;
IE: string;
MS_EDGE: string;
MS_EDGE_CHROMIUM: string;
FB_MESSANGER: string;
SAMSUNG: string;
UCBROWSER: string;
UNKNOWN: string;
};
declare const MOBILES_RE: {
HTC: RegExp;
NEXUS_PHONE: RegExp;
DELL: RegExp;
MOTOROLA: RegExp;
SAMSUNG: RegExp;
LG: RegExp;
SONY: RegExp;
ASUS: RegExp;
NOKIA_LUMIA: RegExp;
MICROMAX: RegExp;
PALM: RegExp;
VERTU: RegExp;
PANTECH: RegExp;
FLY: RegExp;
WIKO: RegExp;
I_MOBILE: RegExp;
SIMVALLEY: RegExp;
WOLFGANG: RegExp;
ALCATEL: RegExp;
NINTENDO: RegExp;
AMOI: RegExp;
INQ: RegExp;
VITA: RegExp;
BLACKBERRY: RegExp;
FIREFOX_OS: RegExp;
IPHONE: RegExp;
iPod: RegExp;
ANDROID: RegExp;
WINDOWS_PHONE: RegExp;
GENERIC_PHONE: RegExp;
};
declare const TABLETS_RE: {
iPad: RegExp;
NexusTablet: RegExp;
GoogleTablet: RegExp;
SamsungTablet: RegExp;
Kindle: RegExp;
SurfaceTablet: RegExp;
HPTablet: RegExp;
AsusTablet: RegExp;
BlackBerryTablet: RegExp;
HTCtablet: RegExp;
MotorolaTablet: RegExp;
NookTablet: RegExp;
AcerTablet: RegExp;
ToshibaTablet: RegExp;
LGTablet: RegExp;
FujitsuTablet: RegExp;
PrestigioTablet: RegExp;
LenovoTablet: RegExp;
DellTablet: RegExp;
YarvikTablet: RegExp;
MedionTablet: RegExp;
ArnovaTablet: RegExp;
IntensoTablet: RegExp;
IRUTablet: RegExp;
MegafonTablet: RegExp;
EbodaTablet: RegExp;
AllViewTablet: RegExp;
ArchosTablet: RegExp;
AinolTablet: RegExp;
NokiaLumiaTablet: RegExp;
SonyTablet: RegExp;
PhilipsTablet: RegExp;
CubeTablet: RegExp;
CobyTablet: RegExp;
MIDTablet: RegExp;
MSITablet: RegExp;
SMiTTablet: RegExp;
RockChipTablet: RegExp;
FlyTablet: RegExp;
bqTablet: RegExp;
HuaweiTablet: RegExp;
NecTablet: RegExp;
PantechTablet: RegExp;
BronchoTablet: RegExp;
VersusTablet: RegExp;
ZyncTablet: RegExp;
PositivoTablet: RegExp;
NabiTablet: RegExp;
KoboTablet: RegExp;
DanewTablet: RegExp;
TexetTablet: RegExp;
PlaystationTablet: RegExp;
TrekstorTablet: RegExp;
PyleAudioTablet: RegExp;
AdvanTablet: RegExp;
DanyTechTablet: string;
GalapadTablet: RegExp;
MicromaxTablet: RegExp;
KarbonnTablet: RegExp;
AllFineTablet: RegExp;
PROSCANTablet: RegExp;
YONESTablet: RegExp;
ChangJiaTablet: RegExp;
GUTablet: RegExp;
PointOfViewTablet: RegExp;
OvermaxTablet: RegExp;
HCLTablet: RegExp;
DPSTablet: RegExp;
VistureTablet: RegExp;
CrestaTablet: RegExp;
MediatekTablet: RegExp;
ConcordeTablet: RegExp;
GoCleverTablet: RegExp;
ModecomTablet: RegExp;
VoninoTablet: RegExp;
ECSTablet: RegExp;
StorexTablet: RegExp;
VodafoneTablet: RegExp;
EssentielBTablet: RegExp;
RossMoorTablet: RegExp;
iMobileTablet: RegExp;
TolinoTablet: RegExp;
AudioSonicTablet: RegExp;
AMPETablet: RegExp;
SkkTablet: RegExp;
TecnoTablet: RegExp;
JXDTablet: RegExp;
iJoyTablet: RegExp;
FX2Tablet: RegExp;
XoroTablet: RegExp;
ViewsonicTablet: RegExp;
VerizonTablet: RegExp;
OdysTablet: RegExp;
CaptivaTablet: RegExp;
IconbitTablet: RegExp;
TeclastTablet: RegExp;
OndaTablet: RegExp;
JaytechTablet: RegExp;
BlaupunktTablet: RegExp;
DigmaTablet: RegExp;
EvolioTablet: RegExp;
LavaTablet: RegExp;
AocTablet: RegExp;
MpmanTablet: RegExp;
CelkonTablet: RegExp;
WolderTablet: RegExp;
MediacomTablet: string;
MiTablet: RegExp;
NibiruTablet: RegExp;
NexoTablet: RegExp;
LeaderTablet: RegExp;
UbislateTablet: RegExp;
PocketBookTablet: RegExp;
KocasoTablet: RegExp;
HisenseTablet: RegExp;
Hudl: RegExp;
TelstraTablet: RegExp;
Honeywell: RegExp;
GenericTablet: RegExp;
};
declare const DEVICES: {
BLACKBERRY: string;
FIREFOX_OS: string;
CHROME_BOOK: string;
WINDOWS_PHONE: string;
VITA: string;
PS4: string;
MAC: string;
CHROMECAST: string;
APPLE_TV: string;
GOOGLE_TV: string;
ANDROID: string;
Tesla: string;
iPad: string;
IPHONE: string;
iPod: string;
UNKNOWN: string;
HTC: string;
NEXUS_PHONE: string;
NexusTablet: string;
DELL: string;
MOTOROLA: string;
SAMSUNG: string;
LG: string;
SONY: string;
ASUS: string;
NOKIA_LUMIA: string;
MICROMAX: string;
PALM: string;
VERTU: string;
PANTECH: string;
FLY: string;
WIKO: string;
I_MOBILE: string;
SIMVALLEY: string;
WOLFGANG: string;
ALCATEL: string;
HONEYWELL: string;
NINTENDO: string;
AMOI: string;
INQ: string;
GENERIC_PHONE: string;
MI_SE_9: string;
};
declare const DESKTOP_DEVICES: string[];
declare const OS: {
WINDOWS: string;
MAC: string;
IOS: string;
ANDROID: string;
LINUX: string;
UNIX: string;
FIREFOX_OS: string;
CHROME_OS: string;
WINDOWS_PHONE: string;
UNKNOWN: string;
};
declare const OS_VERSIONS: any;
declare const OS_RE: any;
declare const BROWSERS_RE: any;
declare const DEVICES_RE: any;
declare const OS_VERSIONS_RE_MAP: any;
declare const BROWSER_VERSIONS_RE_MAP: any;
declare const OS_VERSIONS_RE: any;
declare const BROWSER_VERSIONS_RE: any;
/**
* Created by ahsanayaz on 08/11/2016.
*/
declare class ReTree {
constructor();
test(str: string, regex: any): any;
exec(str: string, regex: any): any;
}
interface DeviceInfo {
userAgent: string;
os: string;
browser: string;
device: string;
os_version: string;
browser_version: string;
deviceType: string;
orientation: string;
}
declare enum DeviceType {
Mobile = "mobile",
Tablet = "tablet",
Desktop = "desktop",
Unknown = "unknown"
}
declare enum OrientationType {
Portrait = "portrait",
Landscape = "landscape"
}
declare class DeviceDetectorService {
private platformId;
ua: string;
userAgent: string;
os: string;
browser: string;
device: string;
os_version: string;
browser_version: string;
reTree: ReTree;
deviceType: string;
orientation: string;
constructor(platformId: any);
/**
* @author Ahsan Ayaz
* @desc Sets the initial value of the device when the service is initiated.
* This value is later accessible for usage
*/
setDeviceInfo(ua?: string): void;
/**
* @author Ahsan Ayaz
* @desc Returns the device information
* @returns the device information object.
*/
getDeviceInfo(): DeviceInfo;
/**
* @author Ahsan Ayaz
* @desc Compares the current device info with the mobile devices to check
* if the current device is a mobile and also check current device is tablet so it will return false.
* @returns whether the current device is a mobile
*/
isMobile(userAgent?: string): boolean;
/**
* @author Ahsan Ayaz
* @desc Compares the current device info with the tablet devices to check
* if the current device is a tablet.
* @returns whether the current device is a tablet
*/
isTablet(userAgent?: string): boolean;
/**
* @author Ahsan Ayaz
* @desc Compares the current device info with the desktop devices to check
* if the current device is a desktop device.
* @returns whether the current device is a desktop device
*/
isDesktop(userAgent?: string): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<DeviceDetectorService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DeviceDetectorService>;
}
export { BROWSERS, BROWSERS_RE, BROWSER_VERSIONS_RE, BROWSER_VERSIONS_RE_MAP, DESKTOP_DEVICES, DEVICES, DEVICES_RE, DeviceDetectorService, DeviceType, GENERAL, MOBILES_RE, OS, OS_RE, OS_VERSIONS, OS_VERSIONS_RE, OS_VERSIONS_RE_MAP, OrientationType, ReTree, TABLETS_RE };
export type { DeviceInfo };