@equinor/fusion-framework-module-bookmark 1.2.13 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +242 -9
- package/dist/esm/BookmarkClient.interface.js +2 -0
- package/dist/esm/BookmarkClient.interface.js.map +1 -0
- package/dist/esm/BookmarkClient.js +174 -0
- package/dist/esm/BookmarkClient.js.map +1 -0
- package/dist/esm/BookmarkConfigurator.js +348 -0
- package/dist/esm/BookmarkConfigurator.js.map +1 -0
- package/dist/esm/BookmarkProvider.actions.js +60 -0
- package/dist/esm/BookmarkProvider.actions.js.map +1 -0
- package/dist/esm/BookmarkProvider.error.js +14 -0
- package/dist/esm/BookmarkProvider.error.js.map +1 -0
- package/dist/esm/BookmarkProvider.events.js +2 -0
- package/dist/esm/BookmarkProvider.events.js.map +1 -0
- package/dist/esm/BookmarkProvider.flows.js +219 -0
- package/dist/esm/BookmarkProvider.flows.js.map +1 -0
- package/dist/esm/BookmarkProvider.js +937 -0
- package/dist/esm/BookmarkProvider.js.map +1 -0
- package/dist/esm/BookmarkProvider.reducer.js +125 -0
- package/dist/esm/BookmarkProvider.reducer.js.map +1 -0
- package/dist/esm/BookmarkProvider.selectors.js +43 -0
- package/dist/esm/BookmarkProvider.selectors.js.map +1 -0
- package/dist/esm/BookmarkProvider.store.js +19 -0
- package/dist/esm/BookmarkProvider.store.js.map +1 -0
- package/dist/esm/bookmark-config.schema.js +30 -0
- package/dist/esm/bookmark-config.schema.js.map +1 -0
- package/dist/esm/bookmark-module.js +53 -0
- package/dist/esm/bookmark-module.js.map +1 -0
- package/dist/esm/bookmark.schemas.js +38 -0
- package/dist/esm/bookmark.schemas.js.map +1 -0
- package/dist/esm/enable-bookmark.js +20 -7
- package/dist/esm/enable-bookmark.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/BookmarkClient.d.ts +42 -0
- package/dist/types/BookmarkClient.interface.d.ts +139 -0
- package/dist/types/BookmarkConfigurator.d.ts +100 -0
- package/dist/types/BookmarkProvider.actions.d.ts +525 -0
- package/dist/types/BookmarkProvider.d.ts +462 -0
- package/dist/types/BookmarkProvider.error.d.ts +9 -0
- package/dist/types/BookmarkProvider.events.d.ts +78 -0
- package/dist/types/BookmarkProvider.flows.d.ts +79 -0
- package/dist/types/BookmarkProvider.reducer.d.ts +302 -0
- package/dist/types/BookmarkProvider.selectors.d.ts +34 -0
- package/dist/types/BookmarkProvider.store.d.ts +30 -0
- package/dist/types/bookmark-config.schema.d.ts +118 -0
- package/dist/types/{module.d.ts → bookmark-module.d.ts} +3 -3
- package/dist/types/bookmark.schemas.d.ts +760 -0
- package/dist/types/enable-bookmark.d.ts +7 -6
- package/dist/types/index.d.ts +4 -3
- package/dist/types/types.d.ts +29 -65
- package/dist/types/version.d.ts +1 -1
- package/package.json +11 -5
- package/src/BookmarkClient.interface.ts +157 -0
- package/src/BookmarkClient.ts +226 -0
- package/src/BookmarkConfigurator.ts +374 -0
- package/src/BookmarkProvider.actions.ts +131 -0
- package/src/BookmarkProvider.error.ts +21 -0
- package/src/BookmarkProvider.events.ts +89 -0
- package/src/BookmarkProvider.flows.ts +426 -0
- package/src/BookmarkProvider.reducer.ts +141 -0
- package/src/BookmarkProvider.selectors.ts +55 -0
- package/src/BookmarkProvider.store.ts +52 -0
- package/src/BookmarkProvider.ts +1308 -0
- package/src/bookmark-config.schema.ts +41 -0
- package/src/bookmark-module.ts +70 -0
- package/src/bookmark.schemas.ts +50 -0
- package/src/enable-bookmark.ts +13 -20
- package/src/index.ts +15 -7
- package/src/types.ts +46 -73
- package/src/version.ts +1 -1
- package/dist/esm/bookmark-config-builder.js +0 -131
- package/dist/esm/bookmark-config-builder.js.map +0 -1
- package/dist/esm/bookmark-provider.js +0 -155
- package/dist/esm/bookmark-provider.js.map +0 -1
- package/dist/esm/client/bookmarkActions.js +0 -10
- package/dist/esm/client/bookmarkActions.js.map +0 -1
- package/dist/esm/client/bookmarkClient.js +0 -259
- package/dist/esm/client/bookmarkClient.js.map +0 -1
- package/dist/esm/client/bookmarkFlows.js +0 -31
- package/dist/esm/client/bookmarkFlows.js.map +0 -1
- package/dist/esm/client/bookmarkReducer.js +0 -29
- package/dist/esm/client/bookmarkReducer.js.map +0 -1
- package/dist/esm/configurator.js +0 -155
- package/dist/esm/configurator.js.map +0 -1
- package/dist/esm/module.js +0 -27
- package/dist/esm/module.js.map +0 -1
- package/dist/esm/utils/handle-url.js +0 -11
- package/dist/esm/utils/handle-url.js.map +0 -1
- package/dist/esm/utils/index.js +0 -2
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/types/bookmark-config-builder.d.ts +0 -85
- package/dist/types/bookmark-provider.d.ts +0 -169
- package/dist/types/client/bookmarkActions.d.ts +0 -27
- package/dist/types/client/bookmarkClient.d.ts +0 -53
- package/dist/types/client/bookmarkFlows.d.ts +0 -22
- package/dist/types/client/bookmarkReducer.d.ts +0 -5
- package/dist/types/configurator.d.ts +0 -75
- package/dist/types/utils/handle-url.d.ts +0 -2
- package/dist/types/utils/index.d.ts +0 -1
- package/src/bookmark-config-builder.ts +0 -177
- package/src/bookmark-provider.ts +0 -344
- package/src/client/bookmarkActions.ts +0 -44
- package/src/client/bookmarkClient.ts +0 -327
- package/src/client/bookmarkFlows.ts +0 -67
- package/src/client/bookmarkReducer.ts +0 -35
- package/src/configurator.ts +0 -235
- package/src/module.ts +0 -40
- package/src/utils/handle-url.ts +0 -13
- package/src/utils/index.ts +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ObservableInput } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Imports the `BookmarksApiClient` and `ApiBookmarkEntityV1` types from the `@equinor/fusion-framework-module-services/bookmarks` package.
|
|
4
|
+
* These types are used to interact with the Fusion Bookmarks API and represent the API response entities.
|
|
5
|
+
*/
|
|
6
|
+
import type { BookmarksApiClient } from '@equinor/fusion-framework-module-services/bookmarks';
|
|
7
|
+
import type { IBookmarkClient, BookmarksFilter, BookmarkNew, BookmarkUpdate } from './BookmarkClient.interface';
|
|
8
|
+
import type { Bookmark, BookmarkData, BookmarkWithoutData } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Represents a client for interacting with the Fusion Bookmarks API.
|
|
11
|
+
* This class provides methods for retrieving, creating, updating, and deleting bookmarks, as well as managing favorites.
|
|
12
|
+
*
|
|
13
|
+
* This implementation consumes the `@equinor/fusion-framework-module-services/bookmarks` package.
|
|
14
|
+
* This is the default implementation of the bookmarks API client.
|
|
15
|
+
*
|
|
16
|
+
* This class is intended to be used by the Fusion framework with the Fusion Core Services (Backend)
|
|
17
|
+
*
|
|
18
|
+
* Fetching single and all bookmarks will use Query from '@equinor/fusion-query' to cache the results.
|
|
19
|
+
*
|
|
20
|
+
* @note if you wish to implement your own bookmarks API client, you can do so by implementing the {@link IBookmarkClient} interface.
|
|
21
|
+
*/
|
|
22
|
+
export declare class BookmarkClient implements IBookmarkClient {
|
|
23
|
+
#private;
|
|
24
|
+
/**
|
|
25
|
+
* Constructs a new `BookmarkClient` instance with the provided `BookmarksApiClient`.
|
|
26
|
+
*
|
|
27
|
+
* @param api - The `BookmarksApiClient` instance to use for making API requests.
|
|
28
|
+
*/
|
|
29
|
+
constructor(api: BookmarksApiClient<'json$'>, options?: {
|
|
30
|
+
expire?: number;
|
|
31
|
+
});
|
|
32
|
+
getAllBookmarks(filter?: BookmarksFilter): ObservableInput<Bookmark[]>;
|
|
33
|
+
getBookmarkById(bookmarkId: string): ObservableInput<BookmarkWithoutData>;
|
|
34
|
+
getBookmarkData<T extends BookmarkData>(bookmarkId: string): ObservableInput<T>;
|
|
35
|
+
setBookmarkData<T extends BookmarkData | null>(bookmarkId: string, data: T): ObservableInput<T>;
|
|
36
|
+
createBookmark<T extends BookmarkData>(newBookmark: BookmarkNew<T>): ObservableInput<Bookmark<T>>;
|
|
37
|
+
updateBookmark<T extends BookmarkData>(bookmarkId: string, updates: BookmarkUpdate<T>): ObservableInput<Bookmark<T>>;
|
|
38
|
+
deleteBookmark(bookmarkId: string): ObservableInput<boolean>;
|
|
39
|
+
addBookmarkToFavorites(bookmarkId: string): ObservableInput<boolean>;
|
|
40
|
+
removeBookmarkFromFavorites(bookmarkId: string): ObservableInput<boolean>;
|
|
41
|
+
isBookmarkFavorite(bookmarkId: string): ObservableInput<boolean>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type ObservableInput } from 'rxjs';
|
|
2
|
+
import type { Bookmark, BookmarkData, BookmarkWithoutData } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the shape of a filter for querying bookmarks.
|
|
5
|
+
* @property {string} [appKey] - The app key to filter bookmarks by.
|
|
6
|
+
* @property {string} [contextId] - The context ID to filter bookmarks by.
|
|
7
|
+
* @property {object} [sourceSystem] - The source system to filter bookmarks by.
|
|
8
|
+
* @property {string} [sourceSystem.identifier] - The identifier of the source system.
|
|
9
|
+
* @property {string} [sourceSystem.name] - The name of the source system.
|
|
10
|
+
* @property {string} [sourceSystem.subSystem] - The sub-system of the source system.
|
|
11
|
+
*/
|
|
12
|
+
export type BookmarksFilter = {
|
|
13
|
+
appKey?: string;
|
|
14
|
+
contextId?: string;
|
|
15
|
+
sourceSystem?: {
|
|
16
|
+
identifier?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
subSystem?: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Defines the shape of an update to an existing bookmark.
|
|
23
|
+
* @template T - The type of the payload data for the bookmark.
|
|
24
|
+
* @property {string} [name] - The updated name of the bookmark.
|
|
25
|
+
* @property {string} [description] - The updated description of the bookmark.
|
|
26
|
+
* @property {boolean} [isShared] - Whether the bookmark is shared or not.
|
|
27
|
+
* @property {T} [payload] - The updated payload data for the bookmark.
|
|
28
|
+
*/
|
|
29
|
+
export type BookmarkUpdate<T extends BookmarkData = BookmarkData> = {
|
|
30
|
+
name?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
isShared?: boolean;
|
|
33
|
+
payload?: T | null;
|
|
34
|
+
sourceSystem?: {
|
|
35
|
+
identifier: string;
|
|
36
|
+
name?: string | null;
|
|
37
|
+
subSystem?: string | null;
|
|
38
|
+
} | null;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Defines the shape of a new bookmark to be created.
|
|
42
|
+
* @template T - The type of the payload data for the bookmark.
|
|
43
|
+
* @property {string} name - The name of the bookmark.
|
|
44
|
+
* @property {string} appKey - The app key associated with the bookmark.
|
|
45
|
+
* @property {string} [description] - The description of the bookmark.
|
|
46
|
+
* @property {boolean} [isShared] - Whether the bookmark is shared or not.
|
|
47
|
+
* @property {string} [contextId] - The context ID associated with the bookmark.
|
|
48
|
+
* @property {object} [sourceSystem] - Information about the source system of the bookmark.
|
|
49
|
+
* @property {string} [sourceSystem.identifier] - The identifier of the source system.
|
|
50
|
+
* @property {string} [sourceSystem.name] - The name of the source system.
|
|
51
|
+
* @property {string} [sourceSystem.subSystem] - The sub-system of the source system.
|
|
52
|
+
* @property {T} [payload] - The payload data for the bookmark.
|
|
53
|
+
*/
|
|
54
|
+
export type BookmarkNew<T extends BookmarkData = BookmarkData> = {
|
|
55
|
+
name: string;
|
|
56
|
+
appKey: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
isShared?: boolean;
|
|
59
|
+
contextId?: string;
|
|
60
|
+
sourceSystem?: {
|
|
61
|
+
identifier: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
subSystem?: string;
|
|
64
|
+
};
|
|
65
|
+
payload?: T;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Defines the interface for a Bookmarks client, which provides methods for managing bookmarks.
|
|
69
|
+
*/
|
|
70
|
+
export interface IBookmarkClient {
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves all bookmarks for the current user.
|
|
73
|
+
* @template TPayload - The type of the payload data for the bookmarks.
|
|
74
|
+
* @param args - Optional arguments to filter or customize the bookmark retrieval.
|
|
75
|
+
* @returns An observable input containing an array of bookmarks.
|
|
76
|
+
*/
|
|
77
|
+
getAllBookmarks: (filter?: BookmarksFilter) => ObservableInput<Array<Bookmark>>;
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves a single bookmark by id.
|
|
80
|
+
* @template TPayload - The type of the payload data for the bookmark.
|
|
81
|
+
* @param bookmarkId - The id of the bookmark to retrieve.
|
|
82
|
+
* @returns An observable input containing the requested bookmark.
|
|
83
|
+
*/
|
|
84
|
+
getBookmarkById: (bookmarkId: string) => ObservableInput<BookmarkWithoutData>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves the bookmark data for the specified bookmark ID.
|
|
87
|
+
*
|
|
88
|
+
* @param bookmarkId - The ID of the bookmark to retrieve data for.
|
|
89
|
+
* @returns An observable that emits the bookmark data.
|
|
90
|
+
*/
|
|
91
|
+
getBookmarkData: <T extends BookmarkData>(bookmarkId: string) => ObservableInput<T>;
|
|
92
|
+
/**
|
|
93
|
+
* Updates the data associated with a bookmark.
|
|
94
|
+
*
|
|
95
|
+
* @template T - The type of the data to be associated with the bookmark. Can be a record or null.
|
|
96
|
+
* @param bookmarkId - The ID of the bookmark to update.
|
|
97
|
+
* @param data - The new data to be associated with the bookmark.
|
|
98
|
+
* @returns An observable that emits the updated data.
|
|
99
|
+
*/
|
|
100
|
+
setBookmarkData<T extends BookmarkData | null>(bookmarkId: string, data: T): ObservableInput<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Adds a bookmark to the current user's favorites.
|
|
103
|
+
* @param bookmarkId - The id of the bookmark to add to favorites.
|
|
104
|
+
* @returns An observable input containing a boolean indicating whether the operation was successful.
|
|
105
|
+
*/
|
|
106
|
+
addBookmarkToFavorites: (bookmarkId: string) => ObservableInput<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* Removes a bookmark from the current user's favorites.
|
|
109
|
+
* @param bookmarkId - The id of the bookmark to remove from favorites.
|
|
110
|
+
* @returns An observable input containing a boolean indicating whether the operation was successful.
|
|
111
|
+
*/
|
|
112
|
+
removeBookmarkFromFavorites: (bookmarkId: string) => ObservableInput<boolean>;
|
|
113
|
+
/**
|
|
114
|
+
* Verifies whether a bookmark is a favorite of the current user.
|
|
115
|
+
* @param bookmarkId - The id of the bookmark to verify.
|
|
116
|
+
* @returns An observable input containing a boolean indicating whether the bookmark is a favorite.
|
|
117
|
+
*/
|
|
118
|
+
isBookmarkFavorite: (bookmarkId: string) => ObservableInput<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Creates a new bookmark.
|
|
121
|
+
* @template TPayload - The type of the payload data for the bookmark.
|
|
122
|
+
* @param bookmark - The bookmark data to create.
|
|
123
|
+
* @returns An observable input containing the created bookmark.
|
|
124
|
+
*/
|
|
125
|
+
createBookmark: <T extends BookmarkData>(bookmark: BookmarkNew<T>) => ObservableInput<Bookmark<T>>;
|
|
126
|
+
/**
|
|
127
|
+
* Updates an existing bookmark.
|
|
128
|
+
* @template TPayload - The type of the payload data for the bookmark.
|
|
129
|
+
* @param bookmark - The bookmark data to update.
|
|
130
|
+
* @returns An observable input containing the updated bookmark.
|
|
131
|
+
*/
|
|
132
|
+
updateBookmark: <T extends BookmarkData>(bookmarkId: string, updates: BookmarkUpdate<T>) => ObservableInput<Bookmark<T>>;
|
|
133
|
+
/**
|
|
134
|
+
* Deletes a bookmark by id.
|
|
135
|
+
* @param bookmarkId - The id of the bookmark to delete.
|
|
136
|
+
* @returns An observable input containing a boolean indicating whether the operation was successful.
|
|
137
|
+
*/
|
|
138
|
+
deleteBookmark: (bookmarkId: string) => ObservableInput<boolean>;
|
|
139
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BaseConfigBuilder, type ConfigBuilderCallback, type ConfigBuilderCallbackArgs, type ModulesInstanceType } from '@equinor/fusion-framework-module';
|
|
2
|
+
import type { AppModuleProvider } from '@equinor/fusion-framework-module-app';
|
|
3
|
+
import { type ILogger, LogLevel } from '@equinor/fusion-log';
|
|
4
|
+
import type { BookmarkModule } from './bookmark-module';
|
|
5
|
+
import type { BookmarkModuleConfig } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Configurator for the bookmark module.
|
|
8
|
+
* This class provides a set of methods for configuring the bookmark module.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BookmarkModuleConfigurator extends BaseConfigBuilder<BookmarkModuleConfig> {
|
|
11
|
+
#private;
|
|
12
|
+
defaultExpireTime: number;
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
log?: ILogger;
|
|
15
|
+
ref?: ModulesInstanceType<[BookmarkModule]>;
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Sets the log level for the bookmark configurator.
|
|
19
|
+
*
|
|
20
|
+
* @param level - The log level to set. Allowed values are:
|
|
21
|
+
* - 0: No logging
|
|
22
|
+
* - 1: Error messages only
|
|
23
|
+
* - 2: Error and warning messages
|
|
24
|
+
* - 3: Error, warning, and info messages
|
|
25
|
+
* - 4: Error, warning, info, and debug messages
|
|
26
|
+
*/
|
|
27
|
+
setLogLevel(level: LogLevel): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the client for interacting with bookmark operations.
|
|
30
|
+
* The client argument can be either a client object with predefined methods for bookmark operations or a callback function that creates and returns such a client object.
|
|
31
|
+
* This method enables the configuration of how the bookmark module interacts with the backend or any other service to perform operations such as getting, creating, or updating bookmarks.
|
|
32
|
+
*
|
|
33
|
+
* @param client A client object or a callback function that returns a client object.
|
|
34
|
+
* - If a callback function is provided, it receives an initializer function as its argument,
|
|
35
|
+
* and it should return a Promise that resolves to a client object.
|
|
36
|
+
* - If a client object is provided directly, it is wrapped in a Promise and used as-is.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link BookmarkModuleConfig.client}
|
|
39
|
+
*/
|
|
40
|
+
setClient(client: ConfigBuilderCallback<BookmarkModuleConfig['client']> | BookmarkModuleConfig['client']): void;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the parent configuration for the bookmark module.
|
|
43
|
+
* This allows the bookmark module to inherit configuration from a parent module.
|
|
44
|
+
*
|
|
45
|
+
* @param parent - A callback function or a configuration object that provides the parent configuration.
|
|
46
|
+
* - If a callback function is provided, it receives an initializer function as its argument and should return a Promise that resolves to the parent configuration object.
|
|
47
|
+
* - If a configuration object is provided directly, it is wrapped in a Promise and used as-is.
|
|
48
|
+
*/
|
|
49
|
+
setParent(parent: ConfigBuilderCallback<BookmarkModuleConfig['parent']> | BookmarkModuleConfig['parent']): void;
|
|
50
|
+
/**
|
|
51
|
+
* Set the source system for the bookmark module.
|
|
52
|
+
* This is used to tag bookmarks with their originating system for filtering or categorization purposes.
|
|
53
|
+
* @param sourceSystem - A callback function that returns the source system or a string value of the source system.
|
|
54
|
+
*
|
|
55
|
+
* Example:
|
|
56
|
+
* ```
|
|
57
|
+
* configurator.setSourceSystem('MyApplication');
|
|
58
|
+
* ```
|
|
59
|
+
* or
|
|
60
|
+
* ```
|
|
61
|
+
* configurator.setSourceSystem((init) => 'MyApplication');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
setSourceSystem(sourceSystem: ConfigBuilderCallback<BookmarkModuleConfig['sourceSystem']> | BookmarkModuleConfig['sourceSystem']): void;
|
|
65
|
+
/**
|
|
66
|
+
* Set the context ID resolver for the bookmark module.
|
|
67
|
+
* This function is used to resolve the context ID dynamically, allowing for context-aware bookmark operations.
|
|
68
|
+
* @param cb - A callback function that returns the context ID resolver function.
|
|
69
|
+
*
|
|
70
|
+
* Example:
|
|
71
|
+
* ```
|
|
72
|
+
* configurator.setContextIdResolver((init) => () => 'currentContextId');
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
setContextResolver(cb: ConfigBuilderCallback<BookmarkModuleConfig['resolve']['context']>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Set the application key resolver for the bookmark module.
|
|
78
|
+
* This function is used to resolve the application key dynamically, providing a way to associate bookmarks with specific applications.
|
|
79
|
+
* @param cb - A callback function that returns the application key resolver function.
|
|
80
|
+
*
|
|
81
|
+
* Example:
|
|
82
|
+
* ```
|
|
83
|
+
* configurator.setApplicationKeyResolver((init) => () => 'myApplicationKey');
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
setApplicationResolver(cb: ConfigBuilderCallback<BookmarkModuleConfig['resolve']['application']>): void;
|
|
87
|
+
/**
|
|
88
|
+
* Sets a filter for the bookmark module.
|
|
89
|
+
* @param key - The key of the filter to set.
|
|
90
|
+
* @param value - The value to set for the filter.
|
|
91
|
+
*
|
|
92
|
+
* Applied when fetching bookmarks
|
|
93
|
+
* - application: Only return bookmarks for the resolved application.
|
|
94
|
+
* - context: Only return bookmarks for the resolved context.
|
|
95
|
+
*/
|
|
96
|
+
setFilter<TKey extends keyof BookmarkModuleConfig['filters']>(key: TKey, value: BookmarkModuleConfig['filters'][TKey]): void;
|
|
97
|
+
protected _resolveAppProvider(init: ConfigBuilderCallbackArgs): Promise<AppModuleProvider | undefined>;
|
|
98
|
+
protected _processConfig(config: Partial<BookmarkModuleConfig>, _init: ConfigBuilderCallbackArgs): Promise<BookmarkModuleConfig>;
|
|
99
|
+
}
|
|
100
|
+
export default BookmarkModuleConfigurator;
|