Skip to content

Commit

Permalink
fix: jsdoc types def (#11)
Browse files Browse the repository at this point in the history
* fix: jsdoc types def

* fix: typo
  • Loading branch information
Diegiwg authored Jul 13, 2024
1 parent 8212454 commit 26ddf2a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
15 changes: 7 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { MycroDatabase } from "./core/MycroDatabase.js";

// STORAGES
import { JsonStorage } from "./storage/json.js";
import { MemoryStorage } from "./storage/memory.js";
import { TypedJsonStorage } from "./storage/typedJson.js";

export { JsonStorage, MemoryStorage, MycroDatabase, TypedJsonStorage };
import { MycroDatabase } from "./core/MycroDatabase.js";

import { JsonStorage } from "./storage/json.js";
import { MemoryStorage } from "./storage/memory.js";
import { TypedJsonStorage } from "./storage/typedJson.js";

export { JsonStorage, MemoryStorage, MycroDatabase, TypedJsonStorage };
50 changes: 25 additions & 25 deletions lib/types.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/**
* @typedef {object} StoragePlugin
* @property {Function?} count - The count function.
* @property {Function?} create - The create function.
* @property {Function?} get - The get function.
* @property {Function?} insert - The insert function.
* @property {Function?} query - The query function.
* @property {Function} read - The read function.
* @property {Function?} remove - The remove function.
* @property {Function?} sync - The sync function.
* @property {Function?} update - The update function.
* @property {Function} write - The write function.
*/

/**
* @template Model The type of the documents in the collection.
*
* Represents a collection of documents.
* @typedef {object} CollectionRef
* @property {string} identifier The identifier for the collection.
* @property {StoragePlugin} storage The storage object for the collection.
* @property {{id: number, documents: Object<string, Model>}} memory The memory object for the collection.
*/

export const _ = "";
/**
* @typedef StoragePlugin
* @property {Function?} count - The count function.
* @property {Function?} create - The create function.
* @property {Function?} get - The get function.
* @property {Function?} insert - The insert function.
* @property {Function?} query - The query function.
* @property {Function} read - The read function.
* @property {Function?} remove - The remove function.
* @property {Function?} sync - The sync function.
* @property {Function?} update - The update function.
* @property {Function} write - The write function.
*/

/**
* @template Model The type of the documents in the collection
*
* Represents a collection of documents
* @typedef CollectionRef
* @property {string} identifier The identifier for the collection.
* @property {StoragePlugin} storage The storage object for the collection.
* @property {{id: number, documents: Object<string, Model>}} memory The memory object for the collection.
*/

export const _ = "";

0 comments on commit 26ddf2a

Please sign in to comment.