GNUnet 0.22.2
typescriptdomain.TypeScriptDomain Class Reference
Inheritance diagram for typescriptdomain.TypeScriptDomain:
[legend]
Collaboration diagram for typescriptdomain.TypeScriptDomain:
[legend]

Public Member Functions

def resolve_xref (self, env, fromdocname, builder, typ, target, node, contnode)
 
def resolve_any_xref (self, env, fromdocname, builder, target, node, contnode)
 
Dict[Tuple[str, str], Tuple[str, str]] objects (self)
 
None add_object (self, str objtype, str name, str docname, str labelid)
 
def resolve_xref (self, env, fromdocname, builder, typ, target, node, contnode)
 
def resolve_any_xref (self, env, fromdocname, builder, target, node, contnode)
 
Dict[Tuple[str, str], Tuple[str, str]] objects (self)
 
None add_object (self, str objtype, str name, str docname, str labelid)
 

Static Public Attributes

string name = "ts"
 
string label = "TypeScript"
 
dictionary directives
 
dictionary roles
 
dictionary dangling_warnings
 

Detailed Description

TypeScript domain.

Definition at line 120 of file typescriptdomain.py.

Member Function Documentation

◆ resolve_xref() [1/2]

def typescriptdomain.TypeScriptDomain.resolve_xref (   self,
  env,
  fromdocname,
  builder,
  typ,
  target,
  node,
  contnode 
)

Definition at line 140 of file typescriptdomain.py.

140 def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
141 try:
142 info = self.objects[(str(typ), str(target))]
143 except KeyError:
144 logger.warn("type {}/{} not found".format(typ, target))
145 return None
146 else:
147 anchor = "tsref-type-{}".format(str(target))
148 title = typ.upper() + " " + target
149 return make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
150

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

◆ resolve_any_xref() [1/2]

def typescriptdomain.TypeScriptDomain.resolve_any_xref (   self,
  env,
  fromdocname,
  builder,
  target,
  node,
  contnode 
)
Resolve the pending_xref *node* with the given *target*.

The reference comes from an "any" or similar role, which means that Sphinx
don't know the type.

For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.

:return:
   list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
   is the name of a role that could have created the same reference,

Definition at line 151 of file typescriptdomain.py.

151 def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode):
152 """Resolve the pending_xref *node* with the given *target*.
153
154 The reference comes from an "any" or similar role, which means that Sphinx
155 don't know the type.
156
157 For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.
158
159 :return:
160 list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
161 is the name of a role that could have created the same reference,
162 """
163 ret = []
164 try:
165 info = self.objects[("type", str(target))]
166 except KeyError:
167 pass
168 else:
169 anchor = "tsref-type-{}".format(str(target))
170 title = "TYPE" + " " + target
171 node = make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
172 ret.append(("ts:type", node))
173 return ret
174

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

◆ objects() [1/2]

Dict[Tuple[str, str], Tuple[str, str]] typescriptdomain.TypeScriptDomain.objects (   self)

Definition at line 176 of file typescriptdomain.py.

176 def objects(self) -> Dict[Tuple[str, str], Tuple[str, str]]:
177 return self.data.setdefault(
178 "objects", {}
179 ) # (objtype, name) -> docname, labelid
180

References TcpContext.data, GNUNET_DATACACHE_Block.data, GNUNET_DNSPARSER_RawRecord.data, GNUNET_DNSPARSER_Record.data, GNUNET_FS_ProgressInfo::GNUNET_FS_PublishStatusEvent::GNUNET_FS_PublishProgressEvent.data, GNUNET_FS_ProgressInfo.data, GNUNET_FS_ProgressInfo::GNUNET_FS_DownloadStatusEvent::GNUNET_FS_DownloadProgressEvent.data, GNUNET_FS_ProgressInfo::GNUNET_FS_UnindexEvent::GNUNET_FS_UnindexProgressEvent.data, GNUNET_GNSRECORD_Data.data, GNUNET_MESSENGER_MessagePrivate.data, GNUNET_MESSENGER_MessageTranscript.data, GNUNET_MESSENGER_MessageTalk.data, GNUNET_PQ_QueryParam.data, GNUNET_RECLAIM_Attribute.data, GNUNET_RECLAIM_Credential.data, GNUNET_RECLAIM_Presentation.data, GNUNET_REST_RequestHandle.data, GNUNET_SET_Element.data, GNUNET_SETI_Element.data, GNUNET_SETU_Element.data, GNUNET_SQ_QueryParam.data, Buffer.data, WriteContext.data, Value.data, UpdateContext.data, RemoveContext.data, GNUNET_FS_Uri.data, GNUNET_FS_FileInformation.data, GetFullDataClosure.data, ProcessResultClosure.data, MetaCounter.data, HandleReplyClosure.data, ProcessReplyClosure.data, MetaItem.data, DnsResult.data, userdata.data, HostSet.data, GNUNET_NAT_Test.data, GNUNET_NAT_AUTO_TestMessage.data, GNUNET_NAT_AUTO_Test.data, GNUNET_NAT_TestMessage.data, TicketRecordsEntry.data, Result.data, RequestHandle.data, ego_sign_data_cls.data, and Stream.data.

Referenced by typescriptdomain.TypeScriptDomain.add_object(), typescriptdomain.TypeScriptDomain.resolve_any_xref(), and typescriptdomain.TypeScriptDomain.resolve_xref().

Here is the caller graph for this function:

◆ add_object() [1/2]

None typescriptdomain.TypeScriptDomain.add_object (   self,
str  objtype,
str  name,
str  docname,
str  labelid 
)

Definition at line 181 of file typescriptdomain.py.

181 def add_object(self, objtype: str, name: str, docname: str, labelid: str) -> None:
182 self.objects[objtype, name] = (docname, labelid)
183
184

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

◆ resolve_xref() [2/2]

def typescriptdomain.TypeScriptDomain.resolve_xref (   self,
  env,
  fromdocname,
  builder,
  typ,
  target,
  node,
  contnode 
)

Definition at line 140 of file typescriptdomain.py.

140 def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
141 try:
142 info = self.objects[(str(typ), str(target))]
143 except KeyError:
144 logger.warn("type {}/{} not found".format(typ, target))
145 return None
146 else:
147 anchor = "tsref-type-{}".format(str(target))
148 title = typ.upper() + " " + target
149 return make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
150

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

◆ resolve_any_xref() [2/2]

def typescriptdomain.TypeScriptDomain.resolve_any_xref (   self,
  env,
  fromdocname,
  builder,
  target,
  node,
  contnode 
)
Resolve the pending_xref *node* with the given *target*.

The reference comes from an "any" or similar role, which means that Sphinx
don't know the type.

For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.

:return:
   list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
   is the name of a role that could have created the same reference,

Definition at line 151 of file typescriptdomain.py.

151 def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode):
152 """Resolve the pending_xref *node* with the given *target*.
153
154 The reference comes from an "any" or similar role, which means that Sphinx
155 don't know the type.
156
157 For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.
158
159 :return:
160 list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
161 is the name of a role that could have created the same reference,
162 """
163 ret = []
164 try:
165 info = self.objects[("type", str(target))]
166 except KeyError:
167 pass
168 else:
169 anchor = "tsref-type-{}".format(str(target))
170 title = "TYPE" + " " + target
171 node = make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
172 ret.append(("ts:type", node))
173 return ret
174

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

◆ objects() [2/2]

Dict[Tuple[str, str], Tuple[str, str]] typescriptdomain.TypeScriptDomain.objects (   self)

Definition at line 176 of file typescriptdomain.py.

176 def objects(self) -> Dict[Tuple[str, str], Tuple[str, str]]:
177 return self.data.setdefault(
178 "objects", {}
179 ) # (objtype, name) -> docname, labelid
180

References TcpContext.data, GNUNET_DATACACHE_Block.data, GNUNET_DNSPARSER_RawRecord.data, GNUNET_DNSPARSER_Record.data, GNUNET_FS_ProgressInfo::GNUNET_FS_PublishStatusEvent::GNUNET_FS_PublishProgressEvent.data, GNUNET_FS_ProgressInfo.data, GNUNET_FS_ProgressInfo::GNUNET_FS_DownloadStatusEvent::GNUNET_FS_DownloadProgressEvent.data, GNUNET_FS_ProgressInfo::GNUNET_FS_UnindexEvent::GNUNET_FS_UnindexProgressEvent.data, GNUNET_GNSRECORD_Data.data, GNUNET_MESSENGER_MessagePrivate.data, GNUNET_MESSENGER_MessageTranscript.data, GNUNET_MESSENGER_MessageTalk.data, GNUNET_PQ_QueryParam.data, GNUNET_RECLAIM_Attribute.data, GNUNET_RECLAIM_Credential.data, GNUNET_RECLAIM_Presentation.data, GNUNET_REST_RequestHandle.data, GNUNET_SET_Element.data, GNUNET_SETI_Element.data, GNUNET_SETU_Element.data, GNUNET_SQ_QueryParam.data, Buffer.data, WriteContext.data, Value.data, UpdateContext.data, RemoveContext.data, GNUNET_FS_Uri.data, GNUNET_FS_FileInformation.data, GetFullDataClosure.data, ProcessResultClosure.data, MetaCounter.data, HandleReplyClosure.data, ProcessReplyClosure.data, MetaItem.data, DnsResult.data, userdata.data, HostSet.data, GNUNET_NAT_Test.data, GNUNET_NAT_AUTO_TestMessage.data, GNUNET_NAT_AUTO_Test.data, GNUNET_NAT_TestMessage.data, TicketRecordsEntry.data, Result.data, RequestHandle.data, ego_sign_data_cls.data, and Stream.data.

Referenced by typescriptdomain.TypeScriptDomain.add_object(), typescriptdomain.TypeScriptDomain.resolve_any_xref(), and typescriptdomain.TypeScriptDomain.resolve_xref().

Here is the caller graph for this function:

◆ add_object() [2/2]

None typescriptdomain.TypeScriptDomain.add_object (   self,
str  objtype,
str  name,
str  docname,
str  labelid 
)

Definition at line 181 of file typescriptdomain.py.

181 def add_object(self, objtype: str, name: str, docname: str, labelid: str) -> None:
182 self.objects[objtype, name] = (docname, labelid)
183
184

References typescriptdomain.TypeScriptDomain.objects().

Here is the call graph for this function:

Field Documentation

◆ name

string typescriptdomain.TypeScriptDomain.name = "ts"
static

Definition at line 123 of file typescriptdomain.py.

◆ label

string typescriptdomain.TypeScriptDomain.label = "TypeScript"
static

Definition at line 124 of file typescriptdomain.py.

◆ directives

dictionary typescriptdomain.TypeScriptDomain.directives
static
Initial value:
= {
"def": TypeScriptDefinition,
}

Definition at line 126 of file typescriptdomain.py.

◆ roles

dictionary typescriptdomain.TypeScriptDomain.roles
static
Initial value:
= {
"type": XRefRole(
lowercase=False, warn_dangling=True, innernodeclass=nodes.inline
),
}

Definition at line 130 of file typescriptdomain.py.

Referenced by httpdomain.httpdomain.HTTPDomain.resolve_xref().

◆ dangling_warnings

dictionary typescriptdomain.TypeScriptDomain.dangling_warnings
static
Initial value:
= {
"type": "undefined TypeScript type: %(target)s",
}

Definition at line 136 of file typescriptdomain.py.


The documentation for this class was generated from the following files: