Skip to content

Commit f26a185

Browse files
saschanazsandersn
authored andcommitted
add Web Authentication types (#710)
1 parent 10a86a2 commit f26a185

File tree

3 files changed

+361
-0
lines changed

3 files changed

+361
-0
lines changed

baselines/dom.generated.d.ts

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,34 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions {
133133
processorOptions?: any;
134134
}
135135

136+
interface AuthenticationExtensionsClientInputs {
137+
appid?: string;
138+
authnSel?: AuthenticatorSelectionList;
139+
exts?: boolean;
140+
loc?: boolean;
141+
txAuthGeneric?: txAuthGenericArg;
142+
txAuthSimple?: string;
143+
uvi?: boolean;
144+
uvm?: boolean;
145+
}
146+
147+
interface AuthenticationExtensionsClientOutputs {
148+
appid?: boolean;
149+
authnSel?: boolean;
150+
exts?: AuthenticationExtensionsSupported;
151+
loc?: Coordinates;
152+
txAuthGeneric?: ArrayBuffer;
153+
txAuthSimple?: string;
154+
uvi?: ArrayBuffer;
155+
uvm?: UvmEntries;
156+
}
157+
158+
interface AuthenticatorSelectionCriteria {
159+
authenticatorAttachment?: AuthenticatorAttachment;
160+
requireResidentKey?: boolean;
161+
userVerification?: UserVerificationRequirement;
162+
}
163+
136164
interface BiquadFilterOptions extends AudioNodeOptions {
137165
Q?: number;
138166
detune?: number;
@@ -252,11 +280,13 @@ interface ConvolverOptions extends AudioNodeOptions {
252280
}
253281

254282
interface CredentialCreationOptions {
283+
publicKey?: PublicKeyCredentialCreationOptions;
255284
signal?: AbortSignal;
256285
}
257286

258287
interface CredentialRequestOptions {
259288
mediation?: CredentialMediationRequirement;
289+
publicKey?: PublicKeyCredentialRequestOptions;
260290
signal?: AbortSignal;
261291
}
262292

@@ -1034,6 +1064,52 @@ interface PropertyIndexedKeyframes {
10341064
[property: string]: string | string[] | number | null | (number | null)[] | undefined;
10351065
}
10361066

1067+
interface PublicKeyCredentialCreationOptions {
1068+
attestation?: AttestationConveyancePreference;
1069+
authenticatorSelection?: AuthenticatorSelectionCriteria;
1070+
challenge: BufferSource;
1071+
excludeCredentials?: PublicKeyCredentialDescriptor[];
1072+
extensions?: AuthenticationExtensionsClientInputs;
1073+
pubKeyCredParams: PublicKeyCredentialParameters[];
1074+
rp: PublicKeyCredentialRpEntity;
1075+
timeout?: number;
1076+
user: PublicKeyCredentialUserEntity;
1077+
}
1078+
1079+
interface PublicKeyCredentialDescriptor {
1080+
id: BufferSource;
1081+
transports?: AuthenticatorTransport[];
1082+
type: PublicKeyCredentialType;
1083+
}
1084+
1085+
interface PublicKeyCredentialEntity {
1086+
icon?: string;
1087+
name: string;
1088+
}
1089+
1090+
interface PublicKeyCredentialParameters {
1091+
alg: COSEAlgorithmIdentifier;
1092+
type: PublicKeyCredentialType;
1093+
}
1094+
1095+
interface PublicKeyCredentialRequestOptions {
1096+
allowCredentials?: PublicKeyCredentialDescriptor[];
1097+
challenge: BufferSource;
1098+
extensions?: AuthenticationExtensionsClientInputs;
1099+
rpId?: string;
1100+
timeout?: number;
1101+
userVerification?: UserVerificationRequirement;
1102+
}
1103+
1104+
interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity {
1105+
id?: string;
1106+
}
1107+
1108+
interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
1109+
displayName: string;
1110+
id: BufferSource;
1111+
}
1112+
10371113
interface PushPermissionDescriptor extends PermissionDescriptor {
10381114
name: "push";
10391115
userVisibleOnly?: boolean;
@@ -1762,6 +1838,11 @@ interface WorkletOptions {
17621838
credentials?: RequestCredentials;
17631839
}
17641840

1841+
interface txAuthGenericArg {
1842+
content: ArrayBuffer;
1843+
contentType: string;
1844+
}
1845+
17651846
interface EventListener {
17661847
(evt: Event): void;
17671848
}
@@ -2287,6 +2368,35 @@ declare var AudioWorkletNode: {
22872368
new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode;
22882369
};
22892370

2371+
interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
2372+
readonly authenticatorData: ArrayBuffer;
2373+
readonly signature: ArrayBuffer;
2374+
readonly userHandle: ArrayBuffer | null;
2375+
}
2376+
2377+
declare var AuthenticatorAssertionResponse: {
2378+
prototype: AuthenticatorAssertionResponse;
2379+
new(): AuthenticatorAssertionResponse;
2380+
};
2381+
2382+
interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
2383+
readonly attestationObject: ArrayBuffer;
2384+
}
2385+
2386+
declare var AuthenticatorAttestationResponse: {
2387+
prototype: AuthenticatorAttestationResponse;
2388+
new(): AuthenticatorAttestationResponse;
2389+
};
2390+
2391+
interface AuthenticatorResponse {
2392+
readonly clientDataJSON: ArrayBuffer;
2393+
}
2394+
2395+
declare var AuthenticatorResponse: {
2396+
prototype: AuthenticatorResponse;
2397+
new(): AuthenticatorResponse;
2398+
};
2399+
22902400
interface BarProp {
22912401
readonly visible: boolean;
22922402
}
@@ -11832,6 +11942,18 @@ declare var PromiseRejectionEvent: {
1183211942
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
1183311943
};
1183411944

11945+
interface PublicKeyCredential extends Credential {
11946+
readonly rawId: ArrayBuffer;
11947+
readonly response: AuthenticatorResponse;
11948+
getClientExtensionResults(): AuthenticationExtensionsClientOutputs;
11949+
}
11950+
11951+
declare var PublicKeyCredential: {
11952+
prototype: PublicKeyCredential;
11953+
new(): PublicKeyCredential;
11954+
isUserVerifyingPlatformAuthenticatorAvailable(): Promise<boolean>;
11955+
};
11956+
1183511957
/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
1183611958
interface PushManager {
1183711959
getSubscription(): Promise<PushSubscription | null>;
@@ -19785,6 +19907,12 @@ type ConstrainBoolean = boolean | ConstrainBooleanParameters;
1978519907
type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
1978619908
type PerformanceEntryList = PerformanceEntry[];
1978719909
type VibratePattern = number | number[];
19910+
type COSEAlgorithmIdentifier = number;
19911+
type AuthenticatorSelectionList = AAGUID[];
19912+
type AAGUID = BufferSource;
19913+
type AuthenticationExtensionsSupported = string[];
19914+
type UvmEntry = number[];
19915+
type UvmEntries = UvmEntry[];
1978819916
type AlgorithmIdentifier = string | Algorithm;
1978919917
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1979019918
type BigInteger = Uint8Array;
@@ -19822,8 +19950,11 @@ type WindowProxy = Window;
1982219950
type AlignSetting = "start" | "center" | "end" | "left" | "right";
1982319951
type AnimationPlayState = "idle" | "running" | "paused" | "finished";
1982419952
type AppendMode = "segments" | "sequence";
19953+
type AttestationConveyancePreference = "none" | "indirect" | "direct";
1982519954
type AudioContextLatencyCategory = "balanced" | "interactive" | "playback";
1982619955
type AudioContextState = "suspended" | "running" | "closed";
19956+
type AuthenticatorAttachment = "platform" | "cross-platform";
19957+
type AuthenticatorTransport = "usb" | "nfc" | "ble" | "internal";
1982719958
type AutoKeyword = "auto";
1982819959
type AutomationRate = "a-rate" | "k-rate";
1982919960
type BinaryType = "blob" | "arraybuffer";
@@ -19889,6 +20020,7 @@ type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camer
1988920020
type PermissionState = "granted" | "denied" | "prompt";
1989020021
type PlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse";
1989120022
type PositionAlignSetting = "line-left" | "center" | "line-right" | "auto";
20023+
type PublicKeyCredentialType = "public-key";
1989220024
type PushEncryptionKeyName = "p256dh" | "auth";
1989320025
type PushPermissionState = "denied" | "granted" | "prompt";
1989420026
type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle";
@@ -19944,6 +20076,7 @@ type TextTrackKind = "subtitles" | "captions" | "descriptions" | "chapters" | "m
1994420076
type TextTrackMode = "disabled" | "hidden" | "showing";
1994520077
type TouchType = "direct" | "stylus";
1994620078
type Transport = "usb" | "nfc" | "ble";
20079+
type UserVerificationRequirement = "required" | "preferred" | "discouraged";
1994720080
type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted";
1994820081
type VideoFacingModeEnum = "user" | "environment" | "left" | "right";
1994920082
type VisibilityState = "hidden" | "visible" | "prerender";

0 commit comments

Comments
 (0)