From 58c1a09cfdf2a72cbcc0d95db22f579e461be248 Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Tue, 6 May 2025 09:01:12 +0200 Subject: [PATCH] add index.d.ts for persistent adapter --- src/db/clickhouse/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ src/db/indexeddb/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ src/db/mongodb/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ src/db/postgres/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ src/db/redis/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ src/db/sqlite/index.d.ts | 41 ++++++++++++++++++++++++++++++++++++ 6 files changed, 246 insertions(+) create mode 100644 src/db/clickhouse/index.d.ts create mode 100644 src/db/indexeddb/index.d.ts create mode 100644 src/db/mongodb/index.d.ts create mode 100644 src/db/postgres/index.d.ts create mode 100644 src/db/redis/index.d.ts create mode 100644 src/db/sqlite/index.d.ts diff --git a/src/db/clickhouse/index.d.ts b/src/db/clickhouse/index.d.ts new file mode 100644 index 0000000..4ea4f70 --- /dev/null +++ b/src/db/clickhouse/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/clickhouse" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: any; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: any; + } +} diff --git a/src/db/indexeddb/index.d.ts b/src/db/indexeddb/index.d.ts new file mode 100644 index 0000000..0a9f5c0 --- /dev/null +++ b/src/db/indexeddb/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/indexeddb" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: IDBDatabase; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: IDBDatabase; + } +} diff --git a/src/db/mongodb/index.d.ts b/src/db/mongodb/index.d.ts new file mode 100644 index 0000000..44b09d2 --- /dev/null +++ b/src/db/mongodb/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/mongodb" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: any; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: any; + } +} diff --git a/src/db/postgres/index.d.ts b/src/db/postgres/index.d.ts new file mode 100644 index 0000000..6ea0129 --- /dev/null +++ b/src/db/postgres/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/postgres" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: any; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: any; + } +} diff --git a/src/db/redis/index.d.ts b/src/db/redis/index.d.ts new file mode 100644 index 0000000..a1c6df9 --- /dev/null +++ b/src/db/redis/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/redis" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: any; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: any; + } +} diff --git a/src/db/sqlite/index.d.ts b/src/db/sqlite/index.d.ts new file mode 100644 index 0000000..070d09b --- /dev/null +++ b/src/db/sqlite/index.d.ts @@ -0,0 +1,41 @@ +declare module "flexsearch/db/sqlite" { + + type IdType = + "text" | + "char" | + "varchar" | + "string" | + "number" | + "numeric" | + "integer" | + "smallint" | + "tinyint" | + "mediumint" | + "int" | + "int8" | + "uint8" | + "int16" | + "uint16" | + "int32" | + "uint32" | + "int64" | + "uint64" | + "bigint"; + + type PersistentOptions = { + name?: string; + type?: IdType; + db?: any; + }; + + export default class StorageInterface { + constructor(name: string, config: PersistentOptions); + constructor(config: string | PersistentOptions); + //mount(index: Index | Document) : Promise; + open() : Promise; + close() : Promise; + destroy() : Promise; + clear() : Promise; + db: any; + } +}