Skip to content

Commit

Permalink
documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
loeiks committed May 22, 2024
1 parent c723927 commit d7c878f
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions app/weivdata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1841,32 +1841,38 @@ declare module '@exweiv/weiv-data' {
namespace ConnectionOptionsJS {
/**
* @description
* Inside the `backend/WeivData/connection-options.js` file you can define three different variable and export them.
* These variables can be used to customize each role's MongoClient connection options like connection pool settings etc.
* Inside the `backend/WeivData/connection-options.js` file you can define three different factory function and export them.
* These factory functions can be used to customize each role's MongoClient connection options like connection pool settings etc.
*
* @example
* ```js
* export const adminClientOptions = {
* export const adminClientOptions = () => {
* // ... custom admin options here
* return;
* }
*
* export const memberClientOptions = {
* export const memberClientOptions = () => {
* // ... custom member options here
* return;
* }
*
* export const visitorClientOptions = {
* export const visitorClientOptions = () => {
* // ... custom visitor options here
* return;
* }
* ```
*
* You can also define custom cache options for all clients. These cache options define how to cache these clients. In most cases you don't need to play with this.
*
* @example
* ```js
* export const clientCacheRules = {
* export const clientCacheRules = () => {
* // ... custom client cache rules
* return;
* }
* ```
*
* > You can create async functions too (in case you need to fetch something before setting up things).
*/
interface Options {
/**
Expand All @@ -1875,31 +1881,31 @@ declare module '@exweiv/weiv-data' {
*
* [Read more about MongoClientOptions](https://mongodb.github.io/node-mongodb-native/6.5/interfaces/MongoClientOptions.html)
*/
adminClientOptions: import('mongodb').MongoClientOptions;
adminClientOptions: () => import('mongodb').MongoClientOptions | Promise<import('mongodb').MongoClientOptions>;

/**
* @description
* This is the same MongoClientOptions just like in MongoDB NodeJS driver, you can customize the member MongoClient options.
*
* [Read more about MongoClientOptions](https://mongodb.github.io/node-mongodb-native/6.5/interfaces/MongoClientOptions.html)
*/
memberClientOptions: import('mongodb').MongoClientOptions;
memberClientOptions: () => import('mongodb').MongoClientOptions | Promise<import('mongodb').MongoClientOptions>;

/**
* @description
* This is the same MongoClientOptions just like in MongoDB NodeJS driver, you can customize the visitor MongoClient options.
*
* [Read more about MongoClientOptions](https://mongodb.github.io/node-mongodb-native/6.5/interfaces/MongoClientOptions.html)
*/
visitorClientOptions: import('mongodb').MongoClientOptions;
visitorClientOptions: () => import('mongodb').MongoClientOptions | Promise<import('mongodb').MongoClientOptions>;

/**
* @description
* This is general cache rules for all MongoClients you can define `node-cache` options here. These options will apply to all roles clients.
*
* [Read more about NodeCache.Options](https://github.com/node-cache/node-cache/blob/master/index.d.ts#L149)
*/
clientCacheRules: import('node-cache').Options;
clientCacheRules: () => import('node-cache').Options | Promise<import('node-cache').Options>;
}
}
}

0 comments on commit d7c878f

Please sign in to comment.