MCPcopy Create free account
hub / github.com/Effect-TS/effect / Headless

Interface Headless

packages/effect/src/ui/Component.ts:1705–1806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1703 * @since 4.2.0
1704 */
1705export interface Headless<
1706 in out Props,
1707 out Events,
1708 out Parts,
1709 out R = never,
1710 in out Rcv = never,
1711 in Sh = never,
1712 in SV = never,
1713 in Rp = never,
1714 in K = never,
1715 out Model = unknown,
1716 out Msg = unknown,
1717 out L = {}
1718> extends Pipeable.Pipeable {
1719 /**
1720 * Declares a child of this component in a parent's view, from the parent's
1721 * `h`. `view` is the child's whole view, built from its parts. Its
1722 * requirements, the view's and the fallback's surface in the parent's.
1723 * For a provider of shared state, the view's `Shared.Of<typeof Provider>` is
1724 * removed: the readers and senders in it have this provider above them.
1725 */
1726 <Msg, RV = never, RF = never>(
1727 h: View.HelperBase<Msg, unknown>,
1728 options:
1729 & View.Child.Options<Props, Events, NoInfer<Msg>>
1730 & {
1731 /** Shown if the child fails, until its key changes. Without it, the child is blank. */
1732 readonly fallback?:
1733 | ((
1734 result: AsyncResult.Failure<never, unknown>
1735 ) => View.Content<NoInfer<Msg>, RF>)
1736 | undefined
1737 /**
1738 * The child's whole view, from its parts. It's the parent view's code:
1739 * the children it declares report to the parent, and it runs again
1740 * whenever the parent or the child renders.
1741 */
1742 readonly view: (parts: Parts) => View.Content<NoInfer<Msg>, RV>
1743 /** A headless child has no slots: its `view` is the parent's, and shows what the parent would pass. */
1744 readonly slots?: never
1745 }
1746 ): View.Child<Msg, R | Exclude<RV, Sh> | NoInfer<RF>>
1747 readonly [HeadlessTypeId]: {
1748 readonly _Props: Types.Invariant<Props>
1749 readonly _Events: Types.Covariant<Events>
1750 readonly _Parts: Types.Covariant<Parts>
1751 readonly _R: Types.Covariant<R>
1752 readonly _Rcv: Types.Invariant<Rcv>
1753 readonly _Sh: Types.Contravariant<Sh>
1754 readonly _SV: Types.Contravariant<SV>
1755 readonly _Rp: Types.Contravariant<Rp>
1756 readonly _K: Types.Contravariant<K>
1757 }
1758 /** What `define` returned. `provide` keeps it, so `definition.name` is the name the component was defined with. */
1759 readonly definition: Definition.Any
1760 readonly props: Schema.Codec<Props, any>
1761 readonly model: Schema.Codec<Model, any>
1762 readonly message: Schema.Codec<Msg, any>

Callers 2

Slots.test.tsFile · 0.85
SlotsStory.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected