From 43a4ba6c2fb64d9cd629e076e0212a7afc775138 Mon Sep 17 00:00:00 2001 From: Serhii Kulykov Date: Mon, 9 Nov 2020 11:22:12 +0200 Subject: [PATCH] feat: add TS definitions for css literals (#100) --- all-imports.d.ts | 10 ++++++++++ badge.d.ts | 3 +++ bower.json | 2 ++ color.d.ts | 7 +++++++ magi-p3-post.js | 11 +++++++++++ mixins/field-button.d.ts | 3 +++ mixins/menu-overlay.d.ts | 3 +++ mixins/overlay.d.ts | 3 +++ mixins/required-field.d.ts | 3 +++ package.json | 2 ++ sizing.d.ts | 3 +++ spacing.d.ts | 3 +++ style.d.ts | 3 +++ typography.d.ts | 5 +++++ 14 files changed, 61 insertions(+) create mode 100644 all-imports.d.ts create mode 100644 badge.d.ts create mode 100644 color.d.ts create mode 100644 magi-p3-post.js create mode 100644 mixins/field-button.d.ts create mode 100644 mixins/menu-overlay.d.ts create mode 100644 mixins/overlay.d.ts create mode 100644 mixins/required-field.d.ts create mode 100644 sizing.d.ts create mode 100644 spacing.d.ts create mode 100644 style.d.ts create mode 100644 typography.d.ts diff --git a/all-imports.d.ts b/all-imports.d.ts new file mode 100644 index 0000000..80f3419 --- /dev/null +++ b/all-imports.d.ts @@ -0,0 +1,10 @@ +export * from './mixins/field-button.js'; +export * from './mixins/menu-overlay.js'; +export * from './mixins/overlay.js'; +export * from './mixins/required-field.js'; +export * from './badge.js'; +export * from './color.js'; +export * from './sizing.js'; +export * from './spacing.js'; +export * from './style.js'; +export * from './typography.js'; diff --git a/badge.d.ts b/badge.d.ts new file mode 100644 index 0000000..c6fc494 --- /dev/null +++ b/badge.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const badge: CSSResult; diff --git a/bower.json b/bower.json index a60d23a..1bb3ac5 100644 --- a/bower.json +++ b/bower.json @@ -33,6 +33,8 @@ "license": "Apache-2.0", "ignore": [ "**/.*", + "*.d.ts", + "mixins/*.d.ts", "node_modules", "bower_components", "gulpfile.js", diff --git a/color.d.ts b/color.d.ts new file mode 100644 index 0000000..d089009 --- /dev/null +++ b/color.d.ts @@ -0,0 +1,7 @@ +import {CSSResult} from 'lit-element'; + +export const colorBase: CSSResult; + +export const color: CSSResult; + +export const colorLegacy: CSSResult; diff --git a/magi-p3-post.js b/magi-p3-post.js new file mode 100644 index 0000000..fbc65e8 --- /dev/null +++ b/magi-p3-post.js @@ -0,0 +1,11 @@ +module.exports = { + files: [ + 'all-imports.js' + ], + from: [ + /import '\.\/(.+)\.js';/g + ], + to: [ + `import './$1.js';\nexport * from './$1.js';` + ] +}; diff --git a/mixins/field-button.d.ts b/mixins/field-button.d.ts new file mode 100644 index 0000000..ffef514 --- /dev/null +++ b/mixins/field-button.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const fieldButton: CSSResult; diff --git a/mixins/menu-overlay.d.ts b/mixins/menu-overlay.d.ts new file mode 100644 index 0000000..4814a33 --- /dev/null +++ b/mixins/menu-overlay.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const menuOverlay: CSSResult; diff --git a/mixins/overlay.d.ts b/mixins/overlay.d.ts new file mode 100644 index 0000000..3b14ad2 --- /dev/null +++ b/mixins/overlay.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const overlay: CSSResult; diff --git a/mixins/required-field.d.ts b/mixins/required-field.d.ts new file mode 100644 index 0000000..ed79f7f --- /dev/null +++ b/mixins/required-field.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const requiredField: CSSResult; diff --git a/package.json b/package.json index 4a9c9c9..173dd0d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,9 @@ "homepage": "https://vaadin.com/components", "files": [ "*.js", + "*.d.ts", "mixins/*.js", + "mixins/*.d.ts", "presets/*.js", "!wdio.conf.js" ], diff --git a/sizing.d.ts b/sizing.d.ts new file mode 100644 index 0000000..1682d1b --- /dev/null +++ b/sizing.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const sizing: CSSResult; diff --git a/spacing.d.ts b/spacing.d.ts new file mode 100644 index 0000000..33fbb44 --- /dev/null +++ b/spacing.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const spacing: CSSResult; diff --git a/style.d.ts b/style.d.ts new file mode 100644 index 0000000..0058698 --- /dev/null +++ b/style.d.ts @@ -0,0 +1,3 @@ +import {CSSResult} from 'lit-element'; + +export const style: CSSResult; diff --git a/typography.d.ts b/typography.d.ts new file mode 100644 index 0000000..6762528 --- /dev/null +++ b/typography.d.ts @@ -0,0 +1,5 @@ +import {CSSResult} from 'lit-element'; + +export const font: CSSResult; + +export const typography: CSSResult;