mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[react-native-incall-manager] New types definition (#37156)
* Add locales property * Add member in definitions by * reverse * RN-incall-manager type definition * Remove public * Fix array declaration * Add static * Fix static, in test do a new * reverse * Class to instance of class
This commit is contained in:
parent
c428e33e5c
commit
8a1b68be3a
68
types/react-native-incall-manager/index.d.ts
vendored
Normal file
68
types/react-native-incall-manager/index.d.ts
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
// Type definitions for react-native-incall-manager 3.2
|
||||
// Project: https://github.com/zxcpoiu/react-native-incall-manager#readme
|
||||
// Definitions by: Carlos Quiroga <https://github.com/KarlosQ>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export interface StartSetup {
|
||||
media?: string;
|
||||
auto?: boolean;
|
||||
ringback?: string;
|
||||
}
|
||||
|
||||
export interface StopSetup {
|
||||
busytone?: string;
|
||||
}
|
||||
|
||||
declare class InCallManager {
|
||||
start(setup?: StartSetup): void;
|
||||
|
||||
stop(setup?: StopSetup): void;
|
||||
|
||||
turnScreenOff(): void;
|
||||
|
||||
turnScreenOn(): void;
|
||||
|
||||
getIsWiredHeadsetPluggedIn(): Promise<any>;
|
||||
|
||||
setFlashOn(enable?: boolean, brightness?: number): number;
|
||||
|
||||
setKeepScreenOn(enable?: boolean): void;
|
||||
|
||||
setSpeakerphoneOn(enable?: boolean): void;
|
||||
|
||||
setForceSpeakerphoneOn(_flag?: boolean): void;
|
||||
|
||||
setMicrophoneMute(enable?: boolean): void;
|
||||
|
||||
startRingtone(
|
||||
ringtone?: string,
|
||||
vibrate_pattern?: any[],
|
||||
ios_category?: string,
|
||||
seconds?: number
|
||||
): void;
|
||||
|
||||
stopRingtone(): void;
|
||||
|
||||
startRingback(ringback?: string): void;
|
||||
|
||||
stopRingback(): void;
|
||||
|
||||
checkRecordPermission(): Promise<string>;
|
||||
|
||||
requestRecordPermission(): Promise<string>;
|
||||
|
||||
checkCameraPermission(): Promise<string>;
|
||||
|
||||
requestCameraPermission(): Promise<string>;
|
||||
|
||||
pokeScreen(_timeout?: number): void;
|
||||
|
||||
getAudioUri(audioType: string, fileType: string): any;
|
||||
|
||||
chooseAudioRoute(route: any): any;
|
||||
}
|
||||
|
||||
declare const _default: InCallManager;
|
||||
|
||||
export default _default;
|
||||
@ -0,0 +1,43 @@
|
||||
import InCallManager from "react-native-incall-manager";
|
||||
|
||||
InCallManager.start({ media: "video" });
|
||||
|
||||
InCallManager.start();
|
||||
|
||||
InCallManager.stop({ busytone: "video" });
|
||||
|
||||
InCallManager.stop();
|
||||
|
||||
InCallManager.turnScreenOn();
|
||||
|
||||
InCallManager.turnScreenOff();
|
||||
|
||||
InCallManager.setKeepScreenOn(true);
|
||||
|
||||
InCallManager.setKeepScreenOn();
|
||||
|
||||
InCallManager.setSpeakerphoneOn();
|
||||
|
||||
InCallManager.setSpeakerphoneOn(true);
|
||||
|
||||
InCallManager.setMicrophoneMute();
|
||||
|
||||
InCallManager.setMicrophoneMute(false);
|
||||
|
||||
InCallManager.checkRecordPermission();
|
||||
|
||||
InCallManager.requestRecordPermission();
|
||||
|
||||
InCallManager.getAudioUri("", "");
|
||||
|
||||
InCallManager.startRingtone();
|
||||
|
||||
InCallManager.startRingtone("", [], "", 0);
|
||||
|
||||
InCallManager.stopRingtone();
|
||||
|
||||
InCallManager.setFlashOn();
|
||||
|
||||
InCallManager.setFlashOn(true, 1);
|
||||
|
||||
InCallManager.getIsWiredHeadsetPluggedIn();
|
||||
23
types/react-native-incall-manager/tsconfig.json
Normal file
23
types/react-native-incall-manager/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-incall-manager-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/react-native-incall-manager/tslint.json
Normal file
1
types/react-native-incall-manager/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user