Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@walletconnect/window-getters

walletconnect2.1mMIT1.0.1TypeScript support: included

Safe Window Getters

window, undefined, isomorphic, getters, throw

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;