@guardian/prosemirror-typerighter › Globals › MatcherService
A matcher service to manage the interaction between the prosemirror-typerighter plugin and the remote matching service.
▪ TMatch: IMatch
- MatcherService
+ new MatcherService(store
: Store‹TMatch›, commands
: Commands, adapter
: IMatcherAdapter‹TMatch›, initialThrottle
: number): MatcherService
Defined in services/MatcherService.ts:20
Parameters:
Name | Type | Default |
---|---|---|
store |
Store‹TMatch› | - |
commands |
Commands | - |
adapter |
IMatcherAdapter‹TMatch› | - |
initialThrottle |
number | 2000 |
Returns: MatcherService
▸ addCategory(categoryId
: string): void
Defined in services/MatcherService.ts:47
Parameters:
Name | Type |
---|---|
categoryId |
string |
Returns: void
▸ fetchCategories(): Promise‹ICategory[]›
Defined in services/MatcherService.ts:40
Get all of the available categories from the matcher service.
Returns: Promise‹ICategory[]›
▸ fetchMatches(requestId
: string, blocks
: IBlock[]): Promise‹void›
Defined in services/MatcherService.ts:64
Fetch matches for a set of blocks.
Parameters:
Name | Type |
---|---|
requestId |
string |
blocks |
IBlock[] |
Returns: Promise‹void›
▸ getCurrentCategories(): ICategory[]
Defined in services/MatcherService.ts:45
Returns: ICategory[]
▸ removeCategory(categoryId
: string): void
Defined in services/MatcherService.ts:55
Parameters:
Name | Type |
---|---|
categoryId |
string |
Returns: void
▸ requestFetchMatches(): unknown
Defined in services/MatcherService.ts:79
Request a fetch for matches. If we already have a request in flight, defer it until the next throttle window.
Returns: unknown