def describe_signature(self, signode: TextElement, mode: str, env: 'BuildEnvironment', symbol: 'Symbol') -> None:
    verify_description_mode(mode)
    if (mode == 'noneIsName'):
        signode += nodes.Text(str(self))
    elif (mode == 'param'):
        name = str(self)
        signode += nodes.emphasis(name, name)
    elif ((mode == 'markType') or (mode == 'lastIsName') or (mode == 'markName')):
        templateParams = []
        if (mode == 'lastIsName'):
            assert (symbol is not None)
            if (symbol.declaration.templatePrefix is not None):
                templateParams = symbol.declaration.templatePrefix.templates
        iTemplateParams = 0
        templateParamsPrefix = ''
        prefix = ''
        first = True
        names = (self.names[:(- 1)] if (mode == 'lastIsName') else self.names)
        dest = signode
        if (mode == 'lastIsName'):
            dest = addnodes.desc_addname()
        for i in range(len(names)):
            nne = names[i]
            template = self.templates[i]
            if (not first):
                dest += nodes.Text('::')
                prefix += '::'
            if template:
                dest += nodes.Text('template ')
            first = False
            txt_nne = str(nne)
            if (txt_nne != ''):
                if (nne.templateArgs and (iTemplateParams < len(templateParams))):
                    templateParamsPrefix += str(templateParams[iTemplateParams])
                    iTemplateParams += 1
                nne.describe_signature(dest, 'markType', env, (templateParamsPrefix + prefix), symbol)
            prefix += txt_nne
        if (mode == 'lastIsName'):
            if (len(self.names) > 1):
                dest += addnodes.desc_addname('::', '::')
                signode += dest
            if self.templates[(- 1)]:
                signode += nodes.Text('template ')
            self.names[(- 1)].describe_signature(signode, mode, env, '', symbol)
    else:
        raise Exception(('Unknown description mode: %s' % mode))
def describe_signature(self, signode: TextElement, mode: str, env: 'BuildEnvironment', symbol: 'Symbol') -> None:
    verify_description_mode(mode)
    if (mode == 'noneIsName'):
        signode += nodes.Text(str(self))
    elif (mode == 'param'):
        name = str(self)
        signode += nodes.emphasis(name, name)
    elif ((mode == 'markType') or (mode == 'lastIsName') or (mode == 'markName')):
        templateParams = []
        if (mode == 'lastIsName'):
            assert (symbol is not None)
            if (symbol.declaration.templatePrefix is not None):
                templateParams = symbol.declaration.templatePrefix.templates
        iTemplateParams = 0
        templateParamsPrefix = 
        prefix = 
        first = True
        names = (self.names[:(- 1)] if (mode == 'lastIsName') else self.names)
        dest = signode
        if (mode == 'lastIsName'):
            dest = addnodes.desc_addname()
        for i in range(len(names)):
            nne = names[i]
            template = self.templates[i]
            if (not first):
                dest += nodes.Text('::')
                prefix += '::'
            if template:
                dest += nodes.Text('template ')
            first = False
            txt_nne = str(nne)
            if (txt_nne != ):
                if (nne.templateArgs and (iTemplateParams < len(templateParams))):
                    templateParamsPrefix += str(templateParams[iTemplateParams])
                    iTemplateParams += 1
                nne.describe_signature(dest, 'markType', env, (templateParamsPrefix + prefix), symbol)
            prefix += txt_nne
        if (mode == 'lastIsName'):
            if (len(self.names) > 1):
                dest += addnodes.desc_addname('::', '::')
                signode += dest
            if self.templates[(- 1)]:
                signode += nodes.Text('template ')
            self.names[(- 1)].describe_signature(signode, mode, env, , symbol)
    else:
        raise Exception(('Unknown description mode: %s' % mode))