diff options
Diffstat (limited to 'packages/bun-inspector-protocol/src/protocol/schema.d.ts')
-rw-r--r-- | packages/bun-inspector-protocol/src/protocol/schema.d.ts | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/packages/bun-inspector-protocol/src/protocol/schema.d.ts b/packages/bun-inspector-protocol/src/protocol/schema.d.ts new file mode 100644 index 000000000..a92bea546 --- /dev/null +++ b/packages/bun-inspector-protocol/src/protocol/schema.d.ts @@ -0,0 +1,58 @@ +// Represents the schema of the protocol.json file. + +export type Protocol = { + readonly name: string; + readonly version: { + readonly major: number; + readonly minor: number; + }; + readonly domains: readonly Domain[]; +}; + +export type Domain = { + readonly domain: string; + readonly dependencies?: readonly string[]; + readonly types: readonly Property[]; + readonly commands?: readonly Command[]; + readonly events?: readonly Event[]; +}; + +export type Command = { + readonly name: string; + readonly description?: string; + readonly parameters?: readonly Property[]; + readonly returns?: readonly Property[]; +}; + +export type Event = { + readonly name: string; + readonly description?: string; + readonly parameters: readonly Property[]; +}; + +export type Property = { + readonly id?: string; + readonly name?: string; + readonly description?: string; + readonly optional?: boolean; +} & ( + | { + readonly type: "array"; + readonly items?: Property; + } + | { + readonly type: "object"; + readonly properties?: readonly Property[]; + } + | { + readonly type: "string"; + readonly enum?: readonly string[]; + } + | { + readonly type: "boolean" | "number" | "integer"; + } + | { + readonly type: undefined; + readonly $ref: string; + } +); |