mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 11:43:26 +08:00
23 lines
651 B
Markdown
23 lines
651 B
Markdown
# BaseCapability
|
|
|
|
Common interface implemented by every mobile native capability. Use `isAvailable()` to gate code paths so the LWC degrades gracefully on unsupported surfaces (desktop, mobile web).
|
|
|
|
```typescript
|
|
/*
|
|
* Copyright (c) 2024, Salesforce, Inc.
|
|
* All rights reserved.
|
|
* For full license text, see the LICENSE.txt file
|
|
*/
|
|
|
|
/**
|
|
* Provide all services with common functionalities.
|
|
*/
|
|
export interface BaseCapability {
|
|
/**
|
|
* Use this function to determine whether the respective service functionality is available.
|
|
* @returns Returns true when used on a supported device and false otherwise.
|
|
*/
|
|
isAvailable(): boolean;
|
|
}
|
|
```
|