2021-02-28 02:07:45 +01:00
|
|
|
import type ItemMerger from './debug/ItemMerger';
|
2021-02-27 18:45:14 +01:00
|
|
|
|
|
|
|
interface Debug {
|
2021-02-28 02:18:47 +01:00
|
|
|
/**
|
|
|
|
* If set to true, all items will be shown as relevant.
|
|
|
|
*/
|
|
|
|
readonly showAll?: boolean;
|
2021-02-27 18:45:14 +01:00
|
|
|
/**
|
|
|
|
* If this is set, the debug UI will group items and display a merged item.
|
|
|
|
*/
|
|
|
|
readonly itemMerger?: ItemMerger;
|
|
|
|
}
|
2021-02-21 13:23:31 +01:00
|
|
|
|
|
|
|
export default interface TransformDescriptor {
|
|
|
|
readonly requireColumns: string[];
|
|
|
|
readonly consumesGlobels: string[];
|
|
|
|
readonly producesGlobels: string[];
|
|
|
|
/**
|
|
|
|
* If this is set, the debug UI will group items and display a merged item.
|
|
|
|
*/
|
2021-02-27 18:45:14 +01:00
|
|
|
readonly debug?: Debug;
|
2021-02-21 13:23:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const defaults: TransformDescriptor = {
|
|
|
|
requireColumns: [],
|
|
|
|
consumesGlobels: [],
|
|
|
|
producesGlobels: [],
|
|
|
|
};
|
|
|
|
|
|
|
|
export function toDescriptor(partial: Partial<TransformDescriptor>): TransformDescriptor {
|
|
|
|
return {
|
|
|
|
...defaults,
|
|
|
|
...partial,
|
|
|
|
};
|
|
|
|
}
|