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

closure-library.ts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

closure-library.ts

Closure Library for TypeScript

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by145.45%
Maintainers
1
Weekly downloads
 
Created
Source

closure-library.ts NPM version build status Dependency Status

Closure Library for TypeScript

This is all-in-one package to use Closure Library with TypeScript including:

Install

$ npm install closure-library.ts

Usage

// Import index.ts to load type information of Closure Library.
import closure = require('./node_modules/closure-library.ts/index');
// Call register() to enable `goog.requrie()`.
closure.register();
// Then `googl.require` returns the namespace!
var Queue = goog.require('goog.structs.Queue');
// Type information of Closure Library is available in TypeScript.
var q = new Queue<number>();
q.enqueue(10);
q.enqueue(20);
q.enqueue(30);
var n: number = q.dequeue(); // n = 10, ok!
var s: string = q.dequeue(); // Error! "Type 'number' is not assignable to type 'string'."

Once closure-library.ts is registered in the top of your bootstrap file, you don't have to register() in each dependent file.

License

MIT License: Teppei Sato <teppeis@gmail.com>

Keywords

FAQs

Package last updated on 17 Mar 2015

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