1
+ import type { ContextTimed } from '@matrixai/contexts' ;
2
+ import type { JSONValue } from '@matrixai/rpc' ;
1
3
import type {
2
4
ClientRPCRequestParams ,
3
5
ClientRPCResponseResult ,
@@ -8,11 +10,11 @@ import type { IdentityId, ProviderId } from '../../ids';
8
10
import type IdentitiesManager from '../../identities/IdentitiesManager' ;
9
11
import type { IdentityData } from '../../identities/types' ;
10
12
import { ServerHandler } from '@matrixai/rpc' ;
13
+ import { validateSync } from '../../validation' ;
14
+ import { matchSync } from '../../utils' ;
11
15
import * as ids from '../../ids' ;
12
16
import * as identitiesErrors from '../../identities/errors' ;
13
17
import * as identitiesUtils from '../../identities/utils' ;
14
- import { validateSync } from '../../validation' ;
15
- import { matchSync } from '../../utils' ;
16
18
17
19
class IdentitiesInfoGet extends ServerHandler <
18
20
{
@@ -23,9 +25,9 @@ class IdentitiesInfoGet extends ServerHandler<
23
25
> {
24
26
public handle = async function * (
25
27
input : ClientRPCRequestParams < ProviderSearchMessage > ,
26
- _cancel ,
27
- _meta ,
28
- ctx ,
28
+ _cancel : ( reason ?: any ) => void ,
29
+ _meta : Record < string , JSONValue > ,
30
+ ctx : ContextTimed ,
29
31
) : AsyncGenerator < ClientRPCResponseResult < IdentityInfoMessage > > {
30
32
if ( ctx . signal . aborted ) throw ctx . signal . reason ;
31
33
const { identitiesManager } : { identitiesManager : IdentitiesManager } =
@@ -86,7 +88,7 @@ class IdentitiesInfoGet extends ServerHandler<
86
88
input . limit = identities . length ;
87
89
}
88
90
for ( let i = 0 ; i < input . limit ; i ++ ) {
89
- if ( ctx . signal . aborted ) throw ctx . signal . reason ;
91
+ ctx . signal . throwIfAborted ( ) ;
90
92
const identity = identities [ i ] ;
91
93
if ( identity !== undefined ) {
92
94
if ( identitiesUtils . matchIdentityData ( identity , searchTerms ) ) {
0 commit comments