1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import * as Api from '../api/v2';
|
17 |
|
18 | export declare type SurfaceCapability = 'actions.capability.AUDIO_OUTPUT' | 'actions.capability.SCREEN_OUTPUT' | 'actions.capability.MEDIA_RESPONSE_AUDIO' | 'actions.capability.WEB_BROWSER' | 'actions.capability.INTERACTIVE_CANVAS';
|
19 | export declare class Surface {
|
20 |
|
21 | capabilities: Capabilities;
|
22 |
|
23 | constructor(surface?: Api.GoogleActionsV2Surface);
|
24 | /**
|
25 | * Checks if surface has an attribute like a capability
|
26 | *
|
27 | * @example
|
28 | * ```javascript
|
29 | *
|
30 | * app.intent('Default Welcome Intent', conv => {
|
31 | * if (conv.surface.has('actions.capability.AUDIO_OUTPUT')) {
|
32 | * conv.ask('You can hear me! How are you?')
|
33 | * } else {
|
34 | * conv.ask('You can read this! How are you?')
|
35 | * }
|
36 | * })
|
37 | * ```
|
38 | *
|
39 | * @param attribute An attribute like SurfaceCapability
|
40 | * @public
|
41 | */
|
42 | has(attribute: SurfaceCapability): boolean;
|
43 | }
|
44 | export declare class Capabilities {
|
45 | |
46 |
|
47 |
|
48 |
|
49 | list: Api.GoogleActionsV2Capability[];
|
50 |
|
51 | constructor(list?: Api.GoogleActionsV2Capability[]);
|
52 | /**
|
53 | * Returns true if user device has a given surface capability.
|
54 | * @public
|
55 | */
|
56 | has(capability: SurfaceCapability): boolean;
|
57 | }
|
58 | export declare class AvailableSurfacesCapabilities {
|
59 |
|
60 | surfaces: Surface[];
|
61 |
|
62 | constructor(surfaces: Surface[]);
|
63 | /**
|
64 | * Returns true if user has an available surface which includes all given
|
65 | * capabilities. Available surfaces capabilities may exist on surfaces other
|
66 | * than that used for an ongoing conversation.
|
67 | * @public
|
68 | */
|
69 | has(capability: SurfaceCapability): boolean;
|
70 | }
|
71 | export declare class AvailableSurfaces {
|
72 |
|
73 | list: Surface[];
|
74 |
|
75 | capabilities: AvailableSurfacesCapabilities;
|
76 |
|
77 | constructor(list: Api.GoogleActionsV2Surface[]);
|
78 | /**
|
79 | * Checks if available surfaces has an attribute like a capability
|
80 | *
|
81 | * @example
|
82 | * ```javascript
|
83 | *
|
84 | * app.intent('Default Welcome Intent', conv => {
|
85 | * if (conv.available.surfaces.has('actions.capability.SCREEN_OUTPUT')) {
|
86 | * conv.ask('You have a device that can view images! How are you?')
|
87 | * } else {
|
88 | * conv.ask('You do not have a device that can view images! How are you?')
|
89 | * }
|
90 | * })
|
91 | * ```
|
92 | *
|
93 | * @param attribute An attribute like SurfaceCapability
|
94 | * @public
|
95 | */
|
96 | has(attribute: SurfaceCapability): boolean;
|
97 | }
|
98 | export declare class Available {
|
99 |
|
100 | surfaces: AvailableSurfaces;
|
101 |
|
102 | constructor(surfaces?: Api.GoogleActionsV2Surface[]);
|
103 | }
|