memorystorage
memorystorage copied to clipboard
Typings
Does anybody was creating typing for this package?
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;
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.
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