UNPKG

@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) 630 B
/** * @packageDocumentation * @module Options.Mixins */ import type { OptionsToCombine } from '../option-details'; /** * Adds an `optionDetils` field declaration to class being applied to, * which should hold an {@link OptionsToCombine} object inside. */ export function WithOptionsToCombine<T extends new (...args: any[]) => any>( Base: T ): T & { new (...args: any[]): { optionDetails: OptionsToCombine; }; } { return class OptionDetails extends Base { /** * Where options are applied 'Option Details' is used to capture this information. */ public optionDetails!: OptionsToCombine; }; }