import { Fn } from '../Fn'; import { Invoke } from '../Invoke'; import { Option, OptionNone, OptionSome } from '../types'; import { HandleNever, IfInvoking, Input } from '../utils'; export interface Find> extends Fn> { out: IfInvoking>, Option>; } export type InvokeFind, List extends K['in'][]> = List extends [infer First extends K['in'], ...infer Rest extends K['in'][]] ? Invoke> extends true ? OptionSome, K['in']> : InvokeFind : OptionNone;