Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jsdoc types def #11

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 _ = "";
Loading