Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Method and function signatures in ambient context - Generated implementation signature #218

Closed
dsherret opened this issue Dec 17, 2016 · 0 comments

Comments

@dsherret
Copy link
Owner

dsherret commented Dec 17, 2016

For example:

class TypeParameterDefinition {
    setConstraintType(definition: NamedDefinition, typeArguments?: undefined | string[]): this;
    setConstraintType(text: string): this;
}

Should have two overload signatures and one implementation signature. Right now it uses the last signature for the implementation signature.


The implementation signature should be (this is kind of a compromise to make this scenario work within the library):

class TypeParameterDefinition {
    setConstraintType(definition: NamedDefinition, typeArguments?: undefined | string[]): this;
    setConstraintType(text: string): this;
    setConstraintType(param1: NamedDefinition | string, param2?: undefined | string[]): this {
    }
}

So basically a signature that is a combination of all the types. I'm thinking the name of the parameters should be numbered like what is shown above to not create too much complexity. I could probably add a unionize method to TypeDefinition that handles creating the union types.

@dsherret dsherret added this to the Version 7.0 milestone Feb 17, 2017
dsherret added a commit that referenced this issue Feb 21, 2017
…on types, type parameters, etc. of types set by string.

Still need to make assigning to .text of BaseTypeDefinition do this.
dsherret added a commit that referenced this issue Feb 22, 2017
…te types.

Sidenote: These code generated functions from ts-state-test-generator and ts-cloneable-generator are awesome!
dsherret added a commit that referenced this issue Feb 25, 2017
@dsherret dsherret changed the title Multiple method signatures in ambient context should have two overload signatures Method and function signatures in ambient context - Generated implementation signature Feb 25, 2017
dsherret added a commit that referenced this issue Feb 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant