
const EmitterOptionsSchema = {
  type: "object",
  additionalProperties: false,
  properties: {
    "target-name": { type: "string", nullable: true, description: "The name of the target to emit to." },
    "is-valid": { type: "boolean", nullable: true, description: "Whether the target is valid." },
    "type": { type: "string", nullable: true, enum: ["a", "b", "c"] },
    "options": {
      type: "object",
      properties: {
        "propA": { 
          allOf:[{maximum: 3}, {type: "integer"}]},
        "propB": { 
          anyOf:[
            { type: "boolean" },
            { type: "string", enum: ["valueB1", "valueB2"] }
          ]},
        "propC": { 
          oneOf:[
            { type: "object", properties: { "propC-one": { type: "boolean" } } },
            { type: "object", properties: { "propC-two": { type: "string", enum: ["valueC1", "valueC2"] } } }
          ]},
      },
      additionalProperties:{
        type: "object",
        properties: {
          "addProp": { type: "boolean" }
        }
      }
    },
    "options-b": {
      type: "object",
      additionalProperties: {
        oneOf: [
          { type: "string" },
          { type: "boolean" }
        ]
      }
    },
    "options-arr-obj": {
      type: "array",
      items: {
        type: "object",
        properties: {
          "arr-propA": { 
            type: "object",
            properties: {
              "arr-propA-one": {type: "boolean"},
              "arr-propA-two": {type: "string", enum: ["valueA1", "valueA2"]}
            }
          },
          "arr-propB": {type: "boolean"}
        }
      }
    },
    "options-arr-boolean": {
      type: "array",
      items:{
        type: "boolean"
      }
    }
  },
  required: ["target-name","type"],
};

export const $lib = {
  emitter: {
    options: EmitterOptionsSchema,
  },
};

export async function $onEmit(context) {
}
