Skip to content

Commit

Permalink
Add POC
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed Sep 9, 2022
1 parent 58710be commit 9fb5819
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules/
11 changes: 11 additions & 0 deletions 4.7.4.d.ts
@@ -0,0 +1,11 @@
declare module "main" {
export const main: ({ conflict: a }: {
conflict: number;
}, { conflict: b }: {
conflict: number;
}, { dupe: c, dupe: d }: {
dupe: number;
}, { function: e }: {
function: number;
}) => number;
}
8 changes: 8 additions & 0 deletions 4.7.4/package.json
@@ -0,0 +1,8 @@
{
"devDependencies": {
"typescript": "4.7.4"
},
"scripts": {
"build": "tsc --declaration --emitDeclarationOnly --outfile ../4.7.4.d.ts ../main.ts"
}
}
11 changes: 11 additions & 0 deletions 4.8.3.d.ts
@@ -0,0 +1,11 @@
declare module "main" {
export const main: ({ conflict }: {
conflict: number;
}, { conflict }: {
conflict: number;
}, { dupe, dupe }: {
dupe: number;
}, { function }: {
function: number;
}) => number;
}
8 changes: 8 additions & 0 deletions 4.8.3/package.json
@@ -0,0 +1,8 @@
{
"devDependencies": {
"typescript": "4.8.3"
},
"scripts": {
"build": "tsc --declaration --emitDeclarationOnly --outfile ../4.8.3.d.ts ../main.ts"
}
}
33 changes: 33 additions & 0 deletions README.md
@@ -1 +1,34 @@
# TypeScript 4.8 declaration poc

```shell
npm install
```

```shell
npm run build

# > build
# > npm run --quiet build --workspaces
#
#
# > build
# > tsc --declaration --emitDeclarationOnly --outfile ../4.7.4.d.ts ../main.ts
#
# > build
# > tsc --declaration --emitDeclarationOnly --outfile ../4.8.3.d.ts ../main.ts
```

```shell
npm run lint

# > lint
# > tsc --noEmit *.d.ts
#
# 4.8.3.d.ts:8:19 - error TS1005: ':' expected.
#
# 8 }, { function }: {
# ~
#
#
# Found 1 error in 4.8.3.d.ts:8
```
6 changes: 6 additions & 0 deletions main.ts
@@ -0,0 +1,6 @@
export const main = (
{ conflict: a }: { conflict: number },
{ conflict: b }: { conflict: number },
{ dupe: c, dupe: d }: { dupe: number },
{ function: e }: { function: number }
) => a + b + c + d + e;
85 changes: 85 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
@@ -0,0 +1,10 @@
{
"scripts": {
"build": "npm run build --workspaces",
"lint": "tsc --noEmit *.d.ts"
},
"workspaces": [
"4.7.4",
"4.8.3"
]
}

0 comments on commit 9fb5819

Please sign in to comment.