JSPM

window-getters

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2528
  • Score
    100M100P100Q157254F
  • License MIT

Safe Window Getters

Package Exports

  • window-getters

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (window-getters) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

window-getters npm version

Safe Window Getters

API

function getFromWindow<T>(name: string): T | undefined;
function getFromWindowOrThrow<T>(name: string): T;

function getDocumentOrThrow(): Document;
function getDocument(): Document | undefined;

function getNavigatorOrThrow(): Navigator;
function getNavigator(): Navigator | undefined;

function getLocationOrThrow(): Location;
function getLocation(): Location | undefined;

function getCryptoOrThrow(): Crypto;
function getCrypto(): Crypto | undefined;

function getLocalStorageOrThrow(): Storage;
function getLocalStorage(): Storage | undefined;