mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[duo_web_sdk] Add new typing for duo_web_sdk (#41887)
* Add new typing for duo_web_sdk * Fix functions
This commit is contained in:
committed by
Wesley Wigham
parent
623e54f1e7
commit
e21cf45ff1
@@ -0,0 +1,21 @@
|
||||
import * as Duo from "duo_web_sdk";
|
||||
|
||||
Duo.init({
|
||||
host: "http://example.com",
|
||||
sig_request: "sig_request",
|
||||
iframe: "iframe_id",
|
||||
iframeContainer: "container_id",
|
||||
iframeAttributes: {
|
||||
title: "title",
|
||||
height: "200px",
|
||||
width: "200px",
|
||||
},
|
||||
post_action: "/post_destination",
|
||||
post_argument: "post_argument",
|
||||
submit_callback: (duo_form: HTMLFormElement) => duo_form,
|
||||
});
|
||||
|
||||
Duo._onReady(() => {});
|
||||
Duo._parseSigRequest("sig");
|
||||
Duo._isDuoMessage(new MessageEvent("event"));
|
||||
Duo._doPostBack("response");
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for non-npm package duo_web_sdk-browser 2.7
|
||||
// Project: https://github.com/duosecurity/duo_web_sdk
|
||||
// Definitions by: Low Heok Hong <https://github.com/lhhong>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace Duo;
|
||||
|
||||
export interface InitOptions {
|
||||
host: string;
|
||||
sig_request: string;
|
||||
iframe?: string | HTMLIFrameElement;
|
||||
iframeContainer?: string | HTMLElement;
|
||||
iframeAttributes?: object;
|
||||
post_action?: string;
|
||||
post_argument?: string;
|
||||
submit_callback?: (duo_form: HTMLFormElement) => void;
|
||||
}
|
||||
|
||||
export interface ParsedSig {
|
||||
sigRequest: string;
|
||||
duoSig: string;
|
||||
appSig: string;
|
||||
}
|
||||
|
||||
export function init(options: InitOptions): void;
|
||||
|
||||
export function _onReady(callback: () => void): void;
|
||||
export function _parseSigRequest(sig: string): ParsedSig;
|
||||
export function _isDuoMessage(event: MessageEvent): boolean;
|
||||
export function _doPostBack(response: string): void;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"duo_web_sdk-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user