From 27d56d71433e4c11a214134e5d6c816999a3bcf9 Mon Sep 17 00:00:00 2001 From: lik3as Date: Mon, 30 Oct 2023 09:20:55 -0300 Subject: [PATCH] docs: explaining how to use the ScopesOptionsGetter type --- src/scopes/scope-options.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/scopes/scope-options.ts b/src/scopes/scope-options.ts index 5f77a461..6a56be9c 100644 --- a/src/scopes/scope-options.ts +++ b/src/scopes/scope-options.ts @@ -13,5 +13,18 @@ export interface ScopeOptionsGetters { } export type DefaultScopeGetter = () => FindOptions; + +/** + * This is the type that you should use if adding a new set of scopes + * @example + * const myModelScopes: ScopesOptionsGetter = () => ({ + * scopeOne: FindOptions & IncludeOptions { + * return {...} + * }, + * scopeTwo: FindOptions { + * return {...} + * } + * }) + */ export type ScopesOptionsGetter = () => { [sopeName: string]: ScopesOptions }; export type ScopesOptions = FindOptions | ((...args: any[]) => FindOptions);