mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
db.js types should declare the "db.js" module, not "db"
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
0294941be7
commit
a077e4d2e4
@@ -1,4 +1,4 @@
|
||||
// Test file for db.js Definition file
|
||||
import db = require("db.js");
|
||||
|
||||
/* Type for use in tests */
|
||||
|
||||
|
||||
Vendored
+12
-12
@@ -7,7 +7,7 @@ declare module DbJs {
|
||||
interface ErrorListener {
|
||||
(err: Error): void;
|
||||
}
|
||||
|
||||
|
||||
interface OpenOptions {
|
||||
server: string;
|
||||
version: number;
|
||||
@@ -29,14 +29,14 @@ declare module DbJs {
|
||||
interface CountableQuery<T> {
|
||||
count(): ExecutableQuery<T>;
|
||||
}
|
||||
|
||||
|
||||
interface KeysQuery<T> extends DescableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DistinctableQuery<T>, MappableQuery<T> {
|
||||
}
|
||||
}
|
||||
|
||||
interface KeyableQuery<T> {
|
||||
keys(): KeysQuery<T>;
|
||||
}
|
||||
|
||||
|
||||
interface FilterQuery<T> extends KeyableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DescableQuery<T>, DistinctableQuery<T>, ModifiableQuery<T>, LimitableQuery<T>, MappableQuery<T> {
|
||||
}
|
||||
|
||||
@@ -44,14 +44,14 @@ declare module DbJs {
|
||||
filter<TValue>(index: string, value: TValue): FilterQuery<T>;
|
||||
filter(filter: (value: T) => boolean): FilterQuery<T>;
|
||||
}
|
||||
|
||||
interface DescQuery<T> extends KeyableQuery<T>, CountableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DescableQuery<T>, ModifiableQuery<T>, MappableQuery<T> {
|
||||
|
||||
interface DescQuery<T> extends KeyableQuery<T>, CountableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DescableQuery<T>, ModifiableQuery<T>, MappableQuery<T> {
|
||||
}
|
||||
|
||||
interface DescableQuery<T> {
|
||||
desc(): DescQuery<T>;
|
||||
}
|
||||
|
||||
|
||||
interface DistinctQuery<T> extends KeyableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DescableQuery<T>, ModifiableQuery<T>, MappableQuery<T>, CountableQuery<T> {
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ declare module DbJs {
|
||||
interface MappableQuery<T> {
|
||||
map<TMap>(fn: (value: T) => TMap): Query<TMap>;
|
||||
}
|
||||
|
||||
|
||||
interface Query<T> extends Promise<T>, KeyableQuery<T>, ExecutableQuery<T>, FilterableQuery<T>, DescableQuery<T>, DistinctableQuery<T>, ModifiableQuery<T>, LimitableQuery<T>, MappableQuery<T>, CountableQuery<T> {
|
||||
}
|
||||
|
||||
@@ -93,11 +93,11 @@ declare module DbJs {
|
||||
getIndexedDB(): IDBDatabase;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
|
||||
interface IndexAccessibleServer {
|
||||
[store: string]: TypedObjectStoreServer<any>;
|
||||
}
|
||||
|
||||
|
||||
interface ObjectStoreServer {
|
||||
add<T>(table: string, entity: T): Promise<T>;
|
||||
add<T>(table: string, ...entities: T[]): Promise<T[]>;
|
||||
@@ -142,11 +142,11 @@ declare module DbJs {
|
||||
query(index: string): IndexQuery<T>;
|
||||
count(key: any): Promise<number>;
|
||||
}
|
||||
|
||||
|
||||
type Server = DbJs.IndexAccessibleServer & DbJs.ObjectStoreServer & DbJs.BaseServer;
|
||||
}
|
||||
|
||||
declare module "db" {
|
||||
declare module "db.js" {
|
||||
var db: DbJs.DbJsStatic;
|
||||
export = db;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user