diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..ab488f5 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,24 @@ +interface Detected { + browser: { + stock: boolean; + hidden: boolean; + channel: string; + name: string; + version: any; + } + engine: { + name: string; + version: any; + } + os: { + name: string; + version: any; + } + device:{ + type: 'tablet' | 'mobile' | 'desktop'; + identified: boolean; + manufacturer?: string; + model: string; + } +} +export default function uaDevice(uaString: string): Detected; diff --git a/package.json b/package.json index b536d85..c292af9 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.10", "description": "ua-device是由Baidu WebFE(FEX)团队开发的一个用于解析UA来得到用户终端信息的JS框架", "main": "index.js", + "types": "index.d.ts", "directories": { "test": "test" },