From ace7dbcd8b4b921b0cf81197b265e973eb34fd21 Mon Sep 17 00:00:00 2001 From: Timur Manyanov Date: Mon, 22 Oct 2018 19:15:39 +0200 Subject: [PATCH] Add makeup-keyboard-trap definitions --- types/makeup-keyboard-trap/index.d.ts | 11 +++++++++ .../makeup-keyboard-trap-tests.ts | 7 ++++++ types/makeup-keyboard-trap/tsconfig.json | 24 +++++++++++++++++++ types/makeup-keyboard-trap/tslint.json | 1 + 4 files changed, 43 insertions(+) create mode 100644 types/makeup-keyboard-trap/index.d.ts create mode 100644 types/makeup-keyboard-trap/makeup-keyboard-trap-tests.ts create mode 100644 types/makeup-keyboard-trap/tsconfig.json create mode 100644 types/makeup-keyboard-trap/tslint.json diff --git a/types/makeup-keyboard-trap/index.d.ts b/types/makeup-keyboard-trap/index.d.ts new file mode 100644 index 0000000000..4645d57e2c --- /dev/null +++ b/types/makeup-keyboard-trap/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for makeup-keyboard-trap 0.1 +// Project: https://github.com/makeup-js/makeup-keyboard-trap#readme +// Definitions by: Timur Manyanov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export function refresh(): any; + +export function trap(el: any): any; + +export function untrap(): any; diff --git a/types/makeup-keyboard-trap/makeup-keyboard-trap-tests.ts b/types/makeup-keyboard-trap/makeup-keyboard-trap-tests.ts new file mode 100644 index 0000000000..0f7687d750 --- /dev/null +++ b/types/makeup-keyboard-trap/makeup-keyboard-trap-tests.ts @@ -0,0 +1,7 @@ +import { trap, untrap } from 'makeup-keyboard-trap'; + +const widgetEl: HTMLElement | null = document.querySelector('.expander'); + +trap(widgetEl); + +untrap(); diff --git a/types/makeup-keyboard-trap/tsconfig.json b/types/makeup-keyboard-trap/tsconfig.json new file mode 100644 index 0000000000..0e4c00274f --- /dev/null +++ b/types/makeup-keyboard-trap/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "makeup-keyboard-trap-tests.ts" + ] +} diff --git a/types/makeup-keyboard-trap/tslint.json b/types/makeup-keyboard-trap/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/makeup-keyboard-trap/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }