In order to do so, I've moved the database.ts file to databases/loki.ts and created a databases/base.ts which contains the TypeScript interface that all database implementations will have to follow.
Additional changes that I've done as part of this PR (I'd loved to make them as separate PRs but they are all dependant between each other, and dependant PRs on GitHub are not handled very well 😅):
Upgraded TypeScript version to v3 (to support unknown type).
Refined some TypeScript types that were any or object before.
Remove the injection of the getDate() implementation since it was only done for testing purposes. Instead I've modified the tests.
This PR does some minimum changes to the
telemetry
package to allow supporting multiple implementation of databases.This will allow us to tackle https://github.com/atom/telemetry/issues/26 by creating a new
IndexedDB
database implementation.In order to do so, I've moved the
database.ts
file todatabases/loki.ts
and created adatabases/base.ts
which contains the TypeScript interface that all database implementations will have to follow.Additional changes that I've done as part of this PR (I'd loved to make them as separate PRs but they are all dependant between each other, and dependant PRs on GitHub are not handled very well 😅):
unknown
type).any
orobject
before.getDate()
implementation since it was only done for testing purposes. Instead I've modified the tests.