mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Write test case that baselines the incremental build result
Testcase for #30780
This commit is contained in:
9
tests/projects/inferredTypeFromTransitiveModule/bar.ts
Normal file
9
tests/projects/inferredTypeFromTransitiveModule/bar.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
interface RawAction {
|
||||
(...args: any[]): Promise<any> | void;
|
||||
}
|
||||
interface ActionFactory {
|
||||
<T extends RawAction>(target: T): T;
|
||||
}
|
||||
declare function foo<U extends any[] = any[]>(): ActionFactory;
|
||||
export default foo()(function foobar(param: string): void {
|
||||
});
|
||||
11
tests/projects/inferredTypeFromTransitiveModule/bundling.ts
Normal file
11
tests/projects/inferredTypeFromTransitiveModule/bundling.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export class LazyModule<TModule> {
|
||||
constructor(private importCallback: () => Promise<TModule>) {}
|
||||
}
|
||||
|
||||
export class LazyAction<
|
||||
TAction extends (...args: any[]) => any,
|
||||
TModule
|
||||
> {
|
||||
constructor(_lazyModule: LazyModule<TModule>, _getter: (module: TModule) => TAction) {
|
||||
}
|
||||
}
|
||||
5
tests/projects/inferredTypeFromTransitiveModule/index.ts
Normal file
5
tests/projects/inferredTypeFromTransitiveModule/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { LazyAction, LazyModule } from './bundling';
|
||||
const lazyModule = new LazyModule(() =>
|
||||
import('./lazyIndex')
|
||||
);
|
||||
export const lazyBar = new LazyAction(lazyModule, m => m.bar);
|
||||
@@ -0,0 +1 @@
|
||||
export { default as bar } from './bar';
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"declaration": true,
|
||||
"outDir": "obj",
|
||||
"incremental": true,
|
||||
"lib": ["es5", "es2015.promise"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user