Interface KosCompanionDecorator<TParent>

Interface for models using

Kos Companion

in decorator mode (default). Use TypeScript interface merging to add full parent transparency to your model class.

Example

interface BrandCompanionModelImpl extends KosCompanionDecorator<AvailabilityModel> {}

@kosCompanion() // defaults to decorator mode
class BrandCompanionModelImpl implements IKosDataModel {
// All parent properties are available directly
get brandSpecificProperty() {
return this.name; // 'name' from parent AvailabilityModel
}
}
interface KosCompanionDecorator<TParent> {
    getCompanionParent(): TParent;
}

Type Parameters

  • TParent extends IKosDataModel = IKosDataModel

Hierarchy (view full)

Methods

  • Gets the companion's parent model instance. Available in both decorator and composition modes. Provides access to the model this companion extends.

    Returns TParent

    The parent model instance that this companion enhances