Skip to content

Commit 06291d6

Browse files
committed
chore: add effect outputs
1 parent 545c0d3 commit 06291d6

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

types/effects.d.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ interface EffectScope<EffectModel> extends ng.IScope {
33
[x: string]: unknown;
44
}
55

6-
type EffectTriggerResponse = {
6+
export type EffectOutput<Outputs = Record<string, unknown>> = {
7+
label: string;
8+
description: string;
9+
defaultName: keyof Outputs;
10+
};
11+
12+
type EffectTriggerResponse<Outputs = Record<string, unknown>> = {
713
success: boolean;
8-
//outputs: Record<string, unknown>;
14+
outputs?: Outputs;
915
execution?: {
1016
stop: boolean;
1117
bubbleStop: boolean;
@@ -79,7 +85,11 @@ export namespace Effects {
7985
[x: string]: unknown;
8086
};
8187

82-
type EffectType<EffectModel, OverlayData = unknown> = {
88+
type EffectType<
89+
EffectModel,
90+
OverlayData = unknown,
91+
Outputs = Record<string, unknown>
92+
> = {
8393
definition: {
8494
id: string;
8595
name: string;
@@ -88,6 +98,7 @@ export namespace Effects {
8898
categories: EffectCategory[];
8999
triggers?: TriggerType[] | TriggersObject;
90100
dependencies?: Array<"chat">;
101+
outputs?: EffectOutput<Outputs>[];
91102
};
92103
optionsTemplate: string;
93104
optionsController?: (
@@ -102,7 +113,7 @@ export namespace Effects {
102113
data: OverlayData,
103114
overlayInstance?: string
104115
) => void;
105-
}) => Promise<void | boolean | EffectTriggerResponse>;
116+
}) => Promise<void | boolean | EffectTriggerResponse<Outputs>>;
106117
overlayExtension?: {
107118
dependencies?: {
108119
globalStyles?: string;

0 commit comments

Comments
 (0)