Skip to content

Instantly share code, notes, and snippets.

@conartist6
Created November 8, 2025 13:41
Show Gist options
  • Select an option

  • Save conartist6/4dee5e9ce43f8668e30894f618dec1fd to your computer and use it in GitHub Desktop.

Select an option

Save conartist6/4dee5e9ce43f8668e30894f618dec1fd to your computer and use it in GitHub Desktop.
Typescript `declare function concat<T>(sources: Array<Wrappable<T>>);`
<Program>
body[]:
<_>
.: :TS:
<DeclarationStatement>
sigilToken*: <*Keyword 'declare' />
declaration*:
<_>
#: :Space: <*Space ' ' />
<FunctionDeclaration>
sigilToken*: :..: <*Keyword 'function' />
id:
<_>
#: :Space: <*Space ' ' />
.: :..:
<Identifier>
value*: <*Literal 'concat' />
</>
</>
<TypeParametersDeclaration>
openToken*: <*Punctuator '<' { balanced: '>' } />
params[]:
<TypeParameterDeclaration>
name: :..:
<Identifier>
value*: <*Literal 'T' />
</>
</>
closeToken*: <*Punctuator '>' { balancer: true } />
</>
openParamsToken*: :..: <*Punctuator '(' { balanced: ')' } />
params[]+: :..:
<Identifier>
value*: <*Literal 'sources' />
</>
<TypeAnnotation>
sigilToken*: <*Keyword ':' />
type:
<_>
#: :Space: <*Space ' ' />
<Type>
<ReferenceType>
name: :..:
<Identifier>
value*: <*Literal 'Array' />
</>
params[]:
<TypeParameters>
openToken*: <*Punctuator '<' { balanced: '>' } />
elements[]:
<ReferenceType>
name: :..:
<Identifier>
value*: <*Literal 'Wrappable' />
</>
params[]:
<TypeParameters>
openToken*: <*Punctuator '<' { balanced: '>' } />
elements[]:
<ReferenceType>
name: :..:
<Identifier>
value*: <*Literal 'T' />
</>
</>
closeToken*: <*Punctuator '>' { balancer: true } />
</>
</>
closeToken*: <*Punctuator '>' { balancer: true } />
</>
</>
</>
</>
</>
closeParamsToken*: :..: <*Punctuator ')' { balancer: true } />
</>
</>
</>
</>
body[]:
<EmptyStatement>
endToken*: <*Punctuator ';' />
</>
#: :Space: <*Space '\n' />
</>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment