From f11d5e825723ed61ddcc2aa032987ac81b185894 Mon Sep 17 00:00:00 2001 From: Boris Cherny Date: Thu, 21 Apr 2016 13:38:18 -0700 Subject: [PATCH] add typescript typings --- package.json | 1 + typings.d.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 typings.d.ts diff --git a/package.json b/package.json index 4bd7aeb..1943d7a 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./bowser.js", + "typings": "./typings.d.ts", "repository": { "type": "git", "url": "git+https://github.com/ded/bowser.git" diff --git a/typings.d.ts b/typings.d.ts new file mode 100644 index 0000000..485c4b0 --- /dev/null +++ b/typings.d.ts @@ -0,0 +1,51 @@ +export const name: string +export const osversion: string +export const version: string + +// grades +export const a: boolean +export const b: boolean +export const c: boolean + +// engines +export const android: boolean +export const bada: boolean +export const blackberry: boolean +export const chrome: boolean +export const firefox: boolean +export const gecko: boolean +export const ios: boolean +export const msie: boolean +export const msedge: boolean +export const opera: boolean +export const phantom: boolean +export const safari: boolean +export const sailfish: boolean +export const seamonkey: boolean +export const silk: boolean +export const tizen: boolean +export const webkit: boolean +export const webos: boolean + +// operating systems +export const chromeos: boolean +export const iphone: boolean +export const ipad: boolean +export const ipod: boolean +export const firefoxos: boolean +export const linux: boolean +export const mac: boolean +export const touchpad: boolean +export const windows: boolean +export const windowsphone: boolean + +export function test(browserList: Flag[]): boolean + +export type Flag = "a" | "b" | "c" | "android" | "bada" | "blackberry" + | "chrome" | "firefox" | "gecko" | "ios" | "msie" + | "msedge" | "opera" | "phantom" | "safari" + | "sailfish" | "seamonkey" | "silk" | "tizen" + | "webkit" | "webos" | "chromeos" | "iphone" + | "ipad" | "ipod" | "firefoxos" | "linux" | "mac" + | "touchpad" | "windows" | "windowsphone" +