mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +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
3
types/tsc-watch/client.d.ts
vendored
Normal file
3
types/tsc-watch/client.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import client = require('./lib/client');
|
||||
|
||||
export = client;
|
||||
6
types/tsc-watch/index.d.ts
vendored
Normal file
6
types/tsc-watch/index.d.ts
vendored
Normal file
@ -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 {};
|
||||
25
types/tsc-watch/lib/client.d.ts
vendored
Normal file
25
types/tsc-watch/lib/client.d.ts
vendored
Normal file
@ -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;
|
||||
22
types/tsc-watch/tsc-watch-tests.ts
Normal file
22
types/tsc-watch/tsc-watch-tests.ts
Normal file
@ -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.
|
||||
}
|
||||
23
types/tsc-watch/tsconfig.json
Normal file
23
types/tsc-watch/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/tsc-watch/tslint.json
Normal file
1
types/tsc-watch/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user