Padloc Logo Docs & Resources

Class: StubPlatform

platform.StubPlatform

Stub implementation of the Platform interface. Useful for testing

Implements

Constructors

constructor

new StubPlatform()

Properties

biometricKeyStore

biometricKeyStore: StubBiometricKeyStore

Implementation of

Platform.biometricKeyStore

Defined in

core/src/platform.ts:140


crypto

crypto: StubCryptoProvider

Implementation of

Platform.crypto

Defined in

core/src/platform.ts:138


platformAuthType

Readonly platformAuthType: null | AuthType = null

Implementation of

Platform.platformAuthType

Defined in

core/src/platform.ts:208


storage

storage: Storage

Implementation of

Platform.storage

Defined in

core/src/platform.ts:139

Accessors

supportedAuthTypes

get supportedAuthTypes(): AuthType[]

Returns

AuthType[]

Implementation of

Platform.supportedAuthTypes

Defined in

core/src/platform.ts:142

Methods

completeAuthRequest

completeAuthRequest(_req): Promise<{ accountStatus: AccountStatus ; deviceTrusted: boolean ; email: string ; legacyData?: PBES2Container ; provisioning: AccountProvisioning ; token: string }>

Parameters

Name Type
_req StartAuthRequestResponse

Returns

Promise<{ accountStatus: AccountStatus ; deviceTrusted: boolean ; email: string ; legacyData?: PBES2Container ; provisioning: AccountProvisioning ; token: string }>

Implementation of

Platform.completeAuthRequest

Defined in

core/src/platform.ts:197


composeEmail

composeEmail(_addr, _subject, _message): Promise<void>

Parameters

Name Type
_addr string
_subject string
_message string

Returns

Promise<void>

Implementation of

Platform.composeEmail

Defined in

core/src/platform.ts:168


getClipboard

getClipboard(): Promise<string>

Retrieves the current text from the system clipboard

Returns

Promise<string>

Implementation of

Platform.getClipboard

Defined in

core/src/platform.ts:150


getDeviceInfo

getDeviceInfo(): Promise<DeviceInfo>

Get information about the current device

Returns

Promise<DeviceInfo>

Implementation of

Platform.getDeviceInfo

Defined in

core/src/platform.ts:155


getPlatformAuthToken

getPlatformAuthToken(_purpose): Promise<string>

Parameters

Name Type
_purpose AuthPurpose[]

Returns

Promise<string>

Implementation of

Platform.getPlatformAuthToken

Defined in

core/src/platform.ts:218


openExternalUrl

openExternalUrl(_url): void

Parameters

Name Type
_url string

Returns

void

Implementation of

Platform.openExternalUrl

Defined in

core/src/platform.ts:172


registerAuthenticator

registerAuthenticator(_opts): Promise<string>

Parameters

Name Type
_opts Object
_opts.data? any
_opts.device? DeviceInfo
_opts.purposes AuthPurpose[]
_opts.type AuthType

Returns

Promise<string>

Implementation of

Platform.registerAuthenticator

Defined in

core/src/platform.ts:178


registerPlatformAuthenticator

registerPlatformAuthenticator(_purpose): Promise<string>

Parameters

Name Type
_purpose AuthPurpose[]

Returns

Promise<string>

Implementation of

Platform.registerPlatformAuthenticator

Defined in

core/src/platform.ts:214


saveFile

saveFile(_name, _type, _contents): Promise<void>

Parameters

Name Type
_name string
_type string
_contents Uint8Array

Returns

Promise<void>

Implementation of

Platform.saveFile

Defined in

core/src/platform.ts:176


scanQR

scanQR(): Promise<string>

Returns

Promise<string>

Implementation of

Platform.scanQR

Defined in

core/src/platform.ts:159


setClipboard

setClipboard(_val): Promise<void>

Copies the given text to the system clipboard

Parameters

Name Type
_val string

Returns

Promise<void>

Implementation of

Platform.setClipboard

Defined in

core/src/platform.ts:146


startAuthRequest

startAuthRequest(_opts): Promise<StartAuthRequestResponse>

Parameters

Name Type
_opts Object
_opts.authenticatorId? string
_opts.authenticatorIndex? number
_opts.email? string
_opts.purpose AuthPurpose
_opts.type? AuthType

Returns

Promise<StartAuthRequestResponse>

Implementation of

Platform.startAuthRequest

Defined in

core/src/platform.ts:187


stopScanQR

stopScanQR(): Promise<void>

Returns

Promise<void>

Implementation of

Platform.stopScanQR

Defined in

core/src/platform.ts:164


supportsPlatformAuthenticator

supportsPlatformAuthenticator(): Promise<boolean>

Returns

Promise<boolean>

Implementation of

Platform.supportsPlatformAuthenticator

Defined in

core/src/platform.ts:210