package controlplane

// ComponentBuildContext is the base set of capabilities every component build
// handler can rely on.
type ComponentBuildContext interface {
	PackName() string
	LookupObjectSchema(string) (ComponentObjectSchema, bool)
	AddManagedComponent(ComponentBuildManagedComponent) error
	AddRuntimeStartupShallowDeclaration(ComponentKind, string, []byte) error
}

// PresentationComponentBuildContext extends ComponentBuildContext with the
// presentation-family component sinks. Handlers type-assert a
// ComponentBuildContext to this interface when they need a presentation sink.
type PresentationComponentBuildContext interface {
	ComponentBuildContext

	AddRelatedListRuleComponent(ComponentBuildRequest, []RelatedListRule) error
	AddPageLayoutComponent(ComponentBuildRequest, PageLayoutDeclaration) error
	AddLayoutAssignmentComponent(ComponentBuildRequest, []LayoutAssignmentDeclaration) error
	AddReportTypeComponent(ComponentBuildRequest, []ReportTypeDeclaration) error
	AddUIActionComponent(ComponentBuildRequest, []UIActionDeclaration) error
	AddSearchScopeOrderComponent(ComponentBuildRequest, []SearchScopeOrderItem) error
	AddSearchAllDefaultFieldsComponent(ComponentBuildRequest, []SearchAllDefaultFieldsDeclaration) error
	AddHrefRewriteFieldsComponent(ComponentBuildRequest, []HrefRewriteField) error
}
