1 import type { WasmGeneratePasskeyResponse, WasmResolvePasskeyChallengeResponse } from '@protontech/pass-rust-core';
3 import type { SelectedItem } from '@proton/pass/types';
4 import type { Passkey } from '@proton/pass/types/protobuf/item-v1';
5 import type { SanitizedBuffers } from '@proton/pass/utils/buffer/sanitization';
7 export type SanitizedPublicKeyCreate = SanitizedBuffers<PublicKeyCredentialCreationOptions>;
8 export type SanitizedPublicKeyRequest = SanitizedBuffers<PublicKeyCredentialRequestOptions>;
9 export type SanitizedPasskey = SanitizedBuffers<Passkey>;
10 export type SelectedPasskey = SelectedItem & { name: string; username: string; credentialId: string };
12 type WebAuthnIntercept<T> = { intercept: false } | { intercept: true; response: T };
14 export type PasskeyQueryPayload = { credentialIds: string[]; domain: string };
16 export type PasskeyCreatePayload = { domain: string; request: string };
17 export type PasskeyCreateResponse = WebAuthnIntercept<WasmGeneratePasskeyResponse>;
19 export type PasskeyGetPayload = { domain: string; request: string; passkey?: SelectedPasskey };
20 export type PasskeyGetResponse = WebAuthnIntercept<WasmResolvePasskeyChallengeResponse>;