| 2918 | } |
| 2919 | |
| 2920 | private handleRegistrationRequest(params: RegistrationParams): Thenable<void> { |
| 2921 | return new Promise<void>((resolve, reject) => { |
| 2922 | for (let registration of params.registrations) { |
| 2923 | const feature = this._dynamicFeatures.get(registration.method); |
| 2924 | if (!feature) { |
| 2925 | reject(new Error(`No feature implementation for ${registration.method} found. Registration failed.`)); |
| 2926 | return; |
| 2927 | } |
| 2928 | const options = registration.registerOptions || {}; |
| 2929 | options.documentSelector = options.documentSelector || this._clientOptions.documentSelector; |
| 2930 | const data: RegistrationData<any> = { |
| 2931 | id: registration.id, |
| 2932 | registerOptions: options |
| 2933 | } |
| 2934 | feature.register(this._method2Message.get(registration.method)!, data); |
| 2935 | } |
| 2936 | resolve(); |
| 2937 | }); |
| 2938 | } |
| 2939 | |
| 2940 | private handleUnregistrationRequest(params: UnregistrationParams): Thenable<void> { |
| 2941 | return new Promise<void>((resolve, reject) => { |