diff --git a/types/react-dom/node-stream/index.d.ts b/types/react-dom/node-stream/index.d.ts
new file mode 100644
index 0000000000..449d45b46d
--- /dev/null
+++ b/types/react-dom/node-stream/index.d.ts
@@ -0,0 +1,20 @@
+///
+import { ReactElement } from 'react';
+import * as stream from 'stream';
+
+/**
+ * Render a ReactElement to its initial HTML. This should only be used on the
+ * server.
+ * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostream
+ */
+export function renderToStream(element: ReactElement): stream.Readable;
+
+/**
+ * Similar to renderToStream, except this doesn't create extra DOM attributes
+ * such as data-react-id that React uses internally.
+ * See https://facebook.github.io/react/docs/react-dom-stream.html#rendertostaticstream
+ */
+export function renderToStaticStream(element: ReactElement): stream.Readable;
+export const version: string;
+
+export as namespace ReactDOMNodeStream;
diff --git a/types/react-dom/react-dom-tests.ts b/types/react-dom/react-dom-tests.ts
index 534b847787..9a60724dae 100644
--- a/types/react-dom/react-dom-tests.ts
+++ b/types/react-dom/react-dom-tests.ts
@@ -1,7 +1,9 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as ReactDOMServer from 'react-dom/server';
+import * as ReactDOMNodeStream from 'react-dom/node-stream';
import * as ReactTestUtils from 'react-dom/test-utils';
+import * as stream from 'stream';
declare function describe(desc: string, f: () => void): void;
declare function it(desc: string, f: () => void): void;
@@ -37,6 +39,16 @@ describe('ReactDOMServer', () => {
});
});
+describe('ReactDOMNodeStream', () => {
+ it('renderToStream', () => {
+ const content: stream.Readable = ReactDOMNodeStream.renderToStream(React.createElement('div'));
+ });
+
+ it('renderToStaticStream', () => {
+ const content: stream.Readable = ReactDOMNodeStream.renderToStaticStream(React.createElement('div'));
+ });
+});
+
describe('React dom test utils', () => {
it('Simulate', () => {
const element = document.createElement('div');
diff --git a/types/react-dom/tsconfig.json b/types/react-dom/tsconfig.json
index c93c6f8195..8c270fabed 100644
--- a/types/react-dom/tsconfig.json
+++ b/types/react-dom/tsconfig.json
@@ -3,6 +3,7 @@
"index.d.ts",
"react-dom-tests.ts",
"server/index.d.ts",
+ "node-stream/index.d.ts",
"test-utils/index.d.ts"
],
"compilerOptions": {
@@ -22,4 +23,4 @@
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
-}
\ No newline at end of file
+}