GramJS: Fix raw vector types (#4320)

This commit is contained in:
Alexander Zinchuk 2024-03-01 14:02:41 -05:00
parent 0eecca4fb9
commit fd62fdeba0
2 changed files with 6 additions and 6 deletions

View File

@ -12603,7 +12603,7 @@ namespace Api {
}; };
export class GetIsPremiumRequiredToContact extends Request<Partial<{ export class GetIsPremiumRequiredToContact extends Request<Partial<{
id: Api.TypeInputUser[]; id: Api.TypeInputUser[];
}>, Bool> { }>, Bool[]> {
id: Api.TypeInputUser[]; id: Api.TypeInputUser[];
}; };
} }

View File

@ -106,22 +106,22 @@ ${indent}};`.trim()
function renderValueType(type, isVector, isTlType) { function renderValueType(type, isVector, isTlType) {
if (RAW_TYPES.has(type)) { if (RAW_TYPES.has(type)) {
return type return isVector ? `${type}[]` : type;
} }
let resType let resType
if (typeof type === 'string' && isTlType) { if (typeof type === 'string' && isTlType) {
resType = renderTypeName(type) resType = renderTypeName(type);
} else { } else {
resType = type resType = type;
} }
if (isVector) { if (isVector) {
resType = `${resType}[]` resType = `${resType}[]`;
} }
return resType return resType;
} }
function renderTypeName(typeName) { function renderTypeName(typeName) {