Skip to content

Commit

Permalink
displaying dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijah-trillionz committed Sep 10, 2022
1 parent 739bdfe commit 2274314
Show file tree
Hide file tree
Showing 5 changed files with 450 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
LICENSE.txt
README.md
pre.nodemon.json
/dist
native-json-db-1.0.0.tgz
dist/database.js
dist/error.js
dist/server.js
52 changes: 52 additions & 0 deletions dist/database.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
interface Data {
[key: string]: any[];
}
interface IncDecObject {
[key: string]: number;
}
interface Object {
[key: string]: any;
$inc?: IncDecObject;
$dec?: IncDecObject;
$pop?: {
[key: string]: 0 | -1;
};
$push?: {
[key: string]: any;
};
}
interface UpdateManyOptions {
updateAll: boolean;
}
interface DeleteManyOptions {
deleteAll: boolean;
}
interface ConnectOptions {
writeSync?: boolean;
}
export declare class JSONDB {
readonly data: Data;
readonly dataName: string;
readonly dataArr: Object[];
validate: any;
connected: boolean;
updateKeywords: string[];
dbOptions: ConnectOptions;
constructor(dataName: string);
get allData(): Promise<Object[]>;
connect(schema: Object, options: ConnectOptions): Promise<unknown>;
create(data: Object): Promise<unknown>;
findOne(filter: Object): Promise<Object | null>;
findMany(filter: Object): Promise<Object[]>;
findOneAndUpdate(filter: Object, newData: Object): Promise<unknown>;
updateMany(filter: Object, newData: Object, options?: UpdateManyOptions): Promise<unknown>;
findOneAndDelete(filter: Object): Promise<unknown>;
deleteMany(filter: Object, options?: DeleteManyOptions): Promise<unknown>;
private filter;
private updateJSONFile;
private update;
private validateSchema;
private updateNumberValues;
private updateArrayValues;
}
export {};
Loading

0 comments on commit 2274314

Please sign in to comment.