@monterosa/sdk-interact-kit 2.0.0-rc.1 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/connection_health/index.d.ts +7 -1
- package/dist/core/connection_health/public-types.d.ts +1 -1
- package/dist/core/element/api.d.ts +51 -30
- package/dist/core/element/public-types.d.ts +37 -26
- package/dist/core/element/types.d.ts +11 -11
- package/dist/core/event/api.d.ts +43 -35
- package/dist/core/event/public-types.d.ts +25 -21
- package/dist/core/project/api.d.ts +12 -12
- package/dist/core/project/public-types.d.ts +10 -8
- package/dist/index.cjs +2095 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -6
- package/dist/{index.esm.js → index.js} +126 -128
- package/dist/index.js.map +1 -0
- package/package.json +22 -20
- package/dist/api.d.ts +0 -36
- package/dist/index.cjs.js +0 -2961
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
|
@@ -10,18 +10,18 @@ import { Emitter } from '@monterosa/sdk-util';
|
|
|
10
10
|
import { EventHistory } from './types';
|
|
11
11
|
import { EventContext } from './context';
|
|
12
12
|
/**
|
|
13
|
-
* Describes the
|
|
13
|
+
* Describes the Event state.
|
|
14
14
|
*/
|
|
15
15
|
export declare enum EventState {
|
|
16
16
|
/**
|
|
17
|
-
* The
|
|
18
|
-
* less than the {@link now | current time}.
|
|
17
|
+
* The Event is in the `upcoming` state when its {@link InteractEvent | startAt}
|
|
18
|
+
* less than the {@link @monterosa/sdk-util#now | current time}.
|
|
19
19
|
*/
|
|
20
20
|
Upcoming = "upcoming",
|
|
21
21
|
/**
|
|
22
|
-
* The
|
|
23
|
-
* equal or more than the {@link now | current time} and less than the
|
|
24
|
-
* {@link InteractEvent
|
|
22
|
+
* The Event is in the `active` state when its {@link InteractEvent | startAt}
|
|
23
|
+
* equal or more than the {@link @monterosa/sdk-util#now | current time} and less than the
|
|
24
|
+
* {@link InteractEvent | endAt}.
|
|
25
25
|
*/
|
|
26
26
|
Active = "active",
|
|
27
27
|
/**
|
|
@@ -29,8 +29,8 @@ export declare enum EventState {
|
|
|
29
29
|
*/
|
|
30
30
|
Prolonged = "prolonged",
|
|
31
31
|
/**
|
|
32
|
-
* The
|
|
33
|
-
* equal or more than the {@link now | current time}.
|
|
32
|
+
* The Event is in the `finished` state when its {@link InteractEvent | endAt}
|
|
33
|
+
* equal or more than the {@link @monterosa/sdk-util#now | current time}.
|
|
34
34
|
*/
|
|
35
35
|
Finished = "finished"
|
|
36
36
|
}
|
|
@@ -40,15 +40,19 @@ export declare enum InitState {
|
|
|
40
40
|
Initialised = "initialised"
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Represents an Event, a time-bound period of
|
|
44
|
+
* interactivity. Obtain via {@link getEvent} or
|
|
45
|
+
* {@link getEvents}.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Events represent a sports game, TV show, or any period of time in which you
|
|
49
|
+
* want to push interactivity to users. Each Event has a duration, start time,
|
|
50
|
+
* start mode, and
|
|
50
51
|
* {@link https://products.monterosa.co/mic/developer-guides/app-spec/event-settings-spec | custom fields}
|
|
51
|
-
* that can be
|
|
52
|
+
* that can be configured by developers.
|
|
53
|
+
*
|
|
54
|
+
* See {@link https://products.monterosa.co/mic/core-concepts/schedule-and-events | Events} in
|
|
55
|
+
* the platform documentation for more details.
|
|
52
56
|
*/
|
|
53
57
|
export interface InteractEvent extends Emitter {
|
|
54
58
|
/**
|
|
@@ -60,23 +64,23 @@ export interface InteractEvent extends Emitter {
|
|
|
60
64
|
*/
|
|
61
65
|
name: string;
|
|
62
66
|
/**
|
|
63
|
-
* Returns the
|
|
67
|
+
* Returns the Event start time as UNIX time in seconds.
|
|
64
68
|
*/
|
|
65
69
|
startAt: number;
|
|
66
70
|
/**
|
|
67
|
-
* Returns the
|
|
71
|
+
* Returns the Event start time as ISO string.
|
|
68
72
|
*/
|
|
69
73
|
startAtIso: string;
|
|
70
74
|
/**
|
|
71
|
-
* Returns the
|
|
75
|
+
* Returns the Event end time as UNIX time in seconds.
|
|
72
76
|
*/
|
|
73
77
|
endAt: number;
|
|
74
78
|
/**
|
|
75
|
-
* Returns the
|
|
79
|
+
* Returns the Event end time as ISO string.
|
|
76
80
|
*/
|
|
77
81
|
endAtIso: string;
|
|
78
82
|
/**
|
|
79
|
-
* Studio supports custom fields within Event. This returns an object
|
|
83
|
+
* Studio supports custom fields within an Event. This returns an object
|
|
80
84
|
* populated with the custom fields. Object property names will match keys
|
|
81
85
|
* as provided as part of custom fields definition in the feed and values
|
|
82
86
|
* will be as collected by Studio.
|
|
@@ -97,7 +101,7 @@ export interface InteractEvent extends Emitter {
|
|
|
97
101
|
*/
|
|
98
102
|
state: EventState;
|
|
99
103
|
/**
|
|
100
|
-
* Returns the total duration in seconds of the
|
|
104
|
+
* Returns the total duration in seconds of the Event.
|
|
101
105
|
*/
|
|
102
106
|
duration: number;
|
|
103
107
|
/** @internal */
|
|
@@ -14,20 +14,20 @@ import { InteractProject } from './public-types';
|
|
|
14
14
|
*/
|
|
15
15
|
declare const getProjectMemoized: (...args: any[]) => Promise<InteractProject>;
|
|
16
16
|
/**
|
|
17
|
-
* Returns {@link InteractProject |
|
|
18
|
-
* with the
|
|
17
|
+
* Returns {@link InteractProject | Project instance} associated
|
|
18
|
+
* with the
|
|
19
|
+
* {@link @monterosa/sdk-core#MonterosaSdk | configured SDK}
|
|
20
|
+
*
|
|
21
|
+
* @param sdk - The SDK instance. Defaults to the default SDK.
|
|
22
|
+
* @returns The Project instance.
|
|
19
23
|
*/
|
|
20
24
|
declare function getProject(sdk?: MonterosaSdk): Promise<InteractProject>;
|
|
21
25
|
/**
|
|
22
|
-
* Adds an observer for when
|
|
23
|
-
* are updated
|
|
24
|
-
*/
|
|
25
|
-
declare function onProjectFieldsUpdated(project: InteractProject, callback: () => void): Unsubscribe;
|
|
26
|
-
/**
|
|
27
|
-
* Adds an observer that is called when the project listings are updated.
|
|
26
|
+
* Adds an observer for when
|
|
27
|
+
* {@link InteractProject | Project fields} are updated
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
29
|
+
* @param project - The Project to observe
|
|
30
|
+
* @param callback - Called when Project fields change
|
|
31
31
|
*/
|
|
32
|
-
declare function
|
|
33
|
-
export { getProject, getProjectMemoized, onProjectFieldsUpdated
|
|
32
|
+
declare function onProjectFieldsUpdated(project: InteractProject, callback: () => void): Unsubscribe;
|
|
33
|
+
export { getProject, getProjectMemoized, onProjectFieldsUpdated };
|
|
@@ -11,19 +11,21 @@ import { MonterosaKit } from '@monterosa/sdk-core';
|
|
|
11
11
|
import { ProjectContext } from './context';
|
|
12
12
|
import { EventOptions } from '../event/types';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* that holds all of its information.
|
|
14
|
+
* Represents a Project, a container for configuration,
|
|
15
|
+
* theming, and Events. Obtain via {@link getProject}.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Every Project in Studio has an id, host, embedUrl, and a set of fields
|
|
19
19
|
* associated with an
|
|
20
20
|
* {@link https://products.monterosa.co/mic/developer-guides/whats-an-app | App}.
|
|
21
|
-
* Project fields
|
|
21
|
+
* Project fields are
|
|
22
22
|
* {@link https://products.monterosa.co/mic/producer-guide/studio/app-setup | configuration options}
|
|
23
|
-
*
|
|
23
|
+
* created by the
|
|
24
24
|
* {@link https://products.monterosa.co/mic/developer-guides/app-spec/project-settings-spec | app developer}
|
|
25
25
|
* and vary from App to App.
|
|
26
26
|
*
|
|
27
|
+
* See {@link https://products.monterosa.co/mic/core-concepts | Projects} in
|
|
28
|
+
* the platform documentation for more details.
|
|
27
29
|
*/
|
|
28
30
|
export interface InteractProject extends MonterosaKit, Emitter {
|
|
29
31
|
/**
|
|
@@ -39,7 +41,7 @@ export interface InteractProject extends MonterosaKit, Emitter {
|
|
|
39
41
|
*/
|
|
40
42
|
embedUrl: string;
|
|
41
43
|
/**
|
|
42
|
-
* Returns `true` if the
|
|
44
|
+
* Returns `true` if the Project supports localisation.
|
|
43
45
|
*/
|
|
44
46
|
isLocalisationSupported: boolean;
|
|
45
47
|
/**
|
|
@@ -51,7 +53,7 @@ export interface InteractProject extends MonterosaKit, Emitter {
|
|
|
51
53
|
*/
|
|
52
54
|
locale: string;
|
|
53
55
|
/**
|
|
54
|
-
* Monterosa / Interaction Cloud supports custom fields within Project.
|
|
56
|
+
* Monterosa / Interaction Cloud supports custom fields within a Project.
|
|
55
57
|
* This returns an object populated with the custom fields. Object property
|
|
56
58
|
* names will match keys as provided as part of custom fields definition in
|
|
57
59
|
* the feed and values will be as collected by Studio.
|