From 24a23260310b6cb687ce4ec2bf50b9cb2aae170b Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 25 May 2021 15:26:44 -0700 Subject: [PATCH] api(dotnet): use lists, not collections (#6746) --- utils/doclint/generateDotnetApi.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/utils/doclint/generateDotnetApi.js b/utils/doclint/generateDotnetApi.js index 4d1c75621a..a121e1643d 100644 --- a/utils/doclint/generateDotnetApi.js +++ b/utils/doclint/generateDotnetApi.js @@ -73,9 +73,6 @@ documentation.setLinkRenderer(item => { // get the template for a class const template = fs.readFileSync(path.join(__dirname, 'templates', 'interface.cs'), 'utf-8'); -// we have some "predefined" types, like the mixed state enum, that we can map in advance -enumTypes.set("MixedState", ["On", "Off", "Mixed"]); - // map the name to a C# friendly one (we prepend an I to denote an interface) const classNameMap = new Map(documentation.classesArray.map(x => [x.name, `I${toTitleCase(x.name)}`])); @@ -532,7 +529,7 @@ function renderMethod(member, parent, name, options, out) { if (!type) type = resolveType(innerType); if (isArray) - type = `IReadOnlyCollection<${type}>`; + type = `IReadOnlyList<${type}>`; } } @@ -767,8 +764,6 @@ function translateType(type, parent, generateNameCallback = t => t.name, optiona // a few special cases we can fix automatically if (type.expression === '[null]|[Error]') return 'void'; - else if (type.expression === '[boolean]|"mixed"') - return 'MixedState'; if (type.union) { if (type.union[0].name === 'null' && type.union.length === 2)