import { Pattern, UnknownProperties } from './types/Pattern.cjs'; import * as P from './patterns.cjs'; /** * This constraint allows using additional properties * in object patterns. See "should allow targetting unknown properties" * unit test in `is-matching.test.ts`. */ type PatternConstraint = T extends readonly any[] ? P.Pattern : T extends object ? P.Pattern & UnknownProperties : P.Pattern; /** * `isMatching` takes pattern and returns a **type guard** function, cheching if a value matches this pattern. * * [Read documentation for `isMatching` on GitHub](https://github.com/gvergnaud/ts-pattern#ismatching) * * @example * const hasName = isMatching({ name: P.string }) * * declare let input: unknown * * if (hasName(input)) { * // `input` inferred as { name: string } * return input.name * } */ export declare function isMatching>(pattern: p): (value: unknown) => value is P.infer

; /** * `isMatching` takes pattern and a value and checks if the value matches this pattern. * * [Read documentation for `isMatching` on GitHub](https://github.com/gvergnaud/ts-pattern#ismatching) * * @example * declare let input: unknown * * if (isMatching({ name: P.string }, input)) { * // `input` inferred as { name: string } * return input.name * } */ export declare function isMatching>(pattern: P, value: T): value is P.infer

; export {};