Both standard components (e.g. table, tr, td, dl, dd) and web components (e.g. tab-panels, tab-panel) have implicit constraints on what elements are allowed as children, and also what are allowed as parents.
I would propose that a slot description should also include a way to codify this.
For example:
export interface Slot {
/**
* The slot name, or the empty string for an unnamed slot.
*/
name: string;
/**
* A markdown summary suitable for display in a listing.
*/
summary?: string;
/**
* A markdown description.
*/
description?: string;
/**
* A set of CSS selectors for allowable children
*/
allowedChildren?: string[];
}
Both standard components (e.g.
table,tr,td,dl,dd) and web components (e.g.tab-panels,tab-panel) have implicit constraints on what elements are allowed as children, and also what are allowed as parents.I would propose that a slot description should also include a way to codify this.
For example: