本文整理汇总了TypeScript中code-block-writer.toString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toString函数的具体用法?TypeScript toString怎么用?TypeScript toString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toString函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: write
write() {
const writer = new CodeBlockWriter();
const flags = WriteFlags.Default;
const namespaceWriter = new NamespaceWriter(writer, new ModuledWriter(writer, flags), flags);
namespaceWriter.write(this);
return writer.toString();
}
示例2: getModuledAsString
function getModuledAsString(f: ModuledDefinitions) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new ModuledWriter(codeBlockWriter);
writer.write(f);
return codeBlockWriter.toString();
}
示例3: getFileAsString
function getFileAsString(f: FileDefinition) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new FileWriter(codeBlockWriter);
writer.write(f);
return codeBlockWriter.toString();
}
示例4: getWriterString
function getWriterString(e: EnumDefinition) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new EnumWriter(codeBlockWriter);
writer.write(e);
return codeBlockWriter.toString();
}
示例5: getExpressionAsString
function getExpressionAsString(typeExpression: Expression) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new ExpressionWriter(codeBlockWriter, WriteFlags.Default);
writer.writeWithEqualsSign(typeExpression);
return codeBlockWriter.toString();
}
示例6: getParametersAsString
function getParametersAsString(params: ParameterDefinitions[]) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new ParametersWriter(codeBlockWriter);
writer.write(params);
return codeBlockWriter.toString();
}
示例7: getEnumMemberAsString
function getEnumMemberAsString(enumMember: EnumMemberDefinition) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new EnumMemberWriter(codeBlockWriter, WriteFlags.Default);
writer.write(enumMember);
return codeBlockWriter.toString();
}
示例8: getFileAsString
function getFileAsString(def: FileDefinition, flags: WriteFlags) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new FileWriter(codeBlockWriter, flags);
writer.write(def);
return codeBlockWriter.toString();
}
示例9: getTypeAliasAsString
function getTypeAliasAsString(def: TypeAliasDefinition) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new TypeAliasWriter(codeBlockWriter);
writer.write(def);
return codeBlockWriter.toString();
}
示例10: getTypeParametersAsString
function getTypeParametersAsString(typeParameters: TypeParameterDefinition<any>[]) {
const codeBlockWriter = new CodeBlockWriter();
const writer = new TypeParametersWriter(codeBlockWriter);
writer.write(typeParameters);
return codeBlockWriter.toString();
}