Type alias infer<pattern>

infer<pattern>: InvertPattern<pattern, unknown>

P.infer<typeof somePattern> will return the type of the value matched by this pattern.

Read the documentation for P.infer on GitHub

Type Parameters

Example

const userPattern = { name: P.string }
type User = P.infer<typeof userPattern>