Open ericmorand opened 3 years ago
@brianloveswords , you may be interested. I see that you fixed the typings some months ago.
I think this types definition is the correct one:
// Note that @types/browserify is not used for a reason:
// https://github.com/TypeStrong/tsify/issues/267
import * as typescript from "typescript";
declare namespace tsify {
export interface Options {
exclude?: string[];
files?: string[];
global?: boolean;
include?: string[];
m?: string;
p?: string | Record<string, any>;
project?: string | Record<string, any>;
t?: string;
typescript?: string | typeof typescript;
}
}
declare var tsify: (b: any, opts: tsify.Options) => any;
export = tsify;
Also, jsx
is missing in Options
defintion. As most TypeScript CompilerOptions
properties.
I think this types definition is the correct one: ...
Yeah, you are right. If you want to open a PR for the change, that would be appreciated.
As most TypeScript
CompilerOptions
properties.
IMO it's unrealistic to support every project and compiler option via command line and plugin options. Use a tsconfig.json
file.
Compiling, then running the following TypeScript module output
undefined
:Of course, passing
tsify
to Browserify would throw aCannot find module 'undefined'
error.