declare module for direct import of BaseAdapter class - #98
Conversation
In some cases may needed to write a custom Adapter .so you may need to import directly `BaseAdapter` class not only type of `BaseAdapter `. this declaration helps to import directly base class and use `BaseAdapter` typing declared in `@moleculer/database` module .
Add Adapters to access register method directly
|
Thanks for the PR! However, what you're trying to achieve is already possible without a deep import: the import { Adapters } from "@moleculer/database";
class MyAdapter extends Adapters.Base {
// ...
}or in CommonJS: const { Adapters } = require("@moleculer/database");
class MyAdapter extends Adapters.Base {
// ...
}The typings declare it as Regarding the proposed declarations themselves: So I'm closing this without merging — please use |
In some cases may needed to write a custom Adapter .so you may need to import directly
BaseAdapterclass not only type ofBaseAdapter. this declaration helps to import directly base class and useBaseAdaptertyping declared in@moleculer/databasemodule .