UNPKG

@ts4ocds/lots

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) 658 B
/** * @packageDocumentation * @module Lots.Mixins */ import type { Lot } from '../lot'; /** * Adds a `relatedLots` field declaration to class being applied to. * Holds an array of {@link Lot.id | lots' identifiers}. */ export function WithRelatedLots<T extends new (...args: any[]) => any>( Base: T ): T & { new (...args: any[]): { relatedLots?: Array<Lot['id']>; }; } { return class RelatedLots extends Base { /** * If this entity relates to one or more specific {@link Lot | lots}, provide the {@link Lot.id | identifier(s)} of the related {@link Lot | lot(s)} here. */ public relatedLots?: Array<Lot['id']>; }; }