1.0.2 • Published 12 months ago

@doneup/window-getters v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

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;