mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add types for react-native-dialogflow * Fix lint issues. * Formatting changes. * Lint again.
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import * as React from 'react';
|
|
import { View } from 'react-native';
|
|
import {
|
|
Dialogflow,
|
|
Dialogflow_V2,
|
|
} from 'react-native-dialogflow';
|
|
|
|
const accessToken = 'accessToken';
|
|
const eventName = 'event';
|
|
const eventData = {};
|
|
const query = '';
|
|
const serviceAccount = '_@_.iam.gserviceaccount.com';
|
|
const privateKey = '-----BEGIN PRIVATE KEY-----\n_\n-----END PRIVATE KEY-----';
|
|
const projectId = 'projectId';
|
|
|
|
class Screen1 extends React.Component<any> {
|
|
componentDidMount() {
|
|
Dialogflow.setConfiguration(accessToken, Dialogflow.LANG_ENGLISH);
|
|
Dialogflow.setEntities([]);
|
|
Dialogflow.startListening(() => {}, () => {});
|
|
Dialogflow.finishListening();
|
|
Dialogflow.requestEvent(eventName, eventData, () => {}, () => {});
|
|
Dialogflow.requestQuery(query, () => {}, () => {});
|
|
Dialogflow.onListeningStarted(() => {});
|
|
Dialogflow.onListeningFinished(() => {});
|
|
Dialogflow.onAudioLevel(() => {});
|
|
Dialogflow.setContexts([]);
|
|
Dialogflow.resetContexts(() => {}, () => {});
|
|
Dialogflow.setPermanentContexts([]);
|
|
|
|
Dialogflow_V2.setConfiguration(serviceAccount, privateKey, Dialogflow_V2.LANG_ENGLISH, projectId);
|
|
Dialogflow_V2.startListening(() => {}, () => {});
|
|
Dialogflow_V2.finishListening();
|
|
Dialogflow_V2.requestEvent(eventName, eventData, () => {}, () => {});
|
|
Dialogflow_V2.requestQuery(query, () => {}, () => {});
|
|
Dialogflow_V2.onListeningStarted(() => {});
|
|
Dialogflow_V2.onListeningFinished(() => {});
|
|
Dialogflow_V2.onAudioLevel(() => {});
|
|
Dialogflow_V2.setContexts([]);
|
|
Dialogflow_V2.resetContexts(() => {}, () => {});
|
|
Dialogflow_V2.setPermanentContexts([]);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<View />
|
|
);
|
|
}
|
|
}
|