Type alias Infer<P>

Infer<P>: P extends BasePredicate<infer T>
    ? T
    : never

Retrieve the type from the given predicate.

Type Parameters

  • P

Example

import ow, {Infer} from 'ow';

const userPredicate = ow.object.exactShape({
name: ow.string
});

type User = Infer<typeof userPredicate>;