exec-sh icon indicating copy to clipboard operation
exec-sh copied to clipboard

A 'declare' modifier cannot be used in an already ambient context.

Open sawa-ko opened this issue 5 years ago • 3 comments

tsc -p tsconfig.json
"typescript": "^4.2.3",
"exec-sh": "^0.3.5"
yarn run v1.22.5
$ tsc -p tsconfig.json
node_modules/exec-sh/types/index.d.ts:6:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.

6   declare function execSh (command: string | string[], options?: SpawnOptionsWithoutStdio | boolean, callback?: execShCallback): ChildProcessWithoutNullStreams;
    ~~~~~~~

node_modules/exec-sh/types/index.d.ts:7:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.

7   declare function execSh (command: string | string[], callback?: execShCallback): ChildProcessWithoutNullStreams;
    ~~~~~~~

node_modules/exec-sh/types/index.d.ts:8:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.

8   declare namespace execSh {
    ~~~~~~~

src/bot/commands/private/administration/exec.administration.command.ts:40:55 - error TS2559: Type 'true' has no properties in common with type 'SpawnOptionsWithoutStdio'.

40       const execCommand = await exec.promise(command, true);
                                                         ~~~~


Found 4 errors.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

sawa-ko avatar Mar 24 '21 04:03 sawa-ko

Could not reproduce the issue with 'declare'. Function type issue is valid. #20 is reverted for now. released 0.3.6.

tsertkov avatar Mar 24 '21 07:03 tsertkov

#23 may work better

tsertkov avatar Mar 24 '21 11:03 tsertkov

Fixed by #23

tsertkov avatar Mar 26 '21 14:03 tsertkov