mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
type definitions for node-microphone (#45180)
* type definitions for node-microphone * removed blank lines * fixed export issue * added the allowSyntheticDefaultImports tsc option
This commit is contained in:
parent
5ca78f269e
commit
f58b03ab6e
25
types/node-microphone/index.d.ts
vendored
Normal file
25
types/node-microphone/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for node-microphone 0.1
|
||||
// Project: https://github.com/MexXxo/node-microphone#readme
|
||||
// Definitions by: Andreas May <https://github.com/Maanex>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
interface MicrophoneOptions {
|
||||
endian?: 'big' | 'little';
|
||||
bitwidth?: 8 | 16 | 24;
|
||||
encoding?: 'signed-integer' | 'unsigned-integer';
|
||||
rate?: 8000 | 16000 | 44100;
|
||||
channels?: 1 | 2;
|
||||
device?: 'hw:0,0' | 'plughw:1,0' | 'default';
|
||||
additionalParameters?: any;
|
||||
}
|
||||
|
||||
declare class Microphone {
|
||||
constructor(options?: MicrophoneOptions);
|
||||
|
||||
startRecording(): NodeJS.WriteStream;
|
||||
stopRecording(): void;
|
||||
}
|
||||
|
||||
export = Microphone;
|
||||
16
types/node-microphone/node-microphone-tests.ts
Normal file
16
types/node-microphone/node-microphone-tests.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import Microphone from "node-microphone";
|
||||
|
||||
const mic = new Microphone({
|
||||
channels: 1,
|
||||
bitwidth: 16,
|
||||
endian: "little",
|
||||
device: "default",
|
||||
encoding: "signed-integer",
|
||||
rate: 44100,
|
||||
additionalParameters: {}
|
||||
});
|
||||
|
||||
const stream = mic.startRecording();
|
||||
stream.pipe(process.stdout);
|
||||
|
||||
mic.stopRecording();
|
||||
25
types/node-microphone/tsconfig.json
Normal file
25
types/node-microphone/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"node-microphone-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/node-microphone/tslint.json
Normal file
1
types/node-microphone/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user