mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
Previous I didn't follow the behavior of `TypeScript` to handle `export` in `namespace` as I thought no one used this
66 lines
1.7 KiB
Text
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 | }
|
|
`----
|
|
|
|
|
|
```
|