Skip to content

Commit 3226f76

Browse files
JaviRpodanielsogl
authored andcommitted
feat(web-intent): Add missing type info (#2878)
1 parent 874be0b commit 3226f76

File tree

1 file changed

+27
-6
lines changed
  • src/@ionic-native/plugins/web-intent

1 file changed

+27
-6
lines changed

src/@ionic-native/plugins/web-intent/index.ts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ import {
77
} from '@ionic-native/core';
88
import { Observable } from 'rxjs/Observable';
99

10+
export interface IntentClipItem {
11+
uri: string;
12+
type?: string;
13+
extension?: string;
14+
}
15+
16+
export interface Intent {
17+
action: string;
18+
clipItems: IntentClipItem[];
19+
component: string;
20+
extras: object;
21+
flags: number;
22+
type: string;
23+
}
24+
25+
export interface RegisterBroadcastReceiverOptions {
26+
filterActions?: string[];
27+
filterCategories?: string[];
28+
filterDataSchemes?: string[];
29+
}
30+
1031
export interface IntentOptions {
1132
requestCode?: number;
1233
type?: string;
@@ -192,12 +213,12 @@ export class WebIntent extends IonicNativePlugin {
192213

193214
/**
194215
* Returns the content of the intent used whenever the application activity is launched
195-
* @returns {Observable<string>}
216+
* @returns {Observable<Intent>}
196217
*/
197218
@Cordova({
198219
observable: true
199220
})
200-
onIntent(): Observable<string> {
221+
onIntent(): Observable<Intent> {
201222
return;
202223
}
203224

@@ -223,13 +244,13 @@ export class WebIntent extends IonicNativePlugin {
223244

224245
/**
225246
* Registers a broadcast receiver for the specified filters
226-
* @param filters {any}
247+
* @param filters {RegisterBroadcastReceiverOptions}
227248
* @returns {Observable<any>}
228249
*/
229250
@Cordova({
230251
observable: true
231252
})
232-
registerBroadcastReceiver(filters: any): Observable<any> {
253+
registerBroadcastReceiver(filters: RegisterBroadcastReceiverOptions): Observable<any> {
233254
return;
234255
}
235256

@@ -240,10 +261,10 @@ export class WebIntent extends IonicNativePlugin {
240261
unregisterBroadcastReceiver(): void {}
241262

242263
/**
243-
* @returns {Promise<any>}
264+
* @returns {Promise<Intent>}
244265
*/
245266
@Cordova()
246-
getIntent(): Promise<any> {
267+
getIntent(): Promise<Intent> {
247268
return;
248269
}
249270

0 commit comments

Comments
 (0)