Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web-lite/api-types

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web-lite/api-types

Use W with type checking and docs out of the box.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
Maintainers
5
Weekly downloads
 
Created
Source

api-types

typescript interfaces and types for W api object

Yarn

yarn add @web-lite/api-types --dev

npm

npm install @web-lite/api-types --save-dev

typescript

import IWindow from '@web-lite/api-types';

const W = (window as IWindow).W;

javascript

  • Webstorm Webstorm indexing will find and use the type for W, no additioanl setup is needed

  • VSCode Add a reference to the typed file at heading when you want to use W APIs. VSCode will use its intellisense to suggest docs and auto-complete.

/// <reference path="node_modules/@web-lite/api-types/index.d.ts" />

Note: You may need to change the path of node_modules directory in workspace-configured projects.

Note: You can still use mocks.api

mock weblite api

import { mockWebliteApi } from '@web-lite/api-types';

mockWebliteApi();
// or
mockWebliteApi({ user: { firstname: 'custom_name', id: 'custom_id' } });

This will only set window.W in development. process.env.NODE_ENV === 'development' && !window.W

Keywords

FAQs

Package last updated on 11 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc