mirror of
https://github.com/go-gitea/u2f-api.git
synced 2026-07-01 20:24:01 -04:00
Added TypeScript typings
This commit is contained in:
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
export declare type CancellablePromise<T> = Promise<T> & {
|
||||
cancel(): void;
|
||||
};
|
||||
export declare type NotYetTyped = { [ key: string ]: any; };
|
||||
export declare type RegisterRequest = NotYetTyped;
|
||||
export declare type SignRequest = NotYetTyped;
|
||||
export declare type RegisterResponse = NotYetTyped;
|
||||
export declare type SignResponse = NotYetTyped;
|
||||
export declare enum ErrorCodesEnum {
|
||||
CANCELLED = -1,
|
||||
OK = 0,
|
||||
OTHER_ERROR = 1,
|
||||
BAD_REQUEST = 2,
|
||||
CONFIGURATION_UNSUPPORTED = 3,
|
||||
DEVICE_INELIGIBLE = 4,
|
||||
TIMEOUT = 5,
|
||||
}
|
||||
export declare const ErrorNames: {
|
||||
"-1": string;
|
||||
"0": string;
|
||||
"1": string;
|
||||
"2": string;
|
||||
"3": string;
|
||||
"4": string;
|
||||
"5": string;
|
||||
};
|
||||
export interface API {
|
||||
isSupported: () => CancellablePromise<boolean>;
|
||||
ensureSupport: () => CancellablePromise<void>;
|
||||
register: (registerRequests: RegisterRequest | ReadonlyArray<RegisterRequest>, signRequests?: SignRequest | ReadonlyArray<SignRequest>, timeout?: number) => CancellablePromise<RegisterResponse>;
|
||||
sign: (signRequests: SignRequest | ReadonlyArray<SignRequest>, timeout?: number) => CancellablePromise<SignResponse>;
|
||||
ErrorCodes: ErrorCodesEnum;
|
||||
}
|
||||
export declare type ExporterType = ((promiseImplementation: PromiseConstructorLike) => API) & API;
|
||||
declare const _default: ExporterType;
|
||||
export default _default;
|
||||
+2
-1
@@ -17,5 +17,6 @@
|
||||
"fido",
|
||||
"yubikey",
|
||||
"promise"
|
||||
]
|
||||
],
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user