oxc/crates/oxc_isolated_declarations/tests/snapshots/expando-function.snap
Dunqing 4a62703d88 feat(isolated-declarations): handle export in the namespace correctly (#5950)
Previous I didn't follow the behavior of `TypeScript` to handle `export` in `namespace` as I thought no one used this
2024-09-21 16:39:58 +00:00

66 lines
1.7 KiB
Text

---
source: crates/oxc_isolated_declarations/tests/mod.rs
input_file: crates/oxc_isolated_declarations/tests/fixtures/expando-function.ts
---
```
==================== .D.TS ====================
export declare function foo(): void;
export declare const bar: () => void;
export declare namespace NS {
const goo: () => void;
}
export declare namespace foo {
let baz: number;
}
declare function qux(): void;
declare namespace qux {
let woo: number;
}
export default qux;
==================== Errors ====================
x TS9023: Assigning properties to functions without declaring them is not
| supported with --isolatedDeclarations. Add an explicit declaration for the
| properties assigned to this function.
,-[2:1]
1 | export function foo(): void {}
2 | foo.apply = () => {}
: ^^^^^^^^^
3 |
`----
x TS9023: Assigning properties to functions without declaring them is not
| supported with --isolatedDeclarations. Add an explicit declaration for the
| properties assigned to this function.
,-[5:1]
4 | export const bar = (): void => {}
5 | bar.call = () => {}
: ^^^^^^^^
6 |
`----
x TS9023: Assigning properties to functions without declaring them is not
| supported with --isolatedDeclarations. Add an explicit declaration for the
| properties assigned to this function.
,-[19:1]
18 |
19 | foo.bar = 42;
: ^^^^^^^
20 | foo.baz = 100;
`----
x TS9023: Assigning properties to functions without declaring them is not
| supported with --isolatedDeclarations. Add an explicit declaration for the
| properties assigned to this function.
,-[10:3]
9 | export const goo = (): void => {}
10 | goo.length = 10
: ^^^^^^^^^^
11 | }
`----
```