Skip to content

Helper types

Ziemniakoss edited this page Oct 10, 2022 · 4 revisions

Helper types are types that normally doesn't exist but they can enhance JavaScript autocomplete.

Salesforce namespaces

Salesforce namespace contains helper types related to Salesforce instance properties, like one that represents Tab API names.

TabApiName

Type containing all existing tab's API names.

/** @type {Salesforce.TabApiName} */

FlowApiName

Type containing all existing flows names. Useful for new component, "lightning-flow".

/** @type {Salesforce.FlowApiName} */

ApplicationApiName

Type containing all existing apps's API names.

/** @type {Salesforce.ApplicationApiName} */

GlobalValueSets sub-namesapce

Namespace containing types representing global picklist values. For example, if you have global picklist value set with API name "MyPicklist", you can use:

/** @type {Salesforce.GlobalValueSets.MyPicklist */
const value = "value from picklist";

Schema namespace

Helper types in this namespace are related to SObjects and its properties.

SObjectApiName

Type containing all API names of SObjects in org/sandbox. Can be used on "objectApiName" property, like this:

/** @type {schema.SObjectApiName} */
@api objectApiName

SObjectsMap

Map in with:

Lightning Namespace

Lightning namespace contains special types that only have meaning in lwc environment.

Navigation Namespace

Page References

All page reference types are stored in special map named PageRefereceTypes. Keys in this map represent specific page reference identifiers.

/** @type {lightning.navigation.PageReferenceTypes["standard__objectPage"]} */
const sobjectPagePageReference = {
}