Returns <NewFields extends Fields, R2, R3>(
fields: NewFields,
options: {
decode: (
input: {
_tag: "dxos.org/plugin/intent/action/track";
input: { error?: string; intents: readonly string[] };
output: void;
},
options: ParseOptions,
ast: Transformation,
) => Effect<
{
[K in string
| number
| symbol]: (
{
_tag: "dxos.org/plugin/intent/action/track";
input: { error?: string; intents: readonly string[] };
output: void;
} & {} & {
readonly [K in string
| number
| symbol as Key<NewFields, K>]: Encoded<NewFields[K]>
} & {
readonly [K in string
| number
| symbol as Key<NewFields, K>]?: Encoded<(...)[(...)]>
}
)[K]
},
ParseIssue,
R2,
>;
encode: (
input: {
[K in string | number | symbol]: (
{
_tag: "dxos.org/plugin/intent/action/track";
input: { error?: string; intents: readonly string[] };
output: void;
} & {} & {
readonly [K in string
| number
| symbol as Key<NewFields, K>]: Encoded<NewFields[K]>
} & {
readonly [K in string
| number
| symbol as Key<NewFields, K>]?: Encoded<NewFields[K]>
}
)[K]
},
options: ParseOptions,
ast: Transformation,
) => Effect<
Encoded<
{ _tag: tag<"dxos.org/plugin/intent/action/track"> } & {
input: Struct<
{
error: optional<typeof String$>;
intents: Array$<typeof String$>;
},
>;
output: typeof Void;
},
>,
ParseIssue,
R3,
>;
},
annotations?: ClassAnnotations<
Transformed,
{
[K in string
| number
| symbol]: Type<
{ _tag: tag<"dxos.org/plugin/intent/action/track"> } & {
input: Struct<{ error: optional<(...)>; intents: Array$<(...)> }>;
output: typeof Void;
} & NewFields,
>[K]
},
>,
) => [Transformed] extends [never]
? "Missing `Self` generic - use `class Self extends Base.transformOrFailFrom<Self>()({ ... })`"
: Class<
Transformed,
{ _tag: tag<"dxos.org/plugin/intent/action/track"> } & {
input: Struct<
{ error: optional<typeof String$>; intents: Array$<typeof String$> },
>;
output: typeof Void;
} & NewFields,
Encoded<
{ _tag: tag<"dxos.org/plugin/intent/action/track"> } & {
input: Struct<
{ error: optional<typeof String$>; intents: Array$<typeof String$> },
>;
output: typeof Void;
},
>,
R2
| R3
| Context<NewFields[keyof NewFields]>,
{ input: { error?: string; intents: readonly string[] } } & {
output: void;
} & Constructor<NewFields>,
Track,
{},
>
Log an intent.