File tree 2 files changed +38
-3
lines changed
2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 23
23
"typescript" : " ^3.5.2"
24
24
},
25
25
"scripts" : {
26
- "build" : " rollup -c" ,
27
- "dev" : " rollup -cw" ,
26
+ "build" : " npm run copy-flow && rollup -c" ,
27
+ "dev" : " npm run link-flow && rollup -cw" ,
28
28
"clean" : " rm -rf dist" ,
29
29
"test" : " jest && npm run lint" ,
30
30
"setup" : " npm install" ,
31
31
"print-schemas" : " npx ts-node script/print-schemas.ts" ,
32
32
"lint" : " tslint --fix --project . && tslint --fix rollup.config.js" ,
33
- "prepack" : " npm run clean && npm run build"
33
+ "prepack" : " npm run clean && npm run build" ,
34
+ "copy-flow" : " mkdir -p dist/ && rm -f dist/index.js.flow && cp src/index.js.flow dist/" ,
35
+ "link-flow" : " mkdir -p dist/ && rm -f dist/index.js.flow && ln -s src/index.js.flow dist/"
34
36
},
35
37
"keywords" : [
36
38
" webauthn" ,
Original file line number Diff line number Diff line change
1
+ /* @flow strict */
2
+
3
+ // For now, we only specify definitions to one layer in Flow.
4
+ // With https://github.com/facebook/flow/issues/7480, it may be practical to mirror our TypeScript typings.
5
+
6
+ export interface CredentialCreationOptionsJSON {
7
+ publicKey: {};
8
+ signal?: AbortSignal;
9
+ }
10
+
11
+ export interface PublicKeyCredentialWithAttestationJSON {
12
+ type: "public-key";
13
+ rawId: string; // base 64
14
+ response: {};
15
+ }
16
+
17
+ declare export function create(requestJSON: CredentialCreationOptionsJSON): Promise<PublicKeyCredentialWithAttestationJSON>;
18
+
19
+ export interface CredentialRequestOptionsJSON {
20
+ unmediated?: boolean;
21
+ mediation?: "silent" | "optional" | "required";
22
+ publicKey: {};
23
+ signal?: AbortSignal;
24
+ }
25
+
26
+ export interface PublicKeyCredentialWithAssertionJSON {
27
+ type: "public-key";
28
+ id: string;
29
+ rawId: string; // base 64
30
+ response: {};
31
+ }
32
+
33
+ declare export function get(requestJSON: CredentialRequestOptionsJSON): Promise<PublicKeyCredentialWithAssertionJSON>;
You can’t perform that action at this time.
0 commit comments