0.2.1 • Published 10 months ago

@salesforce/lightning-types v0.2.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
10 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/industriesEducationPublicApiThe lightning/industriesEducationPublicApi module includes APIs to create Constituent Role and update Benefit Assignment records.
lightning/loggerLogs the event data from the component.
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.

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.2.1

10 months ago

0.2.0

10 months ago

0.1.0

10 months ago

0.0.1-alpha.1

1 year ago

0.0.1-alpha.0

1 year ago