UNPKG

3 kBTypeScriptView Raw
1/**
2 * Copyright 2018 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import * as Api from '../../api/v2';
17import { Helper } from './helper';
18/**
19 * @public
20 * @deprecated
21 */
22export interface DeepLinkOptions {
23 /**
24 * The name of the link destination.
25 * @public
26 */
27 destination: string;
28 /**
29 * URL of Android deep link.
30 * @public
31 */
32 url: string;
33 /**
34 * Android app package name to which to link.
35 * @public
36 */
37 package: string;
38 /**
39 * The reason to transfer the user. This may be appended to a Google-specified prompt.
40 * @public
41 */
42 reason?: string;
43}
44/**
45 * @public
46 * @deprecated
47 */
48export declare type DeepLinkArgument = undefined;
49/**
50 * Requests the user to transfer to a linked out Android app intent. Using this feature
51 * requires verifying the linked app in the [Actions console](https://console.actions.google.com).
52 *
53 * This feature is deprecated. Access will be by request only.
54 *
55 * @deprecated Access will be by request only
56 *
57 * @example
58 * ```javascript
59 *
60 * // Actions SDK
61 * const app = actionssdk()
62 *
63 * app.intent('actions.intent.MAIN', conv => {
64 * conv.ask('Great! Looks like we can do that in the app.')
65 * conv.ask(new DeepLink({
66 * destination: 'Google',
67 * url: 'example://gizmos',
68 * package: 'com.example.gizmos',
69 * reason: 'handle this for you',
70 * }))
71 * })
72 *
73 * app.intent('actions.intent.LINK', (conv, input, arg, status) => {
74 * // possibly do something with status
75 * conv.close('Okay maybe we can take care of that another time.')
76 * })
77 *
78 * // Dialogflow
79 * const app = dialogflow()
80 *
81 * app.intent('Default Welcome Intent', conv => {
82 * conv.ask('Great! Looks like we can do that in the app.')
83 * conv.ask(new DeepLink({
84 * destination: 'Google',
85 * url: 'example://gizmos',
86 * package: 'com.example.gizmos',
87 * reason: 'handle this for you',
88 * }))
89 * })
90 *
91 * // Create a Dialogflow intent with the `actions_intent_LINK` event
92 * app.intent('Get Link Status', (conv, input, arg, status) => {
93 * // possibly do something with status
94 * conv.close('Okay maybe we can take care of that another time.')
95 * })
96 * ```
97 *
98 * @public
99 */
100export declare class DeepLink extends Helper<'actions.intent.LINK', Api.GoogleActionsV2LinkValueSpec> {
101 /**
102 * @param options DeepLink options
103 * @deprecated
104 * @public
105 */
106 constructor(options: DeepLinkOptions);
107}