Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type declarations #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

hpello
Copy link

@hpello hpello commented Feb 15, 2023

Description

The current types in index.d.ts file are not valid typescript. Namely, they contain the following errors:

index.d.ts:1:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
1 namespace Receptacle {
  ~~~~~~~~~
index.d.ts:43:76 - error TS2707: Generic type 'Receptacle<T, X>' requires between 1 and 2 type arguments.
43     public set(key: string, value: T, options?: Receptacle.SetOptions<X>): Receptacle;
                                                                              ~~~~~~~~~~
index.d.ts:45:32 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
45     public expire(key: string, ms: number = 0): void;
                                  ~~~~~~~~~~~~~~

Contents

In this PR:

  • We fix the current typing errors
  • We add a type-check target that ensures types are well checked for the future

@hpello hpello changed the title Fix types Fix type declarations Feb 15, 2023
@hpello
Copy link
Author

hpello commented Feb 21, 2023

Hello @DylanPiercey! Could you take a look at this PR? 🙂
We need it to keep using receptacle in our TS codebase.

@hpello
Copy link
Author

hpello commented Apr 11, 2023

Hi! @DylanPiercey did you have a chance to look at these typings please? 🙏
cc @sod @gamtiq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant