mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
452 B
TypeScript
17 lines
452 B
TypeScript
import MemDown from 'memdown';
|
|
|
|
const test = (db: MemDown<string, string>) => {
|
|
db.open(() => {
|
|
db.put("key", "value", (err?: Error) => { });
|
|
db.get("key", (err?: Error) => { });
|
|
db.get("key", (err: Error | undefined, value: string) => { });
|
|
db.close(() => {});
|
|
});
|
|
};
|
|
|
|
// doesn't need `new` and can be called as a function
|
|
test(new MemDown<string, string>());
|
|
test(new MemDown());
|
|
test(MemDown<string, string>());
|
|
test(MemDown());
|