Skip to content

Instantly share code, notes, and snippets.

@piperswe
Created February 20, 2016 22:21
Show Gist options
  • Save piperswe/9fa3980a87de4d71268a to your computer and use it in GitHub Desktop.
Save piperswe/9fa3980a87de4d71268a to your computer and use it in GitHub Desktop.
>tsc
sbuffers.d.ts(22,16): error TS2435: Ambient modules cannot be nested in other modules or namespaces.
import { Readable, Writable } from 'stream'
declare module StreamBuffers {
export interface StreamBuffers {
ReadableStreamBuffer: ReadableStreamBufferFactory
WritableStreamBuffer: WritableStreamBuffer
}
interface ReadableStreamBufferFactory {
new (options: Options): Readable
}
interface WritableStreamBuffer {
new (options: Options): Writable
}
interface Options {
frequency: number
chunkSize: number
}
}
declare module 'stream-buffers' {
var streamBuffers: StreamBuffers.StreamBuffers
export = streamBuffers
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment