本文整理汇总了TypeScript中strands.Strands.append方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Strands.append方法的具体用法?TypeScript Strands.append怎么用?TypeScript Strands.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类strands.Strands
的用法示例。
在下文中一共展示了Strands.append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createProtoResources
// Create prototype resources.
private createProtoResources(withParams: KeyedNestedResources, noParams: KeyedNestedResources) {
for (const key of Object.keys(withParams)) {
const child = withParams[key];
// Skip inlined entries.
if (noParams[key] != null) {
continue;
}
this.buffer.append(`\n`);
this.buffer.append(` ${child.methodName}${this.toParamsMethod(child, 'this.client', true)}`);
}
}
示例2: createThisResources
private createThisResources(withParams: KeyedNestedResources, noParams: KeyedNestedResources, client: string, isChild = true) {
for (const key of Object.keys(noParams)) {
const child = noParams[key];
let constructor;
let path: string;
if (isChild) {
path = `\`\${this.path}${child.relativeUri}\``;
} else {
path = `'${child.relativeUri}'`;
}
if (this.currentPath.length === 0) {
constructor = `new ${uppercamelcase(child.methodName)}(${client}, ${path})`;
} else {
constructor = `new ${this.currentPath.join('.')}.` +
`${uppercamelcase(child.methodName)}(${client}, ${path})`;
}
if (withParams[key] == null) {
this.buffer.line(` this.${child.methodName} = ${constructor};`);
} else {
this.buffer.line();
this.buffer.append(` this.${child.methodName} = Object.setPrototypeOf(` +
`${this.toParamsFunction(withParams[key], client, isChild, ` ${constructor});`)}`);
}
}
}