index.d.ts (624B)
1 export type Browser = { 2 /** 3 Human-readadable name of the browser. 4 */ 5 name: string; 6 7 /** 8 Unique ID for the browser on the current platform: 9 - On macOS, it's the ID in LaunchServices. 10 - On Linux, it's the desktop file ID (from `xdg-mime`). 11 - On Windows, it's an invented ID as Windows doesn't have IDs. 12 */ 13 id: string; 14 }; 15 16 /** 17 Get the default browser for the current platform. 18 19 @returns A promise for the browser. 20 21 ``` 22 import defaultBrowser from 'default-browser'; 23 24 console.log(await defaultBrowser()); 25 //=> {name: 'Safari', id: 'com.apple.Safari'} 26 ``` 27 */ 28 export default function defaultBrowser(): Promise<Browser>;