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

Typings #18

Open
andreyshedko opened this issue Mar 26, 2021 · 3 comments
Open

Typings #18

andreyshedko opened this issue Mar 26, 2021 · 3 comments
Assignees

Comments

@andreyshedko
Copy link

Does anybody was creating typing for this package?

@andreyshedko
Copy link
Author

andreyshedko commented Mar 26, 2021

This is typing that works for me, probably it can be significantly improved.

declare function MemoryStorage(id?: string);

declare const Function1: typeof MemoryStorage & MemoryStorage;
declare namespace _Function1 {
  export interface MemoryStorage {
    setItem: (key: string, value: unknown) => void;
    getItem: (key: string) => unknown;
    clear: () => void;
  }
}
export = _Function1;

@Download
Copy link
Owner

Hi @andreyshedko thanks for your comment.
Would you like to try and make a pull request? I can help you if you want to try this.

@Download
Copy link
Owner

If you want to take a stab at this:

  • Fork this repo (check the button in the top right of the page)
  • Then Git clone your fork to your local machine
  • Git create a branch, call it e.g. 'feat/typings' or something
  • Make your changes, including your typings, editing package JSON
  • Test your changes (ideally, write a small test, maybe a test.ts file that you compile to check for errors)
  • Git commit your changes
  • Git push your changes to your fork
  • Visit your fork on Github. It will offer to make a Pull Request
  • Create a Pull Request
  • I will check your changes and if they cause no issues, merge them
  • I will create a new release

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

No branches or pull requests

2 participants