@ts4ocds/options
Version:
TS4OCDS is a library of TypeScript entities that takes an approach to befriend large OCDS JSONs with your per-project routine of writing whole lotta interfaces for them.
26 lines (23 loc) • 610 B
text/typescript
/**
* @packageDocumentation
* @module Options.Mixins
*/
import type { OptionGroups } from '../option-details';
/**
* Adds an `optionDetils` field declaration to class being applied to,
* which should hold an {@link OptionGroups} object inside.
*/
export function WithOptionGroups<T extends new (...args: any[]) => any>(
Base: T
): T & {
new (...args: any[]): {
optionDetails: OptionGroups;
};
} {
return class OptionDetails extends Base {
/**
* Where options are applied 'Option Details' is used to capture this information.
*/
public optionDetails!: OptionGroups;
};
}