# types/emitter.types.ts

> 61 lines of code and 12 definitions.

Tree: GovLab Quality
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/quality#file-quality-types-emitter-types-ts
Source text: https://banes-lab.com/source/quality/types/emitter.types.ts.txt

Listed in [types](https://banes-lab.com/api/source/quality/types.md), after [types/edit.types.ts](https://banes-lab.com/source/quality/types/edit.types.ts.md) and before [types/eslint.types.ts](https://banes-lab.com/source/quality/types/eslint.types.ts.md).

## Definitions

- `EmitFormat` (type_alias_declaration, line 1, exported)
- `ConfigValue` (type_alias_declaration, line 3, exported)
- `EmitFile` (interface_declaration, line 5, exported)
- `XmlElement` (interface_declaration, line 10, exported)
- `EmitIdiom` (type_alias_declaration, line 17)
- `EmitDescriptor` (interface_declaration, line 19, exported)
- `DescriptorFile` (interface_declaration, line 43, exported)
- `EmitTokenEntry` (interface_declaration, line 49)
- `EmitTokens` (type_alias_declaration, line 54, exported)
- `ActiveConcept` (interface_declaration, line 56, exported)
- `EmitInput` (interface_declaration, line 63, exported)
- `ConfigFormatter` (interface_declaration, line 69, exported)

## Contained in

- [types](https://banes-lab.com/anatomy/quality/folder-quality-types.md)

## Source

```typescript
export type EmitFormat = "ini" | "js-record" | "toml" | "xml" | "yaml";

export type ConfigValue = ConfigValue[] | boolean | number | string | { [key: string]: ConfigValue } | null;

export interface EmitFile {
    path: string;
    content: string;
}

export interface XmlElement {
    tag: string;
    attrs?: Record<string, string> | undefined;
    children?: XmlElement[] | undefined;
    text?: string | undefined;
}

type EmitIdiom = "central" | "per-rule" | "rules-container";

export interface EmitDescriptor {
    tool: string;
    idiom: EmitIdiom;
    format: EmitFormat;
    configTarget: string;
    selectContainer: string | null;
    settingsContainer: string | null;
    preamble?: Record<string, ConfigValue>;
    knobCase?: "kebab";
    knobSection?: Record<string, string>;
    ruleContainer?: string;
    argumentsKey?: string;
    xmlWrap?: { tag: string; attrs?: Record<string, string> }[];
    xmlRuleTag?: string;
    xmlNameAttr?: string;
    xmlPropsWrap?: string | null;
    xmlRefPrefix?: string;
    xmlDescription?: string;
    xmlDoctype?: string;
    ignoreContainer?: string | null;
    enableKey?: string | null;
    compoundSplit?: string;
}

export interface DescriptorFile {
    descriptors: EmitDescriptor[];
    pluginParent: Record<string, string>;
    deferred: { tool: string; reason: string }[];
}

interface EmitTokenEntry {
    ruleIds: string[];
    knob: string | null;
}

export type EmitTokens = Record<string, Record<string, EmitTokenEntry>>;

export interface ActiveConcept {
    canonicalId: string;
    ruleIds: string[];
    knob: string | null;
    value?: ConfigValue;
}

export interface EmitInput {
    descriptor: EmitDescriptor;
    concepts: ActiveConcept[];
    ignore: string[];
}

export interface ConfigFormatter {
    format: EmitFormat;
    render: (input: EmitInput) => string;
}
```
