API Reference

Exploring API reference of built-in libraries.

Fable

Fable Namespace

TypeDescription
CompilerOptions
ICompiler
IPlugin
IReplacePlugin
PluginInfo
Position

Each Position object consists of a line number (1-indexed) and a column number (0-indexed):

Severity
ModuleDescription
List
Map
Option
Path

Fable.AST Namespace

TypeDescription
AssignmentOperator
BinaryOperator
ExtendedNumberKind

Numbers that are not represented with JS native number type

LogicalOperator
NumberKind
RegexFlag
UnaryOperator
UpdateOperator

Fable.AST.Babel Namespace

TypeDescription
AnyTypeAnnotation
ArrayExpression
ArrayPattern
ArrowFunctionExpression

A fat arrow function expression, e.g., let foo = (bar) => { / body / }.

AssignmentExpression
AssignmentPattern
AwaitExpression
BinaryExpression
BlockStatement

A block statement, i.e., a sequence of statements surrounded by braces.

BooleanLiteral
BooleanTypeAnnotation
BreakStatement

Break can optionally take a label of a loop to break

CallExpression

A function or method call expression.

CatchClause

A catch clause following a try block.

ClassBody
ClassDeclaration
ClassExpression

Anonymous class: e.g., var myClass = class { }

ClassMethod
ClassMethodKind
ClassProperty

ES Class Fields & Static Properties https://github.com/jeffmo/es-class-fields-and-static-properties e.g, class MyClass { static myStaticProp = 5; myProp / = 10 /; }

ConditionalExpression

A conditional expression, i.e., a ternary ?/: expression.

ContinueStatement

Contineu can optionally take a label of a loop to continuue

DebuggerStatement
Declaration

Note that declarations are considered statements; this is because declarations can appear in any statement context.

Decorator
Directive

e.g. "use strict";

DirectiveLiteral
DoExpression

e.g., x = do { var t = f(); t * t + 1 }; http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions Doesn't seem to work well with block-scoped variables (let, const)

DoWhileStatement
EmptyExpression

Placeholder, doesn't belong to Babel specs

EmptyStatement

An empty statement, i.e., a solitary semicolon.

ExportAllDeclaration

An export batch declaration, e.g., export * from "mod";.

ExportDefaultDeclaration

An export default declaration, e.g., export default function () {}; or export default 1;.

ExportNamedDeclaration

An export named declaration, e.g., export {foo, bar};, export {foo} from "mod"; or export var foo = 1;. Note: Having declaration populated with non-empty specifiers or non-null source results in an invalid state.

ExportSpecifier

An exported variable binding, e.g., {foo} in export {foo} or {bar as foo} in export {bar as foo}. The exported field refers to the name exported in the module. The local field refers to the binding into the local module scope. If it is a basic named export, such as in export {foo}, both exported and local are equivalent Identifier nodes; in this case an Identifier node representing foo. If it is an aliased export, such as in export {bar as foo}, the exported field is an Identifier node representing foo, and the local field is an Identifier node representing bar.

Expression

Since the left-hand side of an assignment may be any expression in general, an expression can also be a pattern.

ExpressionStatement

An expression statement, i.e., a statement consisting of a single expression.

ForInStatement

When passing a VariableDeclaration, the bound value must go through the right parameter instead of init property in VariableDeclarator

ForOfStatement

When passing a VariableDeclaration, the bound value must go through the right parameter instead of init property in VariableDeclarator

ForStatement
FunctionDeclaration

A function declaration. Note that id cannot be null.

FunctionExpression
FunctionTypeAnnotation
FunctionTypeParam
GenericTypeAnnotation
IfStatement
ImportDeclaration

e.g., import foo from "mod";.

ImportDefaultSpecifier

A default import specifier, e.g., foo in import foo from "mod".

ImportNamespaceSpecifier

A namespace import specifier, e.g., as foo in import as foo from "mod".

ImportSpecifier

An imported variable binding, e.g., {foo} in import {foo} from "mod" or {foo as bar} in import {foo as bar} from "mod". The imported field refers to the name of the export imported from the module. The local field refers to the binding imported into the local module scope. If it is a basic named import, such as in import {foo} from "mod", both imported and local are equivalent Identifier nodes; in this case an Identifier node representing foo. If it is an aliased import, such as in import {foo as bar} from "mod", the imported field is an Identifier node representing foo, and the local field is an Identifier node representing bar.

InterfaceDeclaration
InterfaceExtends
LabeledStatement

Statement (typically loop) prefixed with a label (for continuue and break)

Literal
LogicalExpression
MacroExpression

Not in Babel specs, disguised as StringLiteral

MemberExpression

If computed is true, the node corresponds to a computed (a[b]) member expression and property is an Expression. If computed is false, the node corresponds to a static (a.b) member expression and property is an Identifier.

ModuleDeclaration

A module import or export declaration.

ModuleSpecifier

A specifier in an import or export declaration.

NewExpression
Node

The type field is a string representing the AST variant type. Each subtype of Node is documented below with the specific string of its type field. You can use this field to determine which interface a node implements. The loc field represents the source location information of the node. If the node contains no information about the source location, the field is null; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region):

NullLiteral
NullableTypeAnnotation
NumberTypeAnnotation
NumericLiteral
ObjectExpression
ObjectMember
ObjectMethod
ObjectMethodKind
ObjectProperty
ObjectTypeAnnotation
ObjectTypeProperty
Pattern
Program

A complete program source tree. Parsers must specify sourceType as "module" if the source has been parsed as an ES6 module. Otherwise, sourceType must be "script".

RegExpLiteral
RestElement
RestProperty
ReturnStatement
SequenceExpression

A comma-separated sequence of expressions.

SpreadElement
SpreadProperty

e.g., var z = { x: 1, ...y } // Copy all properties from y

Statement
StringLiteral
StringTypeAnnotation
Super

A super pseudo-expression.

SwitchCase

A case (if test is an Expression) or default (if test === null) clause in the body of a switch statement.

SwitchStatement
TaggedTemplateExpression
TemplateLiteral
ThisExpression
ThrowStatement
TryStatement

If handler is null then finalizer must be a BlockStatement.

TupleTypeAnnotation
TypeAnnotation
TypeAnnotationInfo
TypeParameter
TypeParameterDeclaration
TypeParameterInstantiation
U2<'a, 'b>
U3<'a, 'b, 'c>
UnaryExpression
UpdateExpression
VariableDeclaration
VariableDeclarationKind
VariableDeclarator
VoidTypeAnnotation
WhileStatement
YieldExpression

Fable.AST.Fable Namespace

Fable.Core Namespace

TypeDescription
Applicable

DO NOT USE: Internal type for Fable dynamic operations

U2<'a, 'b>

Erased union type to represent one of two possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U3<'a, 'b, 'c>

Erased union type to represent one of three possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U4<'a, 'b, 'c, 'd>

Erased union type to represent one of four possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U5<'a, 'b, 'c, 'd, 'e>

Erased union type to represent one of five possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U6<'a, 'b, 'c, 'd, 'e, 'f>

Erased union type to represent one of six possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U7<'a, 'b, 'c, 'd, 'e, 'f, 'g>

Erased union type to represent one of seven possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

U8<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>

Erased union type to represent one of eight possible values. More info: http://fable.io/docs/interacting.html#Erase-attribute

ModuleDescription
Exceptions
JsInterop
Testing

Fable.Import Namespace

ModuleDescription
JS