index.d.ts 687 B

1234567891011121314151617181920212223242526272829
  1. export type Browser = {
  2. /**
  3. Human-readadable name of the browser.
  4. */
  5. name: string;
  6. /**
  7. The unique identifier for the browser on the current platform:
  8. - On macOS, it's the app's bundle identifier.
  9. - On Linux, it's the desktop file identifier (from `xdg-mime`).
  10. - On Windows, it's an invented identifier, because apps on Windows does not have identifiers.
  11. */
  12. id: string;
  13. };
  14. /**
  15. Get the default browser for the current platform.
  16. @returns A promise for the browser.
  17. @example
  18. ```
  19. import defaultBrowser from 'default-browser';
  20. console.log(await defaultBrowser());
  21. //=> {name: 'Safari', id: 'com.apple.Safari'}
  22. ```
  23. */
  24. export default function defaultBrowser(): Promise<Browser>;