memorystorage icon indicating copy to clipboard operation
memorystorage copied to clipboard

Typings

Open andreyshedko opened this issue 3 years ago • 3 comments

Does anybody was creating typing for this package?

andreyshedko avatar Mar 26 '21 07:03 andreyshedko

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;

andreyshedko avatar Mar 26 '21 10:03 andreyshedko

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 avatar Mar 31 '21 18:03 Download

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

Download avatar Mar 31 '21 18:03 Download