mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
feat(tsc-watch): new type definition v4.2 (#43592)
- definition files - tests https://github.com/gilamran/tsc-watch Thanks!
This commit is contained in:
parent
6908f6ea06
commit
9a2f620ce7
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import client = require('./lib/client');
|
||||
|
||||
export = client;
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// Type definitions for tsc-watch 4.2
|
||||
// Project: https://github.com/gilamran/tsc-watch#readme
|
||||
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export {};
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
declare class TscWatchClient extends EventEmitter {
|
||||
start(...args: any[]): void;
|
||||
kill(): void;
|
||||
|
||||
// tslint:disable:unified-signatures
|
||||
/**
|
||||
* Emitted upon first successful compilation
|
||||
*/
|
||||
on(event: 'first_success', cb: () => any): this;
|
||||
/**
|
||||
* Emitted upon first successful compilation
|
||||
*/
|
||||
on(event: 'success', cb: () => any): this;
|
||||
/**
|
||||
* Emitted upon every failing compilation
|
||||
*/
|
||||
on(event: 'compile_errors', cb: () => any): this;
|
||||
// tslint:enable:unified-signatures
|
||||
}
|
||||
|
||||
export = TscWatchClient;
|
||||
@@ -0,0 +1,22 @@
|
||||
import TscWatchClient = require('tsc-watch/client');
|
||||
const watch = new TscWatchClient();
|
||||
|
||||
watch.on('first_success', () => {
|
||||
console.log('First success!');
|
||||
});
|
||||
|
||||
watch.on('success', () => {
|
||||
// Your code goes here...
|
||||
});
|
||||
|
||||
watch.on('compile_errors', () => {
|
||||
// Your code goes here...
|
||||
});
|
||||
|
||||
watch.start('--project', '.');
|
||||
|
||||
try {
|
||||
// do something...
|
||||
} catch (e) {
|
||||
watch.kill(); // Fatal error, kill the compiler instance.
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"tsc-watch-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user