mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Add sonic-boom package
This commit is contained in:
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
// Type definitions for sonic-boom 0.6
|
||||
// Project: https://github.com/mcollina/sonic-boom.git
|
||||
// Definitions by: Alex Ferrando <https://github.com/alferpal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export = SonicBoom
|
||||
|
||||
declare class SonicBoom extends EventEmitter {
|
||||
/**
|
||||
* @param [fileDescriptor] File path or numerical file descriptor
|
||||
* relative protocol is enabled. Default: process.stdout
|
||||
* @returns a new sonic-boom instance
|
||||
*/
|
||||
constructor(fileDescriptor: String | Number)
|
||||
|
||||
/**
|
||||
* Writes the string to the file. It will return false to signal the producer to slow down.
|
||||
*/
|
||||
write(string: String): void;
|
||||
|
||||
/**
|
||||
* Writes the current buffer to the file if a write was not in progress.
|
||||
* Do nothing if minLength is zero or if it is already writing.
|
||||
*/
|
||||
flush(): void;
|
||||
|
||||
/**
|
||||
* Reopen the file in place, useful for log rotation.
|
||||
*/
|
||||
reopen(file: String): void;
|
||||
|
||||
/**
|
||||
* Flushes the buffered data synchronously. This is a costly operation.
|
||||
*/
|
||||
flushSync(): void;
|
||||
|
||||
/**
|
||||
* Closes the stream, the data will be flushed down asynchronously
|
||||
*/
|
||||
end(): void;
|
||||
|
||||
/**
|
||||
* Closes the stream immediately, the data is not flushed.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
import SonicBoom = require('sonic-boom')
|
||||
const sonic = new SonicBoom(1)
|
||||
|
||||
sonic.write('hello sonic\n')
|
||||
|
||||
sonic.flush()
|
||||
|
||||
sonic.flushSync()
|
||||
|
||||
sonic.end()
|
||||
|
||||
sonic.destroy()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sonic-boom-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user