We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6791ff3 commit 33130d8Copy full SHA for 33130d8
scripts/build-flow.js
@@ -3,7 +3,7 @@ const fs = require('fs');
3
let dir = `${__dirname}/../`;
4
let index = fs.readFileSync(dir + '/node/index.d.ts', 'utf8');
5
index = '// @flow\n' + index;
6
-index = index.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
+index = index.replace(/export interface (.*?)(?: extends (.+?))? \{((?:.|\n)*?)\}/g, (_, name, ext, contents) => `export type ${name} =${ext ? ` ${ext} &` : ''} {|${contents}|};`);
7
index = index.replace(/export declare function/g, 'declare export function');
8
index = index.replace("Omit<TransformOptions, 'code'>", "$Rest<TransformOptions, {|code: TransformOptions['code']|}>");
9
0 commit comments