From d7c878fd8e600b58c175107391651f556c3237f8 Mon Sep 17 00:00:00 2001 From: Enes Date: Thu, 23 May 2024 01:26:20 +0300 Subject: [PATCH] documentation fixes --- app/weivdata.d.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/weivdata.d.ts b/app/weivdata.d.ts index b5112cba..40bb1d86 100644 --- a/app/weivdata.d.ts +++ b/app/weivdata.d.ts @@ -1841,21 +1841,24 @@ 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; * } * ``` * @@ -1863,10 +1866,13 @@ declare module '@exweiv/weiv-data' { * * @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 { /** @@ -1875,7 +1881,7 @@ 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; /** * @description @@ -1883,7 +1889,7 @@ declare module '@exweiv/weiv-data' { * * [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; /** * @description @@ -1891,7 +1897,7 @@ declare module '@exweiv/weiv-data' { * * [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; /** * @description @@ -1899,7 +1905,7 @@ declare module '@exweiv/weiv-data' { * * [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; } } } \ No newline at end of file