0.8.0 • Published 5 months ago

@salesforce/lightning-types v0.8.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
5 months ago

Salesforce Lightning Types

Public type definitions for packages exposed on the Salesforce Lightning platform.

Installation

First, install the package using your preferred package manager.

npm install @salesforce/lightning-types
# OR
yarn add @salesforce/lightning-types

Next, import the package once, from any TypeScript file in your project. For example, if you have a types directory, you may create a file called salesforce.d.ts.

// types/salesforce.d.ts
import "@salesforce/lightning-types";

Lastly, ensure that the file with the import is included in your tsconfig.json.

{
  "compilerOptions": {
    // ...
  },
  "include": ["src", "types"],
}

Now you can import Salesforce Lightning types!

import LightningInput from "lightning/input";

Installing with LWC

@salesforce/lightning-types does not provide types for the lwc package directly, but instead specifies the package as a peer dependency. This allows you to control which version of lwc you are using. However, not all package managers automatically install peer dependencies; you may need to specify the lwc dependency explicitly.

npm install @salesforce/lightning-types lwc
# OR
yarn add @salesforce/lightning-types lwc

List of Modules

Type definitions for the following modules are included in this package.

ModuleDescription
@salesforce/client/formFactorAccess the form factor of the hardware the browser is running on.
@salesforce/community/basePathGet the section of the site’s URL that comes after the domain.
@salesforce/community/IdGet the ID of the network part of the site for eg., import the ID to pass as a parameter to an API.
@salesforce/site/activeLanguagesThe list of active languages in your Experience Builder site.
@salesforce/site/IdGet the current Experience Builder site Id.
@salesforce/user/IdGet the current user's ID.
@salesforce/user/isGuestIdentify whether the current user is a guest or not.
lightning/alertThe lightning/alert module lets you create an alert modal within your component.
lightning/avatarThe lightning/avatar component represents a visual representation of an object, such as a user or account.
lightning/badgeThe lightning/badge is a label that holds small amounts of information.
lightning/barcodeScannerThe lightning/barcodeScanner component scans barcodes on a mobile device.
lightning/breadcrumbThe lightning/breadcrumb component displays the path of a page relative to a parent page.
lightning/buttonThe lightning/button is a component that represents a button element that executes an action.
lightning/buttonIconThe lightning/buttonIcon component displays an icon-only button.
lightning/buttonIconStatefulThe lightning/buttonIconStateful component displays an icon-only button.
lightning/buttonStatefulThe lightning/buttonStateful component displays an icon-only button.
lightning/cardThe lightning/card is used to apply a stylized container around a grouping of information.
lightning/carouselThe lightning/carousel component displays a collection of images that are displayed one at a time. This component accepts up to 5 lightning-carousel-image components in its default slot.
lightning/carouselImageThe lightning/carouselImage component specifies an image used in lightning-carousel, including description and title.
lightning/checkboxGroupThe lightning/checkboxGroup component represents a checkbox group that enables selection of single or multiple options.
lightning/comboboxThe lightning/combobox component represents a widget that provides an input field that is readonly, accompanied by a dropdown list of selectable options.
lightning/confirmThe lightning/confirm module lets you create a confirm modal within your component.
lightning/dualListboxThe lightning/dualListbox component represents two side-by-side listboxes.
lightning/fileUploadThe lightning/fileUpload component provides an integrated way for users to upload multiple files.
lightning/formattedAddressThe lightning/formattedAddress component displays a formatted address with optional map integration.
lightning/formattedDateTimeThe lightning/formattedDateTime component displays a formatted date and time according to the user's locale and formatting options.
lightning/formattedEmailThe lightning/formattedEmail component displays an email as a hyperlink with the mailto: URL scheme.
lightning/formattedLocationThe lightning/formattedLocation component displays a read-only representation of a latitude and longitude value.
lightning/formattedNameThe lightning/formattedName component displays a formatted name that can include a salutation and suffix.
lightning/formattedNumberThe lightning/formattedNumber component displays formatted numbers for decimals, currency, and percentages.
lightning/formattedPhoneThe lightning/formattedPhone component displays a phone number as a hyperlink with the tel: URL scheme.
lightning/formattedRichTextThe lightning/formatted-rich-text component displays rich text content.
lightning/formattedTextThe lightning/formattedText component displays text with formatting options.
lightning/formattedTimeThe lightning/formattedTime component displays a read-only representation of time in the user's locale format.
lightning/formattedUrlThe lightning/formatted-url component displays a URL as a hyperlink.
lightning/iconThe lightning/icon displays an icon from the Salesforce Lightning Design System or a custom image.
lightning/industriesEducationPublicApiThe lightning/industriesEducationPublicApi module includes APIs to create Constituent Role and update Benefit Assignment records.
lightning/inputAddressThe lightning/inputAddress component represents an address compound field, allowing users to enter and edit address information in a structured format.
lightning/inputFieldThe lightning/inputField component represents an editable input for a Salesforce object field.
lightning/inputlocationThe lightning/inputLocation component represents a geolocation compound field that accepts a latitude and longitude value.
lightning/inputNameThe lightning/inputName component represents a name compound field.
lightning/layoutThe lightning/layout component is a flexible grid system for arranging containers within a page or inside another container.
lightning/layoutItemThe lightning/layoutItem defines content to display within lightning-layout.
lightning/lightningVerticalNavigationThe lightningVerticalNavigation component represents a vertical navigation menu.
lightning/lightningVerticalNavigationItemBadgeThe lightning/lightningVerticalNavigationItemBadge component represents a vertical navigation item with a badge.
lightning/loggerLogs the event data from the component.
lightning/mapThe lightning/map component displays a map with markers for one or more locations.
lightning/mobileCapabilitiesMobile capabilities are JavaScript APIs that make mobile hardware and platform (operating system) features available in JavaScript. They require access to device hardware, platform APIs, or both. Mobile capability APIs are available only when a Lightning web component runs in a supported mobile app on a mobile device.
lightning/modalThe lightning/modal component displays a dialog that focuses the user's attention on a single task or piece of information.
lightning/modalHeaderThe lightning/modalHeader component creates a header to display the heading and tagline at the top of a modal.
lightning/outputFieldThe lightning/outputField component represents a read-only display of a label, help text, and value for a field on a Salesforce object.
lightning/platformResourceLoaderThe lightning/platformResourceLoader component loads resources from the Salesforce platform.
lightning/progressBarThe lightning/progressBar component displays a horizontal or circular progress bar.
lightning/progressIndicatorThe lightning/progressIndicator component displays a sequence of steps in a process, such as a multi-step form.
lightning/progressRingThe lightning/progressRing component displays a circular progress ring to indicate progress.
lightning/progressStepThe lightning/progressStep component represents a single step in a progress indicator.
lightning/promptThe lightning/prompt module lets you create a prompt modal within your component.
lightning/radioGroupThe lightning/radioGroup component represents a group of radio buttons that permit only one button to be selected at a time.
lightning/recordEditFormThe lightning/recordEditForm component creates an editable form for a Salesforce record, supporting create and update operations.
lightning/recordFormThe lightning/recordForm component to quickly create forms to add, view, or update a record.
lightning/recordViewFormThe lightning/recordViewForm component to create a form that displays Salesforce record data for specified fields associated with that record.
lightning/selectThe lightning/select module lets you create a menu of options for single or multiple selection.
lightning/serviceKnowledgeApiWork with view count statistics for knowledge articles.
lightning/spinnerThe lightning/spinner displays an animated spinner image to indicate that a feature is loading.
lightning/tabThe lightning/tab keeps related content in a single container. The tab content displays when a user clicks the tab.
lightning/tabsetThe lightning/tabset displays a tabbed container with multiple content areas, only one of which is visible at a time.
lightning/textareaThe lightning/textarea component represents a multiline text input field.
lightning/toastThe lightning/toast component represents a notification element used to convey a label.
lightning/toast-containerThe lightning/toast-container component represents a container for displaying toast notifications.
lightning/treeThe lightning/tree component displays a nested tree.
lightning/treeItemThe lightning/treeItem component represents an item in a tree structure.
lightning/userConsentCookieThe userConsentCookie provides utility functions that enable you to incorporate the Cookie Consent mechanism in your components.
lightning/verticalNavigationItemThe lightning/verticalNavigationItem represents an item in a vertical navigation menu.
lightning/verticalNavigationItemIconThe lightning/verticalNavigationItemIcon represents a navigation item with an icon in a vertical navigation menu.

Bug Reports

This package solely contains TypeScript type definitions; it is not responsible for the behavior of the APIs it documents. If you encounter any issues, you may post on Salesforce Stack Exchange or open a Salesforce case.

Security

Please report any security issue to security@salesforce.com as soon as it is discovered. This library limits its runtime dependencies in order to reduce the total cost of ownership as much as can be, but all consumers should remain vigilant and have their security stakeholders review all third-party products (3PP) like this one and their dependencies.

License

All rights reserved. See the license in LICENSE.txt for details.

0.3.0

11 months ago

0.8.0

5 months ago

0.5.0

8 months ago

0.4.0

8 months ago

0.7.0

6 months ago

0.6.0

7 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.1-alpha.1

1 year ago

0.0.1-alpha.0

1 year ago