Skip to content

GleapSDK/Capacitor-SDK

Repository files navigation

Capacitor Gleap Plugin

Gleap SDK for Capacitor is the easiest way to integrate Gleap into your Ionic apps! Achieve better app quality with comprehensive in-app bug reporting & customer feedback for your web-apps and websites. Many thanks to Stephan Nagel (congrapp) for his work on the Gleap capacitor plugin.

This plugin supports capacitor 7. See the instructions below for earlier capacitor versions.

Install

npm install capacitor-gleap-plugin
npx cap sync

Capacitor 6

Please install the plugin version from our capacitor-v6 brunch with npm install GleapSDK/Capacitor-SDK#capacitor-v6 --save if you are using capacitor 6.

Capacitor 5

Please install the plugin version from our capacitor-v5 brunch with npm install GleapSDK/Capacitor-SDK#capacitor-v5 --save if you are using capacitor 5.

Capacitor 4 or earlier

Please install the plugin version from our capacitor-v4 brunch with npm install GleapSDK/Capacitor-SDK#capacitor-v4 --save if you are using capacitor 4 or earlier.

API

initialize(...)

initialize(options: { API_KEY: string; }) => Promise<{ initialized: boolean; }>

Initialize Gleap with an API key

Param Type
options { API_KEY: string; }

Returns: Promise<{ initialized: boolean; }>

Since: 7.0.0


identify(...)

identify(options: { userId: string; userHash?: string; name?: string; email?: string; phone?: string; companyId?: string; companyName?: string; avatar?: string; sla?: number; plan?: string; value?: number; customData?: Object; }) => Promise<{ identify: boolean; }>

Set user identity

Param Type
options { userId: string; userHash?: string; name?: string; email?: string; phone?: string; companyId?: string; companyName?: string; avatar?: string; sla?: number; plan?: string; value?: number; customData?: Object; }

Returns: Promise<{ identify: boolean; }>

Since: 7.0.0


updateContact(...)

updateContact(options: { name?: string; email?: string; phone?: string; companyId?: string; companyName?: string; avatar?: string; sla?: number; plan?: string; value?: number; customData?: Object; }) => Promise<{ identify: boolean; }>

Update user properties

Param Type
options { name?: string; email?: string; phone?: string; companyId?: string; companyName?: string; avatar?: string; sla?: number; plan?: string; value?: number; customData?: Object; }

Returns: Promise<{ identify: boolean; }>

Since: 13.2.1


clearIdentity()

clearIdentity() => Promise<{ clearIdentity: boolean; }>

Clear user identity

Returns: Promise<{ clearIdentity: boolean; }>

Since: 7.0.0


getIdentity()

getIdentity() => Promise<{ identity: { userId: string; name?: string; email?: string; phone?: string; value?: number; }; }>

Get the current user identity

Returns: Promise<{ identity: { userId: string; name?: string; email?: string; phone?: string; value?: number; }; }>

Since: 8.1.0


isUserIdentified()

isUserIdentified() => Promise<{ isUserIdentified: boolean; }>

User identified status.

Returns: Promise<{ isUserIdentified: boolean; }>

Since: 8.1.0


log(...)

log(options: { message: string; logLevel?: "ERROR" | "WARNING" | "INFO"; }) => Promise<{ logged: boolean; }>

Submit a custom log message with the given level

Param Type
options { message: string; logLevel?: 'ERROR' | 'WARNING' | 'INFO'; }

Returns: Promise<{ logged: boolean; }>

Since: 7.0.0


showSurvey(...)

showSurvey(options: { surveyId: string; format?: "survey" | "survey_full"; }) => Promise<{ opened: boolean; }>

Manually show a survey.

Param Type
options { surveyId: string; format?: 'survey' | 'survey_full'; }

Returns: Promise<{ opened: boolean; }>

Since: 8.5.1


attachCustomData(...)

attachCustomData(options: { data: any; }) => Promise<{ attachedCustomData: boolean; }>

Add custom data

Param Type
options { data: any; }

Returns: Promise<{ attachedCustomData: boolean; }>

Since: 7.0.0


setTags(...)

setTags(options: { tags: string[]; }) => Promise<{ tagsSet: boolean; }>

Set tags

Param Type
options { tags: string[]; }

Returns: Promise<{ tagsSet: boolean; }>

Since: 8.6.0


setNetworkLogsBlacklist(...)

setNetworkLogsBlacklist(options: { blacklist: string[]; }) => Promise<{ blacklistSet: boolean; }>

Set network logs blacklist

Param Type
options { blacklist: string[]; }

Returns: Promise<{ blacklistSet: boolean; }>

Since: 13.2.1


setNetworkLogPropsToIgnore(...)

setNetworkLogPropsToIgnore(options: { propsToIgnore: string[]; }) => Promise<{ propsToIgnoreSet: boolean; }>

Set network logs props to ignore

Param Type
options { propsToIgnore: string[]; }

Returns: Promise<{ propsToIgnoreSet: boolean; }>

Since: 13.2.1


setAiTools(...)

setAiTools(options: { tools: { name: string; description: string; response: string; executionType: "auto" | "button"; parameters: { name: string; description: string; type: "string" | "number" | "boolean"; required: boolean; enums?: string[]; }[]; }[]; }) => Promise<{ aiToolsSet: boolean; }>

Sets the AI tools to use

Param Type
options { tools: { name: string; description: string; response: string; executionType: 'auto' | 'button'; parameters: { name: string; description: string; type: 'string' | 'number' | 'boolean'; required: boolean; enums?: string[]; }[]; }[]; }

Returns: Promise<{ aiToolsSet: boolean; }>

Since: 13.5.0


setTicketAttribute(...)

setTicketAttribute(options: { key: string; value: string; }) => Promise<{ setTicketAttribute: boolean; }>

Sets the value of a ticket attribute

Param Type
options { key: string; value: string; }

Returns: Promise<{ setTicketAttribute: boolean; }>

Since: 13.5.0


unsetTicketAttribute(...)

unsetTicketAttribute(options: { key: string; }) => Promise<{ unsetTicketAttribute: boolean; }>

Unset a ticket attribute

Param Type
options { key: string; }

Returns: Promise<{ unsetTicketAttribute: boolean; }>

Since: 14.1.0


clearTicketAttributes()

clearTicketAttributes() => Promise<{ clearTicketAttributes: boolean; }>

Clear all ticket attributes

Returns: Promise<{ clearTicketAttributes: boolean; }>

Since: 14.1.0


setCustomData(...)

setCustomData(options: { key: string; value: string; }) => Promise<{ setCustomData: boolean; }>

Set custom data

Param Type
options { key: string; value: string; }

Returns: Promise<{ setCustomData: boolean; }>

Since: 7.0.0


removeCustomData(...)

removeCustomData(options: { key: string; }) => Promise<{ removedCustomData: boolean; }>

Remove custom data by key

Param Type
options { key: string; }

Returns: Promise<{ removedCustomData: boolean; }>

Since: 7.0.0


clearCustomData()

clearCustomData() => Promise<{ clearedCustomData: boolean; }>

Clear custom data

Returns: Promise<{ clearedCustomData: boolean; }>

Since: 7.0.0


trackEvent(...)

trackEvent(options: { name: string; data?: any; }) => Promise<{ loggedEvent: boolean; }>

Log event to Gleap

Param Type
options { name: string; data?: any; }

Returns: Promise<{ loggedEvent: boolean; }>

Since: 8.0.0


trackPage(...)

trackPage(options: { pageName: string; }) => Promise<{ trackedPage: boolean; }>

Track a page view

Param Type
options { pageName: string; }

Returns: Promise<{ trackedPage: boolean; }>

Since: 8.4.1


setEventCallback(...)

setEventCallback(callback: GleapEventCallback) => Promise<CallbackID>
Param Type
callback GleapEventCallback

Returns: Promise<string>

Since: 7.0.0


sendSilentCrashReport(...)

sendSilentCrashReport(options: { description: string; severity?: "LOW" | "MEDIUM" | "HIGH"; dataExclusion?: { customData: Boolean; metaData: Boolean; attachments: Boolean; consoleLog: Boolean; networkLogs: Boolean; customEventLog: Boolean; screenshot: Boolean; replays: Boolean; }; }) => Promise<{ sentSilentBugReport: boolean; }>

Log event to Gleap

Param Type
options { description: string; severity?: 'LOW' | 'MEDIUM' | 'HIGH'; dataExclusion?: { customData: Boolean; metaData: Boolean; attachments: Boolean; consoleLog: Boolean; networkLogs: Boolean; customEventLog: Boolean; screenshot: Boolean; replays: Boolean; }; }

Returns: Promise<{ sentSilentBugReport: boolean; }>

Since: 7.0.0


preFillForm(...)

preFillForm(options: { data: any; }) => Promise<{ preFilledForm: boolean; }>

Prefills the widget's form data

Param Type
options { data: any; }

Returns: Promise<{ preFilledForm: boolean; }>

Since: 7.0.0


addAttachment(...)

addAttachment(options: { base64data: string; name: string; }) => Promise<{ attachmentAdded: boolean; }>

Add attachment as bas64 string

Param Type
options { base64data: string; name: string; }

Returns: Promise<{ attachmentAdded: boolean; }>

Since: 7.0.0


removeAllAttachments()

removeAllAttachments() => Promise<{ allAttachmentsRemoved: boolean; }>

All attachments removed

Returns: Promise<{ allAttachmentsRemoved: boolean; }>

Since: 7.0.0


open()

open() => Promise<{ openedWidget: boolean; }>

Open widget

Returns: Promise<{ openedWidget: boolean; }>

Since: 7.0.0


openNews(...)

openNews(options: { showBackButton?: boolean; }) => Promise<{ openedNews: boolean; }>

Open news

Param Type
options { showBackButton?: boolean; }

Returns: Promise<{ openedNews: boolean; }>

Since: 8.4.0


openNewsArticle(...)

openNewsArticle(options: { articleId: string; showBackButton?: boolean; }) => Promise<{ opened: boolean; }>

Open news article

Param Type
options { articleId: string; showBackButton?: boolean; }

Returns: Promise<{ opened: boolean; }>

Since: 8.4.0


openHelpCenter(...)

openHelpCenter(options: { showBackButton?: boolean; }) => Promise<{ opened: boolean; }>

Open help center

Param Type
options { showBackButton?: boolean; }

Returns: Promise<{ opened: boolean; }>

Since: 8.4.0


openHelpCenterArticle(...)

openHelpCenterArticle(options: { articleId: string; showBackButton?: boolean; }) => Promise<{ opened: boolean; }>

Open help center article

Param Type
options { articleId: string; showBackButton?: boolean; }

Returns: Promise<{ opened: boolean; }>

Since: 8.4.0


openHelpCenterCollection(...)

openHelpCenterCollection(options: { collectionId: string; showBackButton?: boolean; }) => Promise<{ opened: boolean; }>

Open help center collection

Param Type
options { collectionId: string; showBackButton?: boolean; }

Returns: Promise<{ opened: boolean; }>

Since: 8.4.0


searchHelpCenter(...)

searchHelpCenter(options: { term: string; showBackButton?: boolean; }) => Promise<{ opened: boolean; }>

Search help center

Param Type
options { term: string; showBackButton?: boolean; }

Returns: Promise<{ opened: boolean; }>

Since: 8.4.0


openFeatureRequests(...)

openFeatureRequests(options: { showBackButton?: boolean; }) => Promise<{ openedFeatureRequests: boolean; }>

Open feature requests

Param Type
options { showBackButton?: boolean; }

Returns: Promise<{ openedFeatureRequests: boolean; }>

Since: 8.4.0


close()

close() => Promise<{ closedWidget: boolean; }>

Close widget

Returns: Promise<{ closedWidget: boolean; }>

Since: 7.0.0


isOpened()

isOpened() => Promise<{ isOpened: boolean; }>

Check widget status code

Returns: Promise<{ isOpened: boolean; }>

Since: 7.0.0


startFeedbackFlow(...)

startFeedbackFlow(options: { feedbackFlow?: string; showBackButton?: boolean; }) => Promise<{ startedFeedbackFlow: boolean; }>

Start feedback flow

Param Type
options { feedbackFlow?: string; showBackButton?: boolean; }

Returns: Promise<{ startedFeedbackFlow: boolean; }>

Since: 7.0.0


startClassicForm(...)

startClassicForm(options: { formId?: string; showBackButton?: boolean; }) => Promise<{ classicFormStarted: boolean; }>

Start a classic form

Param Type
options { formId?: string; showBackButton?: boolean; }

Returns: Promise<{ classicFormStarted: boolean; }>

Since: 13.1.0


startConversation(...)

startConversation(options: { showBackButton?: boolean; }) => Promise<{ conversationStarted: boolean; }>

Start a new conversation

Param Type
options { showBackButton?: boolean; }

Returns: Promise<{ conversationStarted: boolean; }>

Since: 13.1.0


openConversation(...)

openConversation(options: { showBackButton?: boolean; }) => Promise<{ conversationsOpened: boolean; }>

Opens the conversations tab.

Param Type
options { showBackButton?: boolean; }

Returns: Promise<{ conversationsOpened: boolean; }>

Since: 13.9.0


startBot(...)

startBot(options: { botId?: string; showBackButton?: boolean; }) => Promise<{ startedBot: boolean; }>

Start bot

Param Type
options { botId?: string; showBackButton?: boolean; }

Returns: Promise<{ startedBot: boolean; }>

Since: 10.0.3


showFeedbackButton(...)

showFeedbackButton(options: { show?: boolean; }) => Promise<{ feedbackButtonShown: boolean; }>

Show or hide the feedback button.

Param Type
options { show?: boolean; }

Returns: Promise<{ feedbackButtonShown: boolean; }>

Since: 8.0.0


setDisableInAppNotifications(...)

setDisableInAppNotifications(options: { disableInAppNotifications?: boolean; }) => Promise<{ inAppNotificationsDisabled: boolean; }>

Disable in app notifications.

Param Type
options { disableInAppNotifications?: boolean; }

Returns: Promise<{ inAppNotificationsDisabled: boolean; }>

Since: 8.6.1


setLanguage(...)

setLanguage(options: { languageCode: string; }) => Promise<{ setLanguage: string; }>

Set Language

Param Type
options { languageCode: string; }

Returns: Promise<{ setLanguage: string; }>

Since: 7.0.0


disableConsoleLogOverwrite()

disableConsoleLogOverwrite() => Promise<{ consoleLogDisabled: boolean; }>

Disable console log overwrite

Returns: Promise<{ consoleLogDisabled: boolean; }>

Since: 7.0.0


enableDebugConsoleLog()

enableDebugConsoleLog() => Promise<{ debugConsoleLogEnabled: boolean; }>

Enable debug console log

Returns: Promise<{ debugConsoleLogEnabled: boolean; }>

Since: 7.0.0


Interfaces

Object

Provides functionality common to all JavaScript objects.

Prop Type Description
constructor Function The initial value of Object.prototype.constructor is the standard built-in Object constructor.
Method Signature Description
toString () => string Returns a string representation of an object.
toLocaleString () => string Returns a date converted to a string using the current locale.
valueOf () => Object Returns the primitive value of the specified object.
hasOwnProperty (v: PropertyKey) => boolean Determines whether an object has a property with the specified name.
isPrototypeOf (v: Object) => boolean Determines whether an object exists in another object's prototype chain.
propertyIsEnumerable (v: PropertyKey) => boolean Determines whether a specified property is enumerable.

Function

Creates a new function.

Prop Type
prototype any
length number
arguments any
caller Function
Method Signature Description
apply (this: Function, thisArg: any, argArray?: any) => any Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
call (this: Function, thisArg: any, ...argArray: any[]) => any Calls a method of an object, substituting another object for the current object.
bind (this: Function, thisArg: any, ...argArray: any[]) => any For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.
toString () => string Returns a string representation of a function.

FunctionDeclaration

Prop Type Description
id Identifier It is null when a function declaration is a part of the export default function statement

Identifier

Prop Type
type 'Identifier'
name string

FunctionExpression

Prop Type
id Identifier | null
type 'FunctionExpression'
body BlockStatement

BlockStatement

Prop Type
type 'BlockStatement'
body Statement[]
innerComments Comment[]

ExpressionStatement

Prop Type
type 'ExpressionStatement'
expression Expression

ExpressionMap

Prop Type
ArrayExpression ArrayExpression
ArrowFunctionExpression ArrowFunctionExpression
AssignmentExpression AssignmentExpression
AwaitExpression AwaitExpression
BinaryExpression BinaryExpression
CallExpression CallExpression
ChainExpression ChainExpression
ClassExpression ClassExpression
ConditionalExpression ConditionalExpression
FunctionExpression FunctionExpression
Identifier Identifier
ImportExpression ImportExpression
Literal Literal
LogicalExpression LogicalExpression
MemberExpression MemberExpression
MetaProperty MetaProperty
NewExpression NewExpression
ObjectExpression ObjectExpression
SequenceExpression SequenceExpression
TaggedTemplateExpression TaggedTemplateExpression
TemplateLiteral TemplateLiteral
ThisExpression ThisExpression
UnaryExpression UnaryExpression
UpdateExpression UpdateExpression
YieldExpression YieldExpression

ArrayExpression

Prop Type
type 'ArrayExpression'
elements Array<Expression | SpreadElement | null>

Array

Prop Type Description
length number Gets or sets the length of the array. This is a number one higher than the highest index in the array.
Method Signature Description
toString () => string Returns a string representation of an array.
toLocaleString () => string Returns a string representation of an array. The elements are converted to string using their toLocalString methods.
pop () => T | undefined Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
push (...items: T[]) => number Appends new elements to the end of an array, and returns the new length of the array.
concat (...items: ConcatArray<T>[]) => T[] Combines two or more arrays. This method returns a new array without modifying any existing arrays.
concat (...items: (T | ConcatArray<T>)[]) => T[] Combines two or more arrays. This method returns a new array without modifying any existing arrays.
join (separator?: string | undefined) => string Adds all the elements of an array into a string, separated by the specified separator string.
reverse () => T[] Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
shift () => T | undefined Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
slice (start?: number | undefined, end?: number | undefined) => T[] Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.
sort (compareFn?: ((a: T, b: T) => number) | undefined) => this Sorts an array in place. This method mutates the array and returns a reference to the same array.
splice (start: number, deleteCount?: number | undefined) => T[] Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
splice (start: number, deleteCount: number, ...items: T[]) => T[] Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
unshift (...items: T[]) => number Inserts new elements at the start of an array, and returns the new length of the array.
indexOf (searchElement: T, fromIndex?: number | undefined) => number Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
lastIndexOf (searchElement: T, fromIndex?: number | undefined) => number Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
every <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => this is S[] Determines whether all the members of an array satisfy the specified test.
every (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean Determines whether all the members of an array satisfy the specified test.
some (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean Determines whether the specified callback function returns true for any element of an array.
forEach (callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void Performs the specified action for each element in an array.
map <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] Calls a defined callback function on each element of an array, and returns an array that contains the results.
filter <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => S[] Returns the elements of an array that meet the condition specified in a callback function.
filter (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => T[] Returns the elements of an array that meet the condition specified in a callback function.
reduce (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
reduce (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T
reduce <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
reduceRight (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
reduceRight (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T
reduceRight <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

ConcatArray

Prop Type
length number
Method Signature
join (separator?: string | undefined) => string
slice (start?: number | undefined, end?: number | undefined) => T[]

SpreadElement

Prop Type
type 'SpreadElement'
argument Expression

ArrowFunctionExpression

Prop Type
type 'ArrowFunctionExpression'
expression boolean
body Expression | BlockStatement

AssignmentExpression

Prop Type
type 'AssignmentExpression'
operator AssignmentOperator
left Pattern
right Expression

ObjectPattern

Prop Type
type 'ObjectPattern'
properties Array<AssignmentProperty | RestElement>

AssignmentProperty

Prop Type
value Pattern
kind 'init'
method boolean

RestElement

Prop Type
type 'RestElement'
argument Pattern

ArrayPattern

Prop Type
type 'ArrayPattern'
elements Array<Pattern | null>

AssignmentPattern

Prop Type
type 'AssignmentPattern'
left Pattern
right Expression

MemberExpression

Prop Type
type 'MemberExpression'
object Expression | Super
property Expression | PrivateIdentifier
computed boolean
optional boolean

Super

Prop Type
type 'Super'

PrivateIdentifier

Prop Type
type 'PrivateIdentifier'
name string

AwaitExpression

Prop Type
type 'AwaitExpression'
argument Expression

BinaryExpression

Prop Type
type 'BinaryExpression'
operator BinaryOperator
left Expression | PrivateIdentifier
right Expression

SimpleCallExpression

Prop Type
type 'CallExpression'
optional boolean

NewExpression

Prop Type
type 'NewExpression'

ChainExpression

Prop Type
type 'ChainExpression'
expression ChainElement

ClassExpression

Prop Type
type 'ClassExpression'
id Identifier | null

ConditionalExpression

Prop Type
type 'ConditionalExpression'
test Expression
alternate Expression
consequent Expression

ImportExpression

Prop Type
type 'ImportExpression'
source Expression
options Expression | null

SimpleLiteral

Prop Type
type 'Literal'
value string | number | boolean | null
raw string

RegExpLiteral

Prop Type
type 'Literal'
value RegExp | null
regex { pattern: string; flags: string; }
raw string

RegExp

Prop Type Description
source string Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal.
global boolean Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only.
ignoreCase boolean Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only.
multiline boolean Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only.
lastIndex number
Method Signature Description
exec (string: string) => RegExpExecArray | null Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
test (string: string) => boolean Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
compile () => this

RegExpExecArray

Prop Type
index number
input string

BigIntLiteral

Prop Type
type 'Literal'
value bigint | null
bigint string
raw string

LogicalExpression

Prop Type
type 'LogicalExpression'
operator LogicalOperator
left Expression
right Expression

MetaProperty

Prop Type
type 'MetaProperty'
meta Identifier
property Identifier

ObjectExpression

Prop Type
type 'ObjectExpression'
properties Array<Property | SpreadElement>

Property

Prop Type
type 'Property'
key Expression | PrivateIdentifier
value ClassExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | Identifier | ImportExpression | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern
kind 'init' | 'get' | 'set'
method boolean
shorthand boolean
computed boolean

SequenceExpression

Prop Type
type 'SequenceExpression'
expressions Expression[]

TaggedTemplateExpression

Prop Type
type 'TaggedTemplateExpression'
tag Expression
quasi TemplateLiteral

TemplateLiteral

Prop Type
type 'TemplateLiteral'
quasis TemplateElement[]
expressions Expression[]

TemplateElement

Prop Type
type 'TemplateElement'
tail boolean
value { cooked?: string | null; raw: string; }

ThisExpression

Prop Type
type 'ThisExpression'

UnaryExpression

Prop Type
type 'UnaryExpression'
operator UnaryOperator
prefix true
argument Expression

UpdateExpression

Prop Type
type 'UpdateExpression'
operator UpdateOperator
argument Expression
prefix boolean

YieldExpression

Prop Type
type 'YieldExpression'
argument Expression | null
delegate boolean

StaticBlock

Prop Type
type 'StaticBlock'

EmptyStatement

Prop Type
type 'EmptyStatement'

DebuggerStatement

Prop Type
type 'DebuggerStatement'

WithStatement

Prop Type
type 'WithStatement'
object Expression
body Statement

ReturnStatement

Prop Type
type 'ReturnStatement'
argument Expression | null

LabeledStatement

Prop Type
type 'LabeledStatement'
label Identifier
body Statement

BreakStatement

Prop Type
type 'BreakStatement'
label Identifier | null

ContinueStatement

Prop Type
type 'ContinueStatement'
label Identifier | null

IfStatement

Prop Type
type 'IfStatement'
test Expression
consequent Statement
alternate Statement | null

SwitchStatement

Prop Type
type 'SwitchStatement'
discriminant Expression
cases SwitchCase[]

SwitchCase

Prop Type
type 'SwitchCase'
test Expression | null
consequent Statement[]

ThrowStatement

Prop Type
type 'ThrowStatement'
argument Expression

TryStatement

Prop Type
type 'TryStatement'
block BlockStatement
handler CatchClause | null
finalizer BlockStatement | null

CatchClause

Prop Type
type 'CatchClause'
param Pattern | null
body BlockStatement

WhileStatement

Prop Type
type 'WhileStatement'
test Expression
body Statement

DoWhileStatement

Prop Type
type 'DoWhileStatement'
body Statement
test Expression

ForStatement

Prop Type
type 'ForStatement'
init Expression | VariableDeclaration | null
test Expression | null
update Expression | null
body Statement

VariableDeclaration

Prop Type
type 'VariableDeclaration'
declarations VariableDeclarator[]
kind 'var' | 'let' | 'const'

VariableDeclarator

Prop Type
type 'VariableDeclarator'
id Pattern
init Expression | null

ForInStatement

Prop Type
type 'ForInStatement'

ForOfStatement

Prop Type
type 'ForOfStatement'
await boolean

ClassDeclaration

Prop Type Description
id Identifier It is null when a class declaration is a part of the export default class statement

Comment

Prop Type
type 'Line' | 'Block'
value string

GleapEventMessage

Prop Type
name string
data any

Boolean

Method Signature Description
valueOf () => boolean Returns the primitive value of the specified object.

Type Aliases

PropertyKey

string | number | symbol

Function

FunctionDeclaration | FunctionExpression | ArrowFunctionExpression

Statement

ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration

Expression

ExpressionMap[keyof ExpressionMap]

AssignmentOperator

"=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??="

Pattern

Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression

BinaryOperator

"==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof"

CallExpression

SimpleCallExpression | NewExpression

ChainElement

SimpleCallExpression | MemberExpression

Literal

SimpleLiteral | RegExpLiteral | BigIntLiteral

LogicalOperator

"||" | "&&" | "??"

UnaryOperator

"-" | "+" | "!" | "~" | "typeof" | "void" | "delete"

UpdateOperator

"++" | "--"

Declaration

FunctionDeclaration | VariableDeclaration | ClassDeclaration

GleapEventCallback

(message: GleapEventMessage | null, err?: any): void

CallbackID

string