Circle V2 API Docs
    Preparing search index...

    Type Alias FieldPathByValue<TFieldValues, TValue>

    FieldPathByValue: {
        [Key in FieldPath<TFieldValues>]: FieldPathValue<TFieldValues, Key> extends TValue
            ? Key
            : never
    }[FieldPath<TFieldValues>]

    Type which eagerly collects all paths through a fieldType that matches a give type

    Type Parameters

    • TFieldValues extends FieldValues

      field values which are indexed by the paths

    • TValue

      the value you want to match into each type

    FieldPathByValue<{foo: {bar: number}, baz: number, bar: string}, number>
    = 'foo.bar' | 'baz'