/** * Filters an arbitrary object down to the props a component's contract declares. * * This is the engine behind each package's own curated passthrough utility (e.g. ds-app-picker's * `getDSAppPickerContractProps`). Packages are expected to expose a bound utility rather than their * schema: the schema stays an internal implementation detail, so the two can drift later without * expanding anyone's public API. * * Three behaviours worth knowing, because callers depend on them: * * 1. **Documentation-only wildcard keys are ignored.** See `DOCUMENTATION_ONLY_SCHEMA_KEYS`. * 2. **`data-*` is honoured by prefix**, matching `getGlobalAttributes` — arbitrary data attributes * are a supported consumer surface even though no schema can enumerate them. Note the house * behaviour deliberately does not extend the same courtesy to `aria-*` or `on*`: those are * matched against the schema's explicit list, so a typo fails loudly instead of reaching the DOM. * 3. **`undefined` is dropped, `null` is forwarded.** These two are not interchangeable, and the rule * follows React rather than being invented here: * * - React's own default resolution (`resolveDefaultProps`) applies a `defaultProps` entry only when * the incoming prop is `undefined`; a `null` is respected as an explicitly supplied value. This * is the same rule as JS destructuring defaults and ES6 default parameters — a language-level * standard, not a React invention. So `undefined` means "I am not defining this, you decide" and * `null` means "I am defining it, as nothing". * - Everywhere React *consumes* a value rather than defaulting it — DOM attributes, children, event * handlers — it collapses the two and treats both as absent. The distinction is load-bearing * only at a default-resolution boundary. * * A contract passthrough is exactly such a boundary: the result is spread *after* a wrapper's own * defaults, so dropping `undefined` is what stops an unset key from erasing a working default, * while forwarding `null` is what lets a consumer deliberately override one. This matters more * here than in plain React, because Dimsum's `useMemoMergePropsWithDefault` is a plain * `{...defaults, ...props}` spread — it does NOT skip `undefined` the way `resolveDefaultProps` * does, so an `undefined` that reaches it clobbers the component's default too. * * What happens to a forwarded `null` afterwards is the receiving component's business, not this * function's. Dimsum components are strictly typed: `validateTypescriptPropTypesImplementation` * validates any value that is not `undefined`, and a prop declared as a function does not admit * `null` — so passing `null` there raises a prop-type error, correctly. A prop only accepts `null` * if its own declared type says so and its code carries the matching null guards. Where a consumer * wants to state "do nothing", the type-honouring way to say it is an explicit no-op — `() => {}` * for a handler, `() => null` for a component — which is unambiguous in a way that `null` is not. * This function stays out of that decision: forwarding the value and letting the owning contract * judge it is the correct division of concerns at this abstraction level. * * @param props - the object to filter; anything the contract does not declare is discarded * @param contractShape - any object whose KEYS name the contract's props. Only `Object.keys` is read, * so it is deliberately not narrowed to `DSPropTypesSchema` * * a PropTypes schema is usually fine and there is a code dedicated to discarding the global attributes to make the schema compatible for faster internal transition/implementation. * @returns a new object containing only the declared, defined props */ export declare const getContractProps: (props: object, contractShape: object) => Partial;