forgot to add new function to index.d.ts
This commit is contained in:
parent
106bd0bfdb
commit
8446f9ba9e
2 changed files with 6 additions and 3 deletions
2
index.d.ts
vendored
2
index.d.ts
vendored
|
|
@ -177,6 +177,8 @@ export function apply(input: any): any;
|
||||||
|
|
||||||
export function assignFn(funType: any, paramType: any): any;
|
export function assignFn(funType: any, paramType: any): any;
|
||||||
|
|
||||||
|
export function assignFnSubstitutions(funType: any, paramType: any): [any, any];
|
||||||
|
|
||||||
export function capitalizeFirstLetter(val: any): any;
|
export function capitalizeFirstLetter(val: any): any;
|
||||||
|
|
||||||
export function compareBools(x: any): any;
|
export function compareBools(x: any): any;
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ export const substitute = (type, substitutions, stack=[]) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const assignFn = (funType, paramType) => {
|
export const assignFn = (funType, paramType) => {
|
||||||
const [result] = assignFnSubstitutions(funType, paramType);
|
const [outType] = assignFnSubstitutions(funType, paramType);
|
||||||
return result;
|
return outType;
|
||||||
};
|
};
|
||||||
|
|
||||||
// same as above, but also returns the substitutions that took place
|
// same as above, but also returns the substitutions that took place
|
||||||
|
|
@ -202,7 +202,8 @@ export const assignFnSubstitutions = (funType, paramType) => {
|
||||||
const {substitutions} = __unify(inType, paramType);
|
const {substitutions} = __unify(inType, paramType);
|
||||||
// console.log(substitutions, prettyT(outType));
|
// console.log(substitutions, prettyT(outType));
|
||||||
const substitutedFnType = substitute(outType, substitutions);
|
const substitutedFnType = substitute(outType, substitutions);
|
||||||
return [recomputeTypeVars([substitutedFnType])[0], substitutions];
|
const computedOutType = recomputeTypeVars([substitutedFnType])[0];
|
||||||
|
return [computedOutType, substitutions];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensures that no type variables overlap
|
// Ensures that no type variables overlap
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue