Predefined Live Templates for TypeScript
This topic lists all predefined live templates for TypeScript in JetBrains Rider 2018.1. For more information about live templates, see Creating Source Code Using Live Templates
Template | Details |
---|---|
ctx | Current file context Scope everywhere Body $CTX$ Parameters
|
nguid | Insert new GUID Scope everywhere Body $GUID$ Parameters
|
do (Imported JScript Snippets) | do...while loop Scope JS statements Body do {
$END$
} while($COND$) Parameters
|
dw (Imported JScript Snippets) | writeln function call Scope JS statements Body document.writeln($END$); Parameters
|
else (Imported JScript Snippets) | else statement Scope JS statements Body else {
$END$
} Parameters
|
for (Imported JScript Snippets) | for loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ = 0; $VAR$ < $LENGTH$; $VAR$++){
$END$
} Parameters
|
forin (Imported JScript Snippets) | for...in loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ in $ARRAY$){
$END$
} Parameters
|
forr (Imported JScript Snippets) | reverse for loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$=$LENGTH$-1;$VAR$ >=0; $VAR$--){
$END$
} Parameters
|
fun | Create TypeScript function Scope JS expressions Body function($parameters$){
$END$
} Parameters
Before expansion |
function (Imported JScript Snippets) | Scope JS statements Body function $name$($parameters$){
$END$
} Parameters
|
if (Imported JScript Snippets) | if statement Scope JS statements Body if ($COND$){
$END$
} Parameters
|
while (Imported JScript Snippets) | while loop Scope JS statements Body while ($COND$){
$END$
} Parameters
|
with (Imported JScript Snippets) | with statement Scope JS statements Body with ($EXPR$){
$END$
} Parameters
|
switch (Imported JScript Snippets) | switch statement Scope JS statements Body switch ($EXPR$){
case $CASE1$:
$END$
default:
} Parameters
|
try (Imported JScript Snippets) | try catch statement Scope JS statements Body try {
$END$
} catch (e) {
} Parameters
|
itar | Iterate an array Scope JS statements Body for (var $INDEX$=0;$INDEX$<$ARRAY$.length;$INDEX$++){
var $VAR$ = $ARRAY$[$INDEX$];$END$
} Parameters
Before expansion |
forof (Imported JScript Snippets) | for-of loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ of $ARRAY$){
$END$
} Parameters
|
ctor (Imported TypeScript Snippets) | Code snippet for default constructor declaration with body Scope TS type members Body constructor() { $END$ } Parameters
|
class (Imported TypeScript Snippets) | Code snippet for class Scope TS module members Body class $Name$ {
$END$
} Parameters
|
module (Imported TypeScript Snippets) | Code snippet for module Scope TS module members Body module $Name$ {
$END$
} Parameters
|
interface (Imported TypeScript Snippets) | Code snippet for interface Scope TS module members Body interface I$Name$ {
$END$
} Parameters
|
enum (Imported TypeScript Snippets) | Code snippet for enum Scope TS module members Body enum $Name$ {
$END$
} Parameters
|
nidx (Imported TypeScript Snippets) | Code snippet for number indexer annotation Scope TS type members Body [index: number]: $Type$; Parameters
|
sidx (Imported TypeScript Snippets) | Code snippet for string indexer annotation Scope TS type members Body [index: string]: $Type$; Parameters
|
prop (Imported TypeScript Snippets) | Code snippet for property Scope TS type members Body get $Name$():$Type$ {$BODY1$}
set $Name$(value:$Type$) {$END$} Parameters
|