(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
key: TKey,
logic: NoInfer<
LogicFn<
TValue,
TKey extends LimitSelectionKey ? LimitKey<TValue> : MetadataSetterType<TKey>,
TPathKind
>
>,
)
| 28 | * @publicApi 22.0 |
| 29 | */ |
| 30 | export function metadata< |
| 31 | TValue, |
| 32 | TKey extends MetadataKey<any, any, any>, |
| 33 | TPathKind extends PathKind = PathKind.Root, |
| 34 | >( |
| 35 | path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, |
| 36 | key: TKey, |
| 37 | logic: NoInfer< |
| 38 | LogicFn< |
| 39 | TValue, |
| 40 | TKey extends LimitSelectionKey ? LimitKey<TValue> : MetadataSetterType<TKey>, |
| 41 | TPathKind |
| 42 | > |
| 43 | >, |
| 44 | ): TKey { |
| 45 | assertPathIsCurrent(path); |
| 46 | |
| 47 | const pathNode = FieldPathNode.unwrapFieldPath(path); |
| 48 | pathNode.builder.addMetadataRule(key, logic); |
| 49 | return key; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * A reducer that determines the accumulated value for a metadata key by reducing the individual |
searching dependent graphs…