diff --git a/tracers.ts/src/commander/index.ts b/tracers.ts/src/commander/index.ts index 365fbc1..ff0e4c6 100644 --- a/tracers.ts/src/commander/index.ts +++ b/tracers.ts/src/commander/index.ts @@ -21,6 +21,6 @@ export class Commander { } public output() { - return this.commands; + return JSON.stringify(this.commands); } } diff --git a/tracers.ts/src/tracer/array-tracer.ts b/tracers.ts/src/tracer/array-tracer.ts index f121b53..e7f37ce 100644 --- a/tracers.ts/src/tracer/array-tracer.ts +++ b/tracers.ts/src/tracer/array-tracer.ts @@ -20,7 +20,7 @@ export class ArrayTracer { commander.command({ action: "define", tracer: null, - params: { + payload: { type: "ArrayTracer", id: arrayTracer.tracerId, desc: option.description, @@ -34,7 +34,7 @@ export class ArrayTracer { commander.command({ action: "preset", tracer: this.tracerId, - params: array, + payload: array, }); } @@ -43,7 +43,7 @@ export class ArrayTracer { commander.command({ action: "extend", tracer: this.tracerId, - params: { size }, + payload: { size }, }); } @@ -52,7 +52,7 @@ export class ArrayTracer { commander.command({ action: "shrink", tracer: this.tracerId, - params: { size }, + payload: { size }, }); } @@ -61,7 +61,7 @@ export class ArrayTracer { commander.command({ action: "pick", tracer: this.tracerId, - params: { index }, + payload: { index }, }); } @@ -70,7 +70,7 @@ export class ArrayTracer { commander.command({ action: "drop", tracer: this.tracerId, - params: { index }, + payload: { index }, }); } @@ -79,7 +79,7 @@ export class ArrayTracer { commander.command({ action: "patch", tracer: this.tracerId, - params: { index, value }, + payload: { index, value }, }); } @@ -88,7 +88,7 @@ export class ArrayTracer { commander.command({ action: "reset", tracer: this.tracerId, - params: { index }, + payload: { index }, }); } } diff --git a/tracers.ts/src/types/command/array-tracer-command.ts b/tracers.ts/src/types/command/array-tracer-command.ts index 1662d42..f0a892c 100644 --- a/tracers.ts/src/types/command/array-tracer-command.ts +++ b/tracers.ts/src/types/command/array-tracer-command.ts @@ -1,49 +1,49 @@ export type ArrayTracerDefineCommand = { action: "define"; tracer: null; - params: { type: "ArrayTracer"; id: string; desc?: string }; + payload: { type: "ArrayTracer"; id: string; desc?: string }; }; export type ArrayTracerPresetCommand = { action: "preset"; tracer: string; - params: T[]; + payload: T[]; }; export type ArrayTracerExtendCommand = { action: "extend"; tracer: string; - params: { size: number }; + payload: { size: number }; }; export type ArrayTracerShrinkCommand = { action: "shrink"; tracer: string; - params: { size: number }; + payload: { size: number }; }; export type ArrayTracerPickCommand = { action: "pick"; tracer: string; - params: { index: number }; + payload: { index: number }; }; export type ArrayTracerDropCommand = { action: "drop"; tracer: string; - params: { index: number }; + payload: { index: number }; }; export type ArrayTracerPatchCommand = { action: "patch"; tracer: string; - params: { index: number; value: T }; + payload: { index: number; value: T }; }; export type ArrayTracerResetCommand = { action: "reset"; tracer: string; - params: { index: number }; + payload: { index: number }; }; export type ArrayTracerCommand = diff --git a/tracers.ts/src/types/tracer/index.ts b/tracers.ts/src/types/tracer/index.ts index 5787464..610e992 100644 --- a/tracers.ts/src/types/tracer/index.ts +++ b/tracers.ts/src/types/tracer/index.ts @@ -1,5 +1,5 @@ import type { ArrayTracerDefineCommand } from "../command"; -type ArrayTracer = ArrayTracerDefineCommand["params"]["type"]; +type ArrayTracer = ArrayTracerDefineCommand["payload"]["type"]; export type TracerType = ArrayTracer;