diff --git a/packages/cozy-device-helper/src/flagship.ts b/packages/cozy-device-helper/src/flagship.ts index 80730fc610..8814d7ccbc 100644 --- a/packages/cozy-device-helper/src/flagship.ts +++ b/packages/cozy-device-helper/src/flagship.ts @@ -16,6 +16,7 @@ export interface FlagshipMetadata { biometry_type?: BiometryType immersive?: boolean navbarHeight?: number + offline_available?: boolean platform?: Record route?: FlagshipRoutes settings_PINEnabled?: boolean @@ -40,3 +41,6 @@ export const getFlagshipMetadata = (): FlagshipMetadata => export const isFlagshipApp = (): boolean => getGlobalWindow()?.cozy?.flagship !== undefined + +export const isFlagshipOfflineSupported = (): boolean => + getGlobalWindow()?.cozy?.flagship?.offline_available diff --git a/packages/cozy-device-helper/src/index.ts b/packages/cozy-device-helper/src/index.ts index b15dcb51b5..ca921f2fb8 100644 --- a/packages/cozy-device-helper/src/index.ts +++ b/packages/cozy-device-helper/src/index.ts @@ -21,4 +21,8 @@ export { isCordova } from './cordova' export { nativeLinkOpen } from './link' export { openDeeplinkOrRedirect } from './deeplink' -export { isFlagshipApp, getFlagshipMetadata } from './flagship' +export { + isFlagshipApp, + isFlagshipOfflineSupported, + getFlagshipMetadata +} from './flagship' diff --git a/packages/cozy-intent/src/api/models/methods.ts b/packages/cozy-intent/src/api/models/methods.ts index 227cb49d1d..61447cc71b 100644 --- a/packages/cozy-intent/src/api/models/methods.ts +++ b/packages/cozy-intent/src/api/models/methods.ts @@ -26,6 +26,8 @@ interface _NativeMethodsRegister { ocr: (base64: string) => unknown openAppOSSettings: () => Promise isAvailable: (featureName: string) => Promise + flagshipLinkRequest: (operation: unknown) => Promise + downloadFile: (file: unknown) => Promise } export type NativeMethodsRegister = _NativeMethodsRegister & PostMeDefault