From d2a59b239bce62dfe117c14658ebfd4cd3d94264 Mon Sep 17 00:00:00 2001 From: Max Boguslavsky <521205+maxbogus@users.noreply.github.com> Date: Wed, 2 Oct 2019 23:36:05 +0300 Subject: [PATCH] Added type for normalize-jss (#38728) * added rollup-plugin-peer-deps-external * fixed error * added normalize-jss type * corrected test name and module type * reworked tests * returned back test * fixed test * fixed npm test errors * fixed array type declaration --- types/normalize-jss/index.d.ts | 165 +++++++++++++++++++++ types/normalize-jss/normalize-jss-tests.ts | 3 + types/normalize-jss/tsconfig.json | 24 +++ types/normalize-jss/tslint.json | 1 + 4 files changed, 193 insertions(+) create mode 100644 types/normalize-jss/index.d.ts create mode 100644 types/normalize-jss/normalize-jss-tests.ts create mode 100644 types/normalize-jss/tsconfig.json create mode 100644 types/normalize-jss/tslint.json diff --git a/types/normalize-jss/index.d.ts b/types/normalize-jss/index.d.ts new file mode 100644 index 0000000000..57de3c94ec --- /dev/null +++ b/types/normalize-jss/index.d.ts @@ -0,0 +1,165 @@ +// Type definitions for normalize-jss 4.0 +// Project: https://github.com/cssinjs/normalize-jss +// Definitions by: Max Boguslavskiy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.4 + +export = normalize_jss; + +declare const normalize_jss: { + '@global': { + '::-webkit-file-upload-button': { + appearance: string; + font: string; + }; + '[hidden]': { + display: string; + }; + '[type=checkbox], [type=radio]': { + boxSizing: string; + padding: number; + }; + '[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button': { + height: string; + }; + '[type=search]': { + appearance: string; + outlineOffset: string; + }; + '[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration': { + appearance: string; + }; + a: { + background: string; + textDecorationSkip: string; + }; + 'a:active, a:hover': { + outlineWidth: number; + }; + 'abbr[title]': { + borderBottom: string; + textDecoration: string; + }; + 'article, aside, footer, header, nav, section, figcaption, figure, main': { + display: string; + }; + 'audio, video': { + display: string; + }; + 'audio:not([controls])': { + display: string; + height: number; + }; + 'b, strong': { + fontWeight: string; + }; + body: { + margin: number; + }; + 'button, [type=reset], [type=submit]': { + '-webkit-appearance': string; + }; + 'button, input': { + overflow: string; + }; + 'button, input, optgroup, select, textarea': { + fontFamily: string; + fontSize: string; + lineHeight: string; + margin: number; + }; + 'button, select': { + textTransform: string; + }; + 'button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring': { + outline: string; + }; + 'button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner': { + borderStyle: string; + padding: number; + }; + canvas: { + display: string; + }; + 'code, kbp, samp': { + fontFamily: string; + fontSize: string; + }; + 'details, menu': { + display: string; + }; + dfn: { + fontStyle: string; + }; + fieldset: { + border: string; + margin: number[][]; + padding: string[][]; + }; + h1: { + fontSize: string; + margin: string[][]; + }; + hr: { + boxSizing: string; + height: number; + overflow: string; + }; + html: { + fontFamily: string; + lineHeight: string; + textSizeAdjust: string; + }; + img: { + borderStyle: string; + verticalAlign: string; + }; + legend: { + boxSizing: string; + color: string; + display: string; + maxWidth: string; + padding: number; + whiteSpace: string; + }; + mark: { + backgroundColor: string; + color: string; + }; + pre: { + fontFamily: string; + fontSize: string; + }; + progress: { + display: string; + verticalAlign: string; + }; + small: { + fontSize: string; + }; + sub: { + bottom: string; + }; + 'sub, sup': { + fontSize: string; + lineHeight: number; + position: string; + verticalAlign: string; + }; + summary: { + display: string; + }; + sup: { + top: string; + }; + 'svg:not(:root)': { + overflow: string; + }; + template: { + display: string; + }; + textarea: { + overflow: string; + }; + }; +}; diff --git a/types/normalize-jss/normalize-jss-tests.ts b/types/normalize-jss/normalize-jss-tests.ts new file mode 100644 index 0000000000..56f17bc453 --- /dev/null +++ b/types/normalize-jss/normalize-jss-tests.ts @@ -0,0 +1,3 @@ +import normalize from 'normalize-jss'; + +const test = normalize['@global'].a; diff --git a/types/normalize-jss/tsconfig.json b/types/normalize-jss/tsconfig.json new file mode 100644 index 0000000000..e226646789 --- /dev/null +++ b/types/normalize-jss/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "normalize-jss-tests.ts" + ] +} diff --git a/types/normalize-jss/tslint.json b/types/normalize-jss/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/normalize-jss/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }