mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
//// [tests/cases/compiler/complicatedIndexesOfIntersectionsAreInferencable.ts] ////
|
|
|
|
//// [complicatedIndexesOfIntersectionsAreInferencable.ts]
|
|
interface FormikConfig<Values> {
|
|
initialValues: Values;
|
|
validate?: (props: Values) => void;
|
|
validateOnChange?: boolean;
|
|
}
|
|
|
|
declare function Func<Values = object, ExtraProps = {}>(
|
|
x: (string extends "validate" | "initialValues" | keyof ExtraProps
|
|
? Readonly<FormikConfig<Values> & ExtraProps>
|
|
: Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">>
|
|
& Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>)
|
|
): void;
|
|
|
|
Func({
|
|
initialValues: {
|
|
foo: ""
|
|
},
|
|
validate: props => {
|
|
props.foo;
|
|
}
|
|
});
|
|
|
|
//// [complicatedIndexesOfIntersectionsAreInferencable.js]
|
|
"use strict";
|
|
Func({
|
|
initialValues: {
|
|
foo: ""
|
|
},
|
|
validate: props => {
|
|
props.foo;
|
|
}
|
|
});
|