From 1e769c84de46447c914f438c3ab59ecfb778b7e0 Mon Sep 17 00:00:00 2001 From: Timur Manyanov Date: Mon, 29 Oct 2018 21:56:57 +0100 Subject: [PATCH] Add makeup-floating-label definitions --- types/makeup-floating-label/index.d.ts | 12 +++++++++ .../makeup-floating-label-tests.ts | 9 +++++++ types/makeup-floating-label/tsconfig.json | 25 +++++++++++++++++++ types/makeup-floating-label/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/makeup-floating-label/index.d.ts create mode 100644 types/makeup-floating-label/makeup-floating-label-tests.ts create mode 100644 types/makeup-floating-label/tsconfig.json create mode 100644 types/makeup-floating-label/tslint.json diff --git a/types/makeup-floating-label/index.d.ts b/types/makeup-floating-label/index.d.ts new file mode 100644 index 0000000000..7b35349554 --- /dev/null +++ b/types/makeup-floating-label/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for makeup-floating-label 0.0 +// Project: https://github.com/makeup-js/makeup-floating-label#readme +// Definitions by: Timur Manyanov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +declare class FloatingLabel { + constructor(el: any, userOptions?: any); + refresh(): void; +} + +export = FloatingLabel; diff --git a/types/makeup-floating-label/makeup-floating-label-tests.ts b/types/makeup-floating-label/makeup-floating-label-tests.ts new file mode 100644 index 0000000000..3883e4135f --- /dev/null +++ b/types/makeup-floating-label/makeup-floating-label-tests.ts @@ -0,0 +1,9 @@ +import FloatingLabel = require('makeup-floating-label'); + +const widgetEls = document.querySelectorAll('.floating-label'); + +widgetEls.forEach((el: Element) => { + const widget = new FloatingLabel(el); + + widget.refresh(); +}); diff --git a/types/makeup-floating-label/tsconfig.json b/types/makeup-floating-label/tsconfig.json new file mode 100644 index 0000000000..c7fed3a8c4 --- /dev/null +++ b/types/makeup-floating-label/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom", + "dom.iterable" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "makeup-floating-label-tests.ts" + ] +} diff --git a/types/makeup-floating-label/tslint.json b/types/makeup-floating-label/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/makeup-floating-label/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }