elrumordelaluz / elrumordelaluz/reactour

Allow type augmentation

Open
#511 2 comments 0 reactions 0 assignees View on GitHub
help-welcome typescript
Dominant language
TypeScript
Stars
4.1k
Forks
352
PR merge metrics
No merged PRs in 30d

Description

As of now, for me, v3.1.4 (latest) is not working, gives me some compilation errors, so I using these versions:
```
"@reactour/tour": "2.10.3",
"resolutions": {
"@reactour/utils": "0.3.0",
"@reactour/popover": "0.4.1",
"@reactour/mask": "0.5.1"
}
```

My application is context aware, so I need a key property on `StepType` interface.
I tried to augment types by creating `@reactour.d.ts`
Here is its contents:
```
import { StepType as _StepType } from '@reactour/tour';

declare module '@reactour/tour' {
type StepType = _StepType & {
key: string;
}
}
```

Wherever libary uses StepType interface, I expect it to have `key` property now, but that's not the case.
e.g.
```
const { steps } = useTour();
steps[0].key <---- throws an error: Property 'key' does not exist on type 'StepType'
```

So, I guess, typings of this library has some issues. It will be awesome if it is fixed in a near future release.

And thanks for a great library!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.