Merge pull request #15531 from Microsoft/moreFactoryFuncs

More factory functions
This commit is contained in:
Ron Buckton
2017-05-08 12:05:05 -07:00
committed by GitHub
7 changed files with 584 additions and 507 deletions

View File

@@ -110,16 +110,16 @@ namespace ts.codefix {
if (!isStatic) {
const stringTypeNode = createKeywordTypeNode(SyntaxKind.StringKeyword);
const indexingParameter = createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
"x",
/*questionToken*/ undefined,
/*questionToken*/ undefined,
stringTypeNode,
/*initializer*/ undefined);
const indexSignature = createIndexSignatureDeclaration(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*initializer*/ undefined);
const indexSignature = createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[indexingParameter],
typeNode);

View File

@@ -200,7 +200,7 @@ namespace ts.codefix {
}
export function createStubbedMethod(modifiers: Modifier[], name: PropertyName, optional: boolean, typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], returnType: TypeNode | undefined) {
return createMethodDeclaration(
return createMethod(
/*decorators*/ undefined,
modifiers,
/*asteriskToken*/ undefined,