1 Star 0 Fork 0

cjie/mobile-detect.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mobile-detect.d.ts 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
declare class MobileDetect {
static version: string;
static isPhoneSized(maxPhoneWidth?: number): boolean;
// only used internally; if necessary, one can replace, intercept or augment particular methods or values
static _impl: MobileDetect.MobileDetectImpl;
constructor(userAgent: string, maxPhoneWidth?: number);
mobile(): string|null;
phone(): string|null;
tablet(): string|null;
userAgent(): string;
userAgents(): string[];
os(): string;
version(value: string): number;
versionStr(value: string): string;
is(key: string): boolean;
match(pattern: string|RegExp): boolean;
isPhoneSized(maxPhoneWidth?: number): boolean;
mobileGrade(): string;
}
declare namespace MobileDetect {
interface MobileDetectRules {
[key: string]: string|RegExp;
}
interface MobileDetectComplexRules {
[key: string]: string|RegExp|string[]|RegExp[];
}
interface MobileDetectImpl {
mobileDetectRules: {
phones: MobileDetectRules;
tablets: MobileDetectRules;
oss: MobileDetectRules;
uas: MobileDetectRules;
props: MobileDetectComplexRules;
utils: MobileDetectRules;
};
detectMobileBrowsers: {
fullPattern: RegExp;
shortPattern: RegExp;
tabletPattern: RegExp;
};
FALLBACK_PHONE: string;
FALLBACK_TABLET: string;
FALLBACK_MOBILE: string;
findMatch(rules: MobileDetectRules, userAgent: string): string;
findMatches(rules: MobileDetectRules, userAgent: string): string[];
getVersionStr(propertyName: string, userAgent: string): string;
getVersion(propertyName: string, userAgent: string): number;
prepareVersionNo(version: string): number;
isMobileFallback(userAgent: string): boolean;
isTabletFallback(userAgent: string): boolean;
prepareDetectionCache(cache: Object, userAgent: string, maxPhoneWidth?: number): void;
mobileGrade(md: MobileDetect): string;
detectOS(userAgent: string): string;
getDeviceSmallerSide(): number;
}
}
export = MobileDetect;
export as namespace MobileDetect;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cjie001/mobile-detect.js.git
git@gitee.com:cjie001/mobile-detect.js.git
cjie001
mobile-detect.js
mobile-detect.js
master

搜索帮助