-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathadlibActionContext.ts
More file actions
57 lines (50 loc) · 2.87 KB
/
Copy pathadlibActionContext.ts
File metadata and controls
57 lines (50 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { DatastorePersistenceMode, Time } from '../common.js'
import type { IEventContext } from './index.js'
import type { IShowStyleUserContext } from './showStyleContext.js'
import { IPartAndPieceActionContext } from './partsAndPieceActionContext.js'
import { IExecuteTSRActionsContext } from './executeTsrActionContext.js'
import { IBlueprintPart, IBlueprintPartInstance, IBlueprintPiece } from '../index.js'
import { IRouteSetMethods } from './routeSetContext.js'
/** Actions */
export interface IDataStoreMethods {
/**
* Setting a value in the datastore allows us to overwrite parts of a timeline content object with that value
* @param key Key to use when referencing from the timeline object
* @param value Value to overwrite the timeline object's content with
* @param mode In temporary mode the value may be removed when the key is no longer on the timeline
*/
setTimelineDatastoreValue(key: string, value: any, mode: DatastorePersistenceMode): Promise<void>
/** Deletes a previously set value from the datastore */
removeTimelineDatastoreValue(key: string): Promise<void>
}
export interface IDataStoreActionExecutionContext extends IDataStoreMethods, IShowStyleUserContext, IEventContext {}
export interface IActionExecutionContext
extends IShowStyleUserContext,
IEventContext,
IDataStoreMethods,
IPartAndPieceActionContext,
IExecuteTSRActionsContext,
IRouteSetMethods {
/** Fetch the showstyle config for the specified part */
// getNextShowStyleConfig(): Readonly<{ [key: string]: ConfigItemValue }>
/** Move the next part through the rundown. Can move by either a number of parts, or segments in either direction. */
moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickloop?: boolean): Promise<void>
/** Set flag to perform take after executing the current action. Returns state of the flag after each call. */
takeAfterExecuteAction(take: boolean): Promise<boolean>
/** Inform core that a take out of the current partinstance should be blocked until the specified time */
blockTakeUntil(time: Time | null): Promise<void>
/** Insert a queued part to follow the current part */
queuePart(part: IBlueprintPart, pieces: IBlueprintPiece[]): Promise<IBlueprintPartInstance>
/** Insert a queued part to follow the taken part */
queuePartAfterTake(part: IBlueprintPart, pieces: IBlueprintPiece[]): void
/**
* Reject the action request with an error message.
* This will cause the API to return a 400 error response.
* @param message Error message to return to the client
*/
rejectRequest(message: string): void
/** Misc actions */
// updateAction(newManifest: Pick<IBlueprintAdLibActionManifest, 'description' | 'payload'>): void // only updates itself. to allow for the next one to do something different
// executePeripheralDeviceAction(deviceId: string, functionName: string, args: any[]): Promise<any>
// openUIDialogue(message: string) // ?????
}