pax_global_header00006660000000000000000000000064145343154410014516gustar00rootroot0000000000000052 comment=fb448e21733ac5cb52523d3b678fdbbe1f9b42f2 csstype-3.1.3/000077500000000000000000000000001453431544100132145ustar00rootroot00000000000000csstype-3.1.3/.eslintrc.js000066400000000000000000000012151453431544100154520ustar00rootroot00000000000000module.exports = { root: true, parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'prettier'], extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], ignorePatterns: ['**/*.d.ts'], rules: { '@typescript-eslint/ban-types': 0, '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/no-empty-interface': 0, '@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/no-non-null-assertion': 0, '@typescript-eslint/no-var-requires': 0, 'no-empty-pattern': 0, 'no-inner-declarations': 0, 'no-undef': 0, 'prettier/prettier': 2, }, }; csstype-3.1.3/.flowconfig000066400000000000000000000004121453431544100153470ustar00rootroot00000000000000[ignore] .*/node_modules/.* .*/__fixtures__/.* [include] [libs] [lints] untyped-import=warn [options] [strict] sketchy-null sketchy-number untyped-type-import unclear-type unsafe-getters-setters nonstrict-import unnecessary-optional-chain unnecessary-invariant csstype-3.1.3/.gitattributes000066400000000000000000000000731453431544100161070ustar00rootroot00000000000000* text=auto index.d.ts merge=ours index.js.flow merge=ours csstype-3.1.3/.github/000077500000000000000000000000001453431544100145545ustar00rootroot00000000000000csstype-3.1.3/.github/workflows/000077500000000000000000000000001453431544100166115ustar00rootroot00000000000000csstype-3.1.3/.github/workflows/checks.yaml000066400000000000000000000025611453431544100207410ustar00rootroot00000000000000name: 'Checks' on: push: # Only run if a generated file was modified paths: - index.d.ts - index.js.flow jobs: do_not_modify_generated_files: name: 'Check which files were modifed' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Check if non-generated files were modified id: other_files uses: tj-actions/changed-files@v32 with: files_ignore: | index.d.ts index.js.flow - uses: LouisBrunner/checks-action@v1.1.1 with: token: ${{ secrets.GITHUB_TOKEN }} name: 'Never modify index.d.ts and index.js.flow directly' # Set status to 'success' if other files were changed, # or 'failure' if only index.d.ts or index.js.flow were changed conclusion: ${{ steps.other_files.outputs.any_changed == 'true' && 'success' || 'failure' }} output: | {"summary":"We detected that you only modified `index.d.ts` and/or `index.js.flow`. **Never modify `index.d.ts` and `index.js.flow` directly. They are generated automatically and committed so that we can easily follow any change it results in.** You probably want to update [MDN's CSS data](https://github.com/mdn/data) or [add a patch](https://github.com/frenic/csstype/blob/master/src/data/patches.ts)."} csstype-3.1.3/.gitignore000066400000000000000000000000161453431544100152010ustar00rootroot00000000000000node_modules/ csstype-3.1.3/.prettierignore000066400000000000000000000001131453431544100162520ustar00rootroot00000000000000index.js.flow index.d.ts package.json package-lock.json src/data/urls.json csstype-3.1.3/.prettierrc000066400000000000000000000001431453431544100153760ustar00rootroot00000000000000{ "arrowParens": "avoid", "printWidth": 120, "singleQuote": true, "trailingComma": "all" } csstype-3.1.3/.travis.yml000066400000000000000000000000511453431544100153210ustar00rootroot00000000000000language: node_js node_js: - 'stable' csstype-3.1.3/.vscode/000077500000000000000000000000001453431544100145555ustar00rootroot00000000000000csstype-3.1.3/.vscode/launch.json000066400000000000000000000006021453431544100167200ustar00rootroot00000000000000{ "configurations": [ { "type": "node", "name": "vscode-jest-tests", "request": "launch", "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", "disableOptimisticBPs": true, "cwd": "${workspaceFolder}", "runtimeExecutable": "npm", "args": ["run", "test", "--", "--runInBand", "--watchAll=false"] } ] } csstype-3.1.3/.vscode/settings.json000066400000000000000000000005421453431544100173110ustar00rootroot00000000000000{ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "editor.formatOnSave": true, "eslint.alwaysShowStatus": true, "eslint.validate": ["javascript", "javascriptreact", "html", "typescript", "typescriptreact"], "files.eol": "\n", "typescript.tsdk": "node_modules/typescript/lib", "jest.jestCommandLine": "npm run test --" } csstype-3.1.3/LICENSE000066400000000000000000000020461453431544100142230ustar00rootroot00000000000000Copyright (c) 2017-2018 Fredrik Nicol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. csstype-3.1.3/README.md000066400000000000000000000244261453431544100145030ustar00rootroot00000000000000# CSSType [![npm](https://img.shields.io/npm/v/csstype.svg)](https://www.npmjs.com/package/csstype) TypeScript and Flow definitions for CSS, generated by [data from MDN](https://github.com/mdn/data). It provides autocompletion and type checking for CSS properties and values. **TypeScript** ```ts import type * as CSS from 'csstype'; const style: CSS.Properties = { colour: 'white', // Type error on property textAlign: 'middle', // Type error on value }; ``` **Flow** ```js // @flow strict import * as CSS from 'csstype'; const style: CSS.Properties<> = { colour: 'white', // Type error on property textAlign: 'middle', // Type error on value }; ``` _Further examples below will be in TypeScript!_ ## Getting started ```sh $ npm install csstype ``` ## Table of content - [Style types](#style-types) - [At-rule types](#at-rule-types) - [Pseudo types](#pseudo-types) - [Generics](#generics) - [Usage](#usage) - [What should I do when I get type errors?](#what-should-i-do-when-i-get-type-errors) - [Version 3.0](#version-30) - [Contributing](#contributing) ## Style types Properties are categorized in different uses and in several technical variations to provide typings that suits as many as possible. | | Default | `Hyphen` | `Fallback` | `HyphenFallback` | | -------------- | -------------------- | -------------------------- | ---------------------------- | ---------------------------------- | | **All** | `Properties` | `PropertiesHyphen` | `PropertiesFallback` | `PropertiesHyphenFallback` | | **`Standard`** | `StandardProperties` | `StandardPropertiesHyphen` | `StandardPropertiesFallback` | `StandardPropertiesHyphenFallback` | | **`Vendor`** | `VendorProperties` | `VendorPropertiesHyphen` | `VendorPropertiesFallback` | `VendorPropertiesHyphenFallback` | | **`Obsolete`** | `ObsoleteProperties` | `ObsoletePropertiesHyphen` | `ObsoletePropertiesFallback` | `ObsoletePropertiesHyphenFallback` | | **`Svg`** | `SvgProperties` | `SvgPropertiesHyphen` | `SvgPropertiesFallback` | `SvgPropertiesHyphenFallback` | Categories: - **All** - Includes `Standard`, `Vendor`, `Obsolete` and `Svg` - **`Standard`** - Current properties and extends subcategories `StandardLonghand` and `StandardShorthand` _(e.g. `StandardShorthandProperties`)_ - **`Vendor`** - Vendor prefixed properties and extends subcategories `VendorLonghand` and `VendorShorthand` _(e.g. `VendorShorthandProperties`)_ - **`Obsolete`** - Removed or deprecated properties - **`Svg`** - SVG-specific properties Variations: - **Default** - JavaScript (camel) cased property names - **`Hyphen`** - CSS (kebab) cased property names - **`Fallback`** - Also accepts array of values e.g. `string | string[]` ## At-rule types At-rule interfaces with descriptors. **TypeScript**: These will be found in the `AtRule` namespace, e.g. `AtRule.Viewport`. **Flow**: These will be prefixed with `AtRule$`, e.g. `AtRule$Viewport`. | | Default | `Hyphen` | `Fallback` | `HyphenFallback` | | -------------------- | -------------- | -------------------- | ---------------------- | ---------------------------- | | **`@counter-style`** | `CounterStyle` | `CounterStyleHyphen` | `CounterStyleFallback` | `CounterStyleHyphenFallback` | | **`@font-face`** | `FontFace` | `FontFaceHyphen` | `FontFaceFallback` | `FontFaceHyphenFallback` | | **`@viewport`** | `Viewport` | `ViewportHyphen` | `ViewportFallback` | `ViewportHyphenFallback` | ## Pseudo types String literals of pseudo classes and pseudo elements - `Pseudos` Extends: - `AdvancedPseudos` Function-like pseudos e.g. `:not(:first-child)`. The string literal contains the value excluding the parenthesis: `:not`. These are separated because they require an argument that results in infinite number of variations. - `SimplePseudos` Plain pseudos e.g. `:hover` that can only be **one** variation. ## Generics All interfaces has two optional generic argument to define length and time: `CSS.Properties` - **Length** is the first generic parameter and defaults to `string | 0` because `0` is the only [length where the unit identifier is optional](https://drafts.csswg.org/css-values-3/#lengths). You can specify this, e.g. `string | number`, for platforms and libraries that accepts any numeric value as length with a specific unit. ```tsx const style: CSS.Properties = { width: 100, }; ``` - **Time** is the second generic argument and defaults to `string`. You can specify this, e.g. `string | number`, for platforms and libraries that accepts any numeric value as length with a specific unit. ```tsx const style: CSS.Properties = { transitionDuration: 1000, }; ``` ## Usage ```ts import type * as CSS from 'csstype'; const style: CSS.Properties = { width: '10px', margin: '1em', }; ``` In some cases, like for CSS-in-JS libraries, an array of values is a way to provide fallback values in CSS. Using `CSS.PropertiesFallback` instead of `CSS.Properties` will add the possibility to use any property value as an array of values. ```ts import type * as CSS from 'csstype'; const style: CSS.PropertiesFallback = { display: ['-webkit-flex', 'flex'], color: 'white', }; ``` There's even string literals for pseudo selectors and elements. ```ts import type * as CSS from 'csstype'; const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = { ':hover': { display: 'flex', }, }; ``` Hyphen cased (kebab cased) properties are provided in `CSS.PropertiesHyphen` and `CSS.PropertiesHyphenFallback`. It's not **not** added by default in `CSS.Properties`. To allow both of them, you can simply extend with `CSS.PropertiesHyphen` or/and `CSS.PropertiesHyphenFallback`. ```ts import type * as CSS from 'csstype'; interface Style extends CSS.Properties, CSS.PropertiesHyphen {} const style: Style = { 'flex-grow': 1, 'flex-shrink': 0, 'font-weight': 'normal', backgroundColor: 'white', }; ``` Adding type checked CSS properties to a `HTMLElement`. ```ts import type * as CSS from 'csstype'; const style: CSS.Properties = { color: 'red', margin: '1em', }; let button = document.createElement('button'); Object.assign(button.style, style); ``` ## What should I do when I get type errors? The goal is to have as perfect types as possible and we're trying to do our best. But with CSS Custom Properties, the CSS specification changing frequently and vendors implementing their own specifications with new releases sometimes causes type errors even if it should work. Here's some steps you could take to get it fixed: _If you're using CSS Custom Properties you can step directly to step 3._ 1. **First of all, make sure you're doing it right.** A type error could also indicate that you're not :wink: - Some CSS specs that some vendors has implemented could have been officially rejected or haven't yet received any official acceptance and are therefor not included - If you're using TypeScript, [type widening](https://blog.mariusschulz.com/2017/02/04/TypeScript-2-1-literal-type-widening) could be the reason you get `Type 'string' is not assignable to...` errors 2. **Have a look in [issues](https://github.com/frenic/csstype/issues) to see if an issue already has been filed. If not, create a new one.** To help us out, please refer to any information you have found. 3. Fix the issue locally with **TypeScript** (Flow further down): - The recommended way is to use **module augmentation**. Here's a few examples: ```ts // My css.d.ts file import type * as CSS from 'csstype'; declare module 'csstype' { interface Properties { // Add a missing property WebkitRocketLauncher?: string; // Add a CSS Custom Property '--theme-color'?: 'black' | 'white'; // Allow namespaced CSS Custom Properties [index: `--theme-${string}`]: any; // Allow any CSS Custom Properties [index: `--${string}`]: any; // ...or allow any other property [index: string]: any; } } ``` - The alternative way is to use **type assertion**. Here's a few examples: ```ts const style: CSS.Properties = { // Add a missing property ['WebkitRocketLauncher' as any]: 'launching', // Add a CSS Custom Property ['--theme-color' as any]: 'black', }; ``` Fix the issue locally with **Flow**: - Use **type assertion**. Here's a few examples: ```js const style: $Exact> = { // Add a missing property [('WebkitRocketLauncher': any)]: 'launching', // Add a CSS Custom Property [('--theme-color': any)]: 'black', }; ``` ## Version 3.0 - **All property types are exposed with namespace** TypeScript: `Property.AlignContent` (was `AlignContentProperty` before) Flow: `Property$AlignContent` - **All at-rules are exposed with namespace** TypeScript: `AtRule.FontFace` (was `FontFace` before) Flow: `AtRule$FontFace` - **Data types are NOT exposed** E.g. `Color` and `Box`. Because the generation of data types may suddenly be removed or renamed. - **TypeScript hack for autocompletion** Uses `(string & {})` for literal string unions and `(number & {})` for literal number unions ([related issue](https://github.com/microsoft/TypeScript/issues/29729)). Utilize `PropertyValue` to unpack types from e.g. `(string & {})` to `string`. - **New generic for time** Read more on the ["Generics"](#generics) section. - **Flow types improvements** Flow Strict enabled and exact types are used. ## Contributing **Never modify `index.d.ts` and `index.js.flow` directly. They are generated automatically and committed so that we can easily follow any change it results in.** Therefor it's important that you run `$ git config merge.ours.driver true` after you've forked and cloned. That setting prevents merge conflicts when doing rebase. ### Commands - `npm run build` Generates typings and type checks them - `npm run watch` Runs build on each save - `npm run test` Runs the tests - `npm run lazy` Type checks, lints and formats everything csstype-3.1.3/__tests__/000077500000000000000000000000001453431544100151525ustar00rootroot00000000000000csstype-3.1.3/__tests__/__fixtures__/000077500000000000000000000000001453431544100176175ustar00rootroot00000000000000csstype-3.1.3/__tests__/__fixtures__/.flowconfig000066400000000000000000000004131453431544100217530ustar00rootroot00000000000000[ignore] .*/node_modules/.* [include] ../../index.js.flow [libs] [lints] untyped-import=warn [options] [strict] sketchy-null sketchy-number untyped-type-import unclear-type unsafe-getters-setters nonstrict-import unnecessary-optional-chain unnecessary-invariant csstype-3.1.3/__tests__/__fixtures__/package-lock.json000066400000000000000000000064321453431544100230400ustar00rootroot00000000000000{ "name": "csstype-fixtures", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "csstype-fixtures", "dependencies": { "csstype": "file:../..", "oldcsstype": "npm:csstype@^2.6.21" } }, "../..": { "version": "3.1.2", "license": "MIT", "devDependencies": { "@types/chokidar": "^2.1.3", "@types/css-tree": "^2.3.1", "@types/jest": "^29.5.0", "@types/jsdom": "^21.1.1", "@types/node": "^16.18.23", "@types/prettier": "^2.7.2", "@types/request": "^2.48.8", "@types/turndown": "^5.0.1", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "chalk": "^4.1.2", "chokidar": "^3.5.3", "css-tree": "^2.3.1", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "fast-glob": "^3.2.12", "flow-bin": "^0.203.1", "jest": "^29.5.0", "jsdom": "^21.1.1", "mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#22e0f5f1707f29f0c646ea89f5ba5ea7734fa48a", "mdn-data": "git+https://github.com/mdn/data.git#d0e0fce2abd53e5c918a2f6a38e8c4607027768a", "prettier": "^2.8.7", "request": "^2.88.2", "ts-jest": "^29.0.5", "ts-node": "^10.9.1", "turndown": "^7.1.2", "typescript": "~5.0.3" } }, "node_modules/csstype": { "resolved": "../..", "link": true }, "node_modules/oldcsstype": { "name": "csstype", "version": "2.6.21", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" } }, "dependencies": { "csstype": { "version": "file:../..", "requires": { "@types/chokidar": "^2.1.3", "@types/css-tree": "^2.3.1", "@types/jest": "^29.5.0", "@types/jsdom": "^21.1.1", "@types/node": "^16.18.23", "@types/prettier": "^2.7.2", "@types/request": "^2.48.8", "@types/turndown": "^5.0.1", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "chalk": "^4.1.2", "chokidar": "^3.5.3", "css-tree": "^2.3.1", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "fast-glob": "^3.2.12", "flow-bin": "^0.203.1", "jest": "^29.5.0", "jsdom": "^21.1.1", "mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#22e0f5f1707f29f0c646ea89f5ba5ea7734fa48a", "mdn-data": "git+https://github.com/mdn/data.git#d0e0fce2abd53e5c918a2f6a38e8c4607027768a", "prettier": "^2.8.7", "request": "^2.88.2", "ts-jest": "^29.0.5", "ts-node": "^10.9.1", "turndown": "^7.1.2", "typescript": "~5.0.3" } }, "oldcsstype": { "version": "npm:csstype@2.6.21", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" } } } csstype-3.1.3/__tests__/__fixtures__/package.json000066400000000000000000000002321453431544100221020ustar00rootroot00000000000000{ "name": "csstype-fixtures", "private": true, "dependencies": { "csstype": "file:../..", "oldcsstype": "npm:csstype@^2.6.21" } } csstype-3.1.3/__tests__/__fixtures__/typecheck.js000066400000000000000000000032641453431544100221410ustar00rootroot00000000000000// @flow strict import * as CSS from '../../index.js.flow'; // eslint-disable-next-line @typescript-eslint/no-unused-vars const css: CSS.Properties<> = { flexGrow: 1, flexShrink: 1, flexBasis: 'max-content', flexDirection: 'row', MozAppearance: 'button', msOverflowStyle: 'scrollbar', color: '#abcdef', // Test custom string borderBottomWidth: 'calc(1px)', // This property has `TLength` (but not `string` itself) so // if this fails it may have something to do with default generic values lineHeightStep: '2em', }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const cssWithFallbackValues: CSS.PropertiesFallback<> = { flexGrow: [1], flexShrink: [1], flexBasis: ['max-content'], flexDirection: ['row'], MozAppearance: ['button'], msOverflowStyle: ['scrollbar'], }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const cssWithHyphenProperties: CSS.PropertiesHyphen<> = { 'flex-grow': 1, 'flex-shrink': 0, 'flex-basis': 'max-content', 'flex-direction': 'row', '-moz-appearance': 'button', '-ms-overflow-style': 'scrollbar', }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const cssWithDifferentLength: CSS.Properties = { width: 1, }; // eslint-disable-next-line @typescript-eslint/no-unused-vars const unknownProperty: CSS.Properties<> = { unknownProperty: 1, }; // Should fail but doesn't // eslint-disable-next-line @typescript-eslint/no-unused-vars const cssWithDisallowedValue: CSS.Properties<> = { order: '0', }; // Should fail but doesn't // eslint-disable-next-line @typescript-eslint/no-unused-vars const cssWithDisallowedFallbackValues: CSS.Properties<> = { bottom: [0], order: [0], }; csstype-3.1.3/__tests__/__fixtures__/typecheck.ts000066400000000000000000000110371453431544100221500ustar00rootroot00000000000000import * as CSS from '../..'; // Old CSSType import needs to be AFTER the current one import * as OldCSS from 'oldcsstype'; const css: CSS.Properties = { flexGrow: 1, flexShrink: 1, flexBasis: 'max-content', flexDirection: 'row', MozAppearance: 'button', msOverflowStyle: 'scrollbar', color: '#abcdef', height: undefined, fontWeight: '400', // Test custom string width: 'calc(1px)', // This property has `TLength` (but not `(string & {})` itself) so // if this fails it may have something to do with default generic values lineHeightStep: '2em', }; const cssWithFallbackValues: CSS.PropertiesFallback = { flexGrow: [1], flexShrink: [1], flexBasis: ['max-content'], flexDirection: ['row'], MozAppearance: ['button'], msOverflowStyle: ['scrollbar'], height: undefined, clip: [undefined], }; const cssWithFallbackConstValues: CSS.PropertiesFallback = { flexGrow: [1] as const, flexShrink: [1] as const, flexBasis: ['max-content'] as const, flexDirection: ['row'] as const, MozAppearance: ['button'] as const, msOverflowStyle: ['scrollbar'] as const, height: undefined, clip: [undefined] as const, }; const cssWithHyphenProperties: CSS.PropertiesHyphen = { 'flex-grow': 1, 'flex-shrink': 0, 'flex-basis': 'max-content', 'flex-direction': 'row', '-moz-appearance': 'button', '-ms-overflow-style': 'scrollbar', }; const cssWithDifferentLength: CSS.Properties<{ px: number }> = { width: { px: 1 }, }; const unknownProperty: CSS.Properties = { unknownProperty: 1, }; const cssWithDisallowedFallbackValues: CSS.Properties = { bottom: [0], order: [0], }; // Tests autocomplete hack const autocompleteHackShouldPass: string & {} = ''; const autocompleteHackShouldFail: string & {} = {}; function autocompleteHackTypeGuardProblem(value: CSS.Property.Width) { if (value === 'auto') { // If this passes it could mean that `CSS.PropertyValue` isn't needed anymore const wouldBeNiceIfThisPassed: 'auto' = value; wouldBeNiceIfThisPassed; } } const propertyValueShouldPass1: CSS.PropertyValue = 'auto'; const propertyValueShouldPass2: CSS.PropertyValue = 0; const propertyValueShouldFail: CSS.PropertyValue = 1; function propertyValue(value: CSS.PropertyValue) { if (value === 'auto') { const shouldPass: 'auto' = value; shouldPass; } if (typeof value === 'number') { const shouldPass: 0 = value; shouldPass; } { const shouldFail = value === 1; shouldFail; } if (Array.isArray(value)) { const arrayValue = value[0]; if (arrayValue === 'auto') { const shouldPass: 'auto' = arrayValue; shouldPass; } if (typeof arrayValue === 'number') { const shouldPass: 0 = arrayValue; shouldPass; } { const shouldFail = arrayValue === 1; shouldFail; } } } propertyValue('auto'); // Should pass propertyValue(['auto']); // Should pass propertyValue(0); // Should pass propertyValue([0]); // Should pass propertyValue(1); // Should fail propertyValue([1]); // Should fail function propertyValueWithAutocompleteHack(arg: CSS.Property.Width | [CSS.Property.Width]) { const value = arg as CSS.PropertyValue; if (value === 'auto') { const shouldPass: 'auto' = value; shouldPass; } if (typeof value === 'number') { const shouldPass: 0 = value; shouldPass; } { const shouldFail = value === 1; shouldFail; } if (Array.isArray(value)) { const arrayValue = value[0]; if (arrayValue === 'auto') { const shouldPass: 'auto' = arrayValue; shouldPass; } if (typeof arrayValue === 'number') { const shouldPass: 0 = arrayValue; shouldPass; } { const shouldFail = arrayValue === 1; shouldFail; } } } propertyValueWithAutocompleteHack('auto'); // Should pass propertyValueWithAutocompleteHack(['auto']); // Should pass propertyValueWithAutocompleteHack(0); // Should pass propertyValueWithAutocompleteHack([0]); // Should pass propertyValueWithAutocompleteHack(1); // Should fail propertyValueWithAutocompleteHack([1]); // Should fail const differentMajorVersions: CSS.Properties = {} as OldCSS.Properties; css; cssWithFallbackValues; cssWithFallbackConstValues; cssWithHyphenProperties; cssWithDifferentLength; unknownProperty; cssWithDisallowedFallbackValues; autocompleteHackShouldPass; autocompleteHackShouldFail; autocompleteHackTypeGuardProblem; propertyValueShouldPass1; propertyValueShouldPass2; propertyValueShouldFail; differentMajorVersions; csstype-3.1.3/__tests__/__snapshots__/000077500000000000000000000000001453431544100177705ustar00rootroot00000000000000csstype-3.1.3/__tests__/__snapshots__/dist.flow.ts.snap000066400000000000000000000024071453431544100232140ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`it detects errors 1`] = `"47:43 - Cannot assign object literal to \`unknownProperty\` because property \`unknownProperty\` is missing in \`Properties\` [1] but exists in object literal [2]. [prop-missing]"`; exports[`it detects errors 2`] = `"54:10 - Cannot assign object literal to \`cssWithDisallowedValue\` because in property \`order\`: [incompatible-type] Either string [1] is incompatible with literal union [2]. Or string [1] is incompatible with number [3]."`; exports[`it detects errors 3`] = `"60:11 - Cannot assign object literal to \`cssWithDisallowedFallbackValues\` because in property \`bottom\`: [incompatible-type] Either array literal [1] is incompatible with literal union [2]. Or array literal [1] is incompatible with string [3]. Or array literal [1] is incompatible with number literal \`0\` [4]. Or array literal [1] is incompatible with string literal \`auto\` [5]. Or array literal [1] is incompatible with string [6]."`; exports[`it detects errors 4`] = `"61:10 - Cannot assign object literal to \`cssWithDisallowedFallbackValues\` because in property \`order\`: [incompatible-type] Either array literal [1] is incompatible with literal union [2]. Or array literal [1] is incompatible with number [3]."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-3.5.ts.snap000066400000000000000000000105361453431544100247600ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.5 detects errors 1`] = ` "31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.5 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.5 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.5 detects errors 4`] = ` "63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.5 detects errors 5`] = ` "64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.5 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 3.5 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 3.5 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.5 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.5 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.5 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 3.5 detects errors 12`] = ` "118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; exports[`Typescript 3.5 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.5 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.5 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 3.5 detects errors 16`] = ` "156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-3.6.ts.snap000066400000000000000000000105361453431544100247610ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.6 detects errors 1`] = ` "31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.6 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.6 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.6 detects errors 4`] = ` "63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.6 detects errors 5`] = ` "64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.6 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 3.6 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 3.6 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.6 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.6 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.6 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 3.6 detects errors 12`] = ` "118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; exports[`Typescript 3.6 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.6 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.6 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 3.6 detects errors 16`] = ` "156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-3.7.ts.snap000066400000000000000000000105361453431544100247620ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.7 detects errors 1`] = ` "31:2 - Type 'undefined[]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'undefined[]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.7 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.7 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.7 detects errors 4`] = ` "63:2 - Type 'number[]' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.7 detects errors 5`] = ` "64:2 - Type 'number[]' is not assignable to type '"inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | (number & {}) | undefined'. Type 'number[]' is not assignable to type '"unset"'." `; exports[`Typescript 3.7 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 3.7 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 3.7 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.7 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.7 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.7 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 3.7 detects errors 12`] = ` "118:14 - Argument of type '1[]' is not assignable to parameter of type 'string | 0 | (string | 0)[]'. Type '1[]' is not assignable to type '(string | 0)[]'. Type '1' is not assignable to type 'string | 0'." `; exports[`Typescript 3.7 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.7 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.7 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 3.7 detects errors 16`] = ` "156:34 - Argument of type '[1]' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'. Type '[1]' is not assignable to type '[0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"]'. Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'." `; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-3.8.ts.snap000066400000000000000000000060711453431544100247620ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.8 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 3.8 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.8 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.8 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 3.8 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 3.8 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 3.8 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 3.8 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.8 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.8 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.8 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 3.8 detects errors 12`] = `"118:15 - Type 'number' is not assignable to type 'string | 0'."`; exports[`Typescript 3.8 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.8 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.8 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 3.8 detects errors 16`] = `"156:35 - Type '1' is not assignable to type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 5 more ... | "min-intrinsic"'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-3.9.ts.snap000066400000000000000000000055611453431544100247660ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 3.9 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 3.9 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 3.9 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 3.9 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 3.9 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 3.9 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 3.9 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 3.9 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.9 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.9 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.9 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 3.9 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 3.9 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 3.9 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 3.9 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 3.9 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.0.ts.snap000066400000000000000000000055611453431544100247560ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.0 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 4.0 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 4.0 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.0 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.0 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.0 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.0 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.0 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.0 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.0 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.0 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.0 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.0 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.0 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.0 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 4.0 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.1.ts.snap000066400000000000000000000055611453431544100247570ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.1 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'HyphenateCharacter'."`; exports[`Typescript 4.1 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type '"auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | readonly HyphenateCharacter[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly HyphenateCharacter[]'. Type 'undefined' is not assignable to type 'HyphenateCharacter'." `; exports[`Typescript 4.1 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.1 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.1 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.1 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.1 detects errors 7`] = ` "74:10 - Type 'Range' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.1 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.1 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.1 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.1 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.1 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.1 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.1 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.1 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type '0 | "auto" | "inherit" | (string & {}) | "-moz-initial" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "fit-content" | ... 6 more ... | [...]'."`; exports[`Typescript 4.1 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.2.ts.snap000066400000000000000000000051151453431544100247530ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.2 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.2 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.2 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.2 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.2 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.2 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.2 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.2 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.2 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.2 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.2 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.2 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.2 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.2 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.2 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.2 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.3.ts.snap000066400000000000000000000051151453431544100247540ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.3 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.3 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.3 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.3 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.3 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.3 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.3 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.3 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.3 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.3 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.3 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.3 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.3 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.3 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.3 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.3 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.4.ts.snap000066400000000000000000000051151453431544100247550ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.4 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.4 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.4 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.4 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.4 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.4 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.4 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.4 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.4 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.4 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.4 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.4 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.4 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.4 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.4 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.4 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.5.ts.snap000066400000000000000000000051151453431544100247560ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.5 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.5 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.5 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.5 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.5 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.5 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.5 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.5 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.5 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.5 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.5 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.5 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.5 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.5 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.5 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.5 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.6.ts.snap000066400000000000000000000051151453431544100247570ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.6 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.6 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.6 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.6 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.6 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.6 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.6 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.6 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.6 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.6 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.6 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.6 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.6 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.6 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.6 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.6 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.7.ts.snap000066400000000000000000000051151453431544100247600ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.7 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'Clip'."`; exports[`Typescript 4.7 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'Clip | readonly Clip[] | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly Clip[]'. Type 'undefined' is not assignable to type 'Clip'." `; exports[`Typescript 4.7 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.7 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.7 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.7 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.7 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.7 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.7 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.7 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.7 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.7 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.7 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.7 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.7 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.7 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.8.ts.snap000066400000000000000000000051251453431544100247620ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.8 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 4.8 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. Type 'undefined' is not assignable to type 'string'." `; exports[`Typescript 4.8 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.8 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.8 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.8 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.8 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.8 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.8 detects errors 9`] = `"93:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.8 detects errors 10`] = `"107:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.8 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.8 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.8 detects errors 13`] = `"131:23 - This condition will always return 'false' since the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.8 detects errors 14`] = `"145:25 - This condition will always return 'false' since the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.8 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.8 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-4.9.ts.snap000066400000000000000000000051451453431544100247650ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 4.9 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 4.9 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. Type 'undefined' is not assignable to type 'string'." `; exports[`Typescript 4.9 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 4.9 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.9 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 4.9 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 4.9 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 4.9 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.9 detects errors 9`] = `"93:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.9 detects errors 10`] = `"107:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.9 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 4.9 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 4.9 detects errors 13`] = `"131:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 4.9 detects errors 14`] = `"145:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 4.9 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 4.9 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/__snapshots__/dist.typescript-latest.ts.snap000066400000000000000000000051451453431544100257470ustar00rootroot00000000000000// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Typescript 5.0 detects errors 1`] = `"31:9 - Type 'undefined' is not assignable to type 'string'."`; exports[`Typescript 5.0 detects errors 2`] = ` "42:2 - Type 'readonly [undefined]' is not assignable to type 'readonly string[] | Clip | undefined'. Type 'readonly [undefined]' is not assignable to type 'readonly string[]'. Type 'undefined' is not assignable to type 'string'." `; exports[`Typescript 5.0 detects errors 3`] = ` "59:2 - Type '{ unknownProperty: number; }' is not assignable to type 'Properties<0 | (string & {}), string & {}>'. Object literal may only specify known properties, and 'unknownProperty' does not exist in type 'Properties<0 | (string & {}), string & {}>'." `; exports[`Typescript 5.0 detects errors 4`] = `"63:11 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 5.0 detects errors 5`] = `"64:10 - Type 'number' is not assignable to type 'string'."`; exports[`Typescript 5.0 detects errors 6`] = ` "69:6 - Type '{}' is not assignable to type 'string & {}'. Type '{}' is not assignable to type 'string'." `; exports[`Typescript 5.0 detects errors 7`] = ` "74:10 - Type '"auto" | (string & {})' is not assignable to type '"auto"'. Type 'string & {}' is not assignable to type '"auto"'." `; exports[`Typescript 5.0 detects errors 8`] = `"81:6 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 5.0 detects errors 9`] = `"93:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 5.0 detects errors 10`] = `"107:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 5.0 detects errors 11`] = `"117:14 - Argument of type '1' is not assignable to parameter of type 'string | 0 | (string | 0)[]'."`; exports[`Typescript 5.0 detects errors 12`] = `"118:15 - Type '1' is not assignable to type 'string | 0'."`; exports[`Typescript 5.0 detects errors 13`] = `"131:23 - This comparison appears to be unintentional because the types 'string | 0 | (string | 0)[]' and '1' have no overlap."`; exports[`Typescript 5.0 detects errors 14`] = `"145:25 - This comparison appears to be unintentional because the types 'string | 0' and '1' have no overlap."`; exports[`Typescript 5.0 detects errors 15`] = `"155:34 - Argument of type '1' is not assignable to parameter of type 'Width<0 | (string & {})> | [Width<0 | (string & {})>]'."`; exports[`Typescript 5.0 detects errors 16`] = `"156:35 - Type '1' is not assignable to type 'Width<0 | (string & {})>'."`; csstype-3.1.3/__tests__/dist.flow.ts000066400000000000000000000024471453431544100174420ustar00rootroot00000000000000import { spawnSync } from 'child_process'; import * as path from 'path'; const flow: string = require('flow-bin'); test('it detects errors', () => { const { stdout: output } = spawnSync( flow, ['check', path.resolve(__dirname, '__fixtures__/typecheck.js'), '--json'], { stdio: 'pipe', encoding: 'utf8', }, ); const { errors }: IFlowOutput = JSON.parse(output); expect(errors.length).toBe(4); for (const error of errors) { expect(message(error)).toMatchSnapshot(); } }); function message(error: IError) { const { loc: { start: { line, column }, }, descr, } = error.message[0]; return `${line}:${column} - ${descr}`; } interface IExtra { message: IMessage[]; } interface IPosition { line: number; column: number; offset: number; } interface ILocation { source: string; type: string; start: IPosition; end: IPosition; } interface IMessage { context: string; descr: string; type: string; loc: ILocation; path: string; line: number; endline: number; start: number; end: number; } interface IError { kind: string; level: string; suppressions: any[]; extra: IExtra[]; message: IMessage[]; } interface IFlowOutput { flowVersion: string; jsonVersion: string; errors: IError[]; passed: boolean; } csstype-3.1.3/__tests__/dist.typescript-3.5.ts000066400000000000000000000015431453431544100212000ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript3.5'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 3.5', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(3.5); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-3.6.ts000066400000000000000000000015431453431544100212010ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript3.6'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 3.6', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(3.6); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-3.7.ts000066400000000000000000000015431453431544100212020ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript3.7'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 3.7', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(3.7); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-3.8.ts000066400000000000000000000015431453431544100212030ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript3.8'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 3.8', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(3.8); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-3.9.ts000066400000000000000000000015431453431544100212040ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript3.9'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 3.9', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(3.9); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.0.ts000066400000000000000000000015431453431544100211740ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.0'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.0', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.0); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.1.ts000066400000000000000000000015431453431544100211750ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.1'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.1', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.1); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.2.ts000066400000000000000000000015431453431544100211760ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.2'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.2', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.2); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.3.ts000066400000000000000000000015431453431544100211770ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.3'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.3', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.3); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.4.ts000066400000000000000000000015431453431544100212000ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.4'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.4', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.4); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.5.ts000066400000000000000000000015431453431544100212010ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.5'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.5', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.5); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.6.ts000066400000000000000000000015431453431544100212020ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.6'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.6', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.6); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.7.ts000066400000000000000000000015431453431544100212030ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.7'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.7', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.7); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.8.ts000066400000000000000000000015431453431544100212040ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.8'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.8', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.8); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-4.9.ts000066400000000000000000000015431453431544100212050ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript4.9'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 4.9', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(4.9); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/dist.typescript-latest.ts000066400000000000000000000015401453431544100221640ustar00rootroot00000000000000import * as path from 'path'; import * as ts from 'typescript'; import { removeAbsolutePaths, COMPILER_OPTIONS } from './typescript-utils'; describe('Typescript 5.0', () => { it('detects errors', async () => { const program = ts.createProgram([path.resolve(__dirname, '__fixtures__/typecheck.ts')], COMPILER_OPTIONS); const diagnostics = ts.getPreEmitDiagnostics(program); const errors = diagnostics.map(diagnostic => { const { line, character } = diagnostic.file!.getLineAndCharacterOfPosition(diagnostic.start!); return `${line}:${character} - ${removeAbsolutePaths( ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'), )}`; }); expect(Number(ts.versionMajorMinor)).toBe(5.0); expect(errors.length).toBe(16); for (const error of errors) { expect(error).toMatchSnapshot(); } }); }); csstype-3.1.3/__tests__/package-lock.json000066400000000000000000000333701453431544100203740ustar00rootroot00000000000000{ "name": "csstype-test", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "csstype-test", "dependencies": { "csstype": "file:..", "typescript3.5": "npm:typescript@~3.5.0", "typescript3.6": "npm:typescript@~3.6.0", "typescript3.7": "npm:typescript@~3.7.0", "typescript3.8": "npm:typescript@~3.8.0", "typescript3.9": "npm:typescript@~3.9.0", "typescript4.0": "npm:typescript@~4.0.0", "typescript4.1": "npm:typescript@~4.1.0", "typescript4.2": "npm:typescript@~4.2.0", "typescript4.3": "npm:typescript@~4.3.0", "typescript4.4": "npm:typescript@~4.4.0", "typescript4.5": "npm:typescript@~4.5.0", "typescript4.6": "npm:typescript@~4.6.0", "typescript4.7": "npm:typescript@~4.7.0", "typescript4.8": "npm:typescript@~4.8.0", "typescript4.9": "npm:typescript@~4.9.0" } }, "..": { "version": "3.1.2", "license": "MIT", "devDependencies": { "@types/chokidar": "^2.1.3", "@types/css-tree": "^2.3.1", "@types/jest": "^29.5.0", "@types/jsdom": "^21.1.1", "@types/node": "^16.18.23", "@types/prettier": "^2.7.2", "@types/request": "^2.48.8", "@types/turndown": "^5.0.1", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "chalk": "^4.1.2", "chokidar": "^3.5.3", "css-tree": "^2.3.1", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "fast-glob": "^3.2.12", "flow-bin": "^0.203.1", "jest": "^29.5.0", "jsdom": "^21.1.1", "mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#22e0f5f1707f29f0c646ea89f5ba5ea7734fa48a", "mdn-data": "git+https://github.com/mdn/data.git#d0e0fce2abd53e5c918a2f6a38e8c4607027768a", "prettier": "^2.8.7", "request": "^2.88.2", "ts-jest": "^29.0.5", "ts-node": "^10.9.1", "turndown": "^7.1.2", "typescript": "~5.0.3" } }, "node_modules/csstype": { "resolved": "..", "link": true }, "node_modules/typescript3.5": { "name": "typescript", "version": "3.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript3.6": { "name": "typescript", "version": "3.6.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.5.tgz", "integrity": "sha512-BEjlc0Z06ORZKbtcxGrIvvwYs5hAnuo6TKdNFL55frVDlB+na3z5bsLhFaIxmT+dPWgBIjMo6aNnTOgHHmHgiQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript3.7": { "name": "typescript", "version": "3.7.7", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz", "integrity": "sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript3.8": { "name": "typescript", "version": "3.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript3.9": { "name": "typescript", "version": "3.9.10", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.0": { "name": "typescript", "version": "4.0.8", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.8.tgz", "integrity": "sha512-oz1765PN+imfz1MlZzSZPtC/tqcwsCyIYA8L47EkRnRW97ztRk83SzMiWLrnChC0vqoYxSU1fcFUDA5gV/ZiPg==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.1": { "name": "typescript", "version": "4.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz", "integrity": "sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.2": { "name": "typescript", "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.3": { "name": "typescript", "version": "4.3.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.4": { "name": "typescript", "version": "4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.5": { "name": "typescript", "version": "4.5.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.6": { "name": "typescript", "version": "4.6.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.7": { "name": "typescript", "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.8": { "name": "typescript", "version": "4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } }, "node_modules/typescript4.9": { "name": "typescript", "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=4.2.0" } } }, "dependencies": { "csstype": { "version": "file:..", "requires": { "@types/chokidar": "^2.1.3", "@types/css-tree": "^2.3.1", "@types/jest": "^29.5.0", "@types/jsdom": "^21.1.1", "@types/node": "^16.18.23", "@types/prettier": "^2.7.2", "@types/request": "^2.48.8", "@types/turndown": "^5.0.1", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "chalk": "^4.1.2", "chokidar": "^3.5.3", "css-tree": "^2.3.1", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", "fast-glob": "^3.2.12", "flow-bin": "^0.203.1", "jest": "^29.5.0", "jsdom": "^21.1.1", "mdn-browser-compat-data": "git+https://github.com/mdn/browser-compat-data.git#22e0f5f1707f29f0c646ea89f5ba5ea7734fa48a", "mdn-data": "git+https://github.com/mdn/data.git#d0e0fce2abd53e5c918a2f6a38e8c4607027768a", "prettier": "^2.8.7", "request": "^2.88.2", "ts-jest": "^29.0.5", "ts-node": "^10.9.1", "turndown": "^7.1.2", "typescript": "~5.0.3" } }, "typescript3.5": { "version": "npm:typescript@3.5.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==" }, "typescript3.6": { "version": "npm:typescript@3.6.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.5.tgz", "integrity": "sha512-BEjlc0Z06ORZKbtcxGrIvvwYs5hAnuo6TKdNFL55frVDlB+na3z5bsLhFaIxmT+dPWgBIjMo6aNnTOgHHmHgiQ==" }, "typescript3.7": { "version": "npm:typescript@3.7.7", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.7.tgz", "integrity": "sha512-MmQdgo/XenfZPvVLtKZOq9jQQvzaUAUpcKW8Z43x9B2fOm4S5g//tPtMweZUIP+SoBqrVPEIm+dJeQ9dfO0QdA==" }, "typescript3.8": { "version": "npm:typescript@3.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==" }, "typescript3.9": { "version": "npm:typescript@3.9.10", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" }, "typescript4.0": { "version": "npm:typescript@4.0.8", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.8.tgz", "integrity": "sha512-oz1765PN+imfz1MlZzSZPtC/tqcwsCyIYA8L47EkRnRW97ztRk83SzMiWLrnChC0vqoYxSU1fcFUDA5gV/ZiPg==" }, "typescript4.1": { "version": "npm:typescript@4.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz", "integrity": "sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow==" }, "typescript4.2": { "version": "npm:typescript@4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" }, "typescript4.3": { "version": "npm:typescript@4.3.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==" }, "typescript4.4": { "version": "npm:typescript@4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==" }, "typescript4.5": { "version": "npm:typescript@4.5.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==" }, "typescript4.6": { "version": "npm:typescript@4.6.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==" }, "typescript4.7": { "version": "npm:typescript@4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" }, "typescript4.8": { "version": "npm:typescript@4.8.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==" }, "typescript4.9": { "version": "npm:typescript@4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" } } } csstype-3.1.3/__tests__/package.json000066400000000000000000000014521453431544100174420ustar00rootroot00000000000000{ "name": "csstype-test", "private": true, "dependencies": { "csstype": "file:..", "typescript3.5": "npm:typescript@~3.5.0", "typescript3.6": "npm:typescript@~3.6.0", "typescript3.7": "npm:typescript@~3.7.0", "typescript3.8": "npm:typescript@~3.8.0", "typescript3.9": "npm:typescript@~3.9.0", "typescript4.0": "npm:typescript@~4.0.0", "typescript4.1": "npm:typescript@~4.1.0", "typescript4.2": "npm:typescript@~4.2.0", "typescript4.3": "npm:typescript@~4.3.0", "typescript4.4": "npm:typescript@~4.4.0", "typescript4.5": "npm:typescript@~4.5.0", "typescript4.6": "npm:typescript@~4.6.0", "typescript4.7": "npm:typescript@~4.7.0", "typescript4.8": "npm:typescript@~4.8.0", "typescript4.9": "npm:typescript@~4.9.0" } } csstype-3.1.3/__tests__/src.typer.ts000066400000000000000000000066461453431544100174670ustar00rootroot00000000000000import parse from '../src/syntax/parser'; import typer, { Type } from '../src/syntax/typer'; describe('typing', () => { it('types combinators', () => { expect(typer(parse('something another-thing'))).toHaveLength(1); expect(typer(parse('something && another-thing'))).toHaveLength(1); expect(typer(parse('something || another-thing'))).toHaveLength(3); expect(typer(parse('something | another-thing'))).toHaveLength(2); }); it('types components', () => { expect(typer(parse('something | 100 | '))).toMatchObject([ { type: Type.StringLiteral }, { type: Type.NumericLiteral }, { type: Type.DataType }, ]); }); it('types optional components', () => { expect(typer(parse('something another-thing? | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something another-thing? yet-another-thing? | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something? another-thing yet-another-thing? | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something? another-thing? yet-another-thing | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something? another-thing? yet-another-thing? | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.StringLiteral }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something another-thing yet-another-thing? | 100'))).toMatchObject([ { type: Type.String }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something another-thing? yet-another-thing | 100'))).toMatchObject([ { type: Type.String }, { type: Type.NumericLiteral }, ]); expect(typer(parse('something? another-thing yet-another-thing | 100'))).toMatchObject([ { type: Type.String }, { type: Type.NumericLiteral }, ]); }); it('does not duplicate types', () => { expect(typer(parse('something? another-thing | something? another-thing | 100 | 100'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, { type: Type.NumericLiteral }, ]); }); it('types optional group components', () => { expect(typer(parse('[ something another-thing ]? 100'))).toMatchObject([ { type: Type.String }, { type: Type.NumericLiteral }, ]); }); it('types multipliers', () => { expect(typer(parse('something-x | something-y | [ something | another-thing ]{1,2}'))).toMatchObject([ { type: Type.StringLiteral }, { type: Type.StringLiteral }, { type: Type.String }, { type: Type.StringLiteral }, { type: Type.StringLiteral }, ]); expect(typer(parse('something{1,4} [ antoher-thing{1,4} ]?'))).toMatchObject([ { type: Type.String }, { type: Type.StringLiteral }, ]); expect(typer(parse('something#'))).toMatchObject([{ type: Type.String }, { type: Type.StringLiteral }]); }); it('types number with range', () => { expect(typer(parse(''))).toMatchObject([{ type: Type.Number }]); }); }); csstype-3.1.3/__tests__/typescript-utils.ts000066400000000000000000000005741453431544100210740ustar00rootroot00000000000000import * as path from 'path'; export const COMPILER_OPTIONS = { noEmit: true, strict: true, types: [], }; const rootPosixPath = path.resolve(__dirname, '..').replace(/\\/g, '/') + '/'; const rootWin32Path = rootPosixPath.replace(/\//g, '\\'); export function removeAbsolutePaths(message: string) { return message.replace(rootPosixPath, '').replace(rootWin32Path, ''); } csstype-3.1.3/build.ts000066400000000000000000000044111453431544100146630ustar00rootroot00000000000000import * as chokidar from 'chokidar'; import * as path from 'path'; import * as prettier from 'prettier'; import { FLOW_FILENAME, TYPESCRIPT_FILENAME, writeFileAsync } from './utils'; import { runCLI } from 'jest'; if (process.argv.includes('--start')) { trigger() .then(() => { process.exit(0); }) .catch(e => { console.error(e); process.exit(1); }); } else if (process.argv.includes('--watch')) { trigger() .catch(e => { console.error(e); }) .then(() => { console.info('Done! Watching...'); let debounce: NodeJS.Timer; chokidar.watch(path.join(__dirname, 'src'), { ignored: '*.json', ignoreInitial: true }).on('all', () => { clearTimeout(debounce); debounce = setTimeout( () => trigger() .catch(e => console.error(e)) .then(() => console.info('Done! Moving on...')), 300, ); }); }); } export default async function trigger() { console.info('Generating...'); const { unformattedFlow, unformattedTypescript } = await create(); console.info('Formatting...'); const [flow, typescript] = await Promise.all([ format(unformattedFlow, 'flow'), format(unformattedTypescript, 'typescript'), ]); console.info(`Writing files...`); await Promise.all([writeFileAsync(FLOW_FILENAME, flow), writeFileAsync(TYPESCRIPT_FILENAME, typescript)]); console.info('Testing...'); await testing(); } async function create() { const generatePath = path.resolve('./src'); for (const key in require.cache) { if (key.indexOf(generatePath) !== -1) { delete require.cache[key]; } } const { default: generateFlow } = await import('./src/flow'); const { default: generateTypescript } = await import('./src/typescript'); return { unformattedFlow: await generateFlow(), unformattedTypescript: await generateTypescript() }; } async function format(output: string, parser: prettier.BuiltInParserName) { const options = await prettier.resolveConfig(path.join(__dirname, '.prettierrc')); return prettier.format(output, { ...options, printWidth: 180, singleQuote: false, parser, }); } function testing() { return runCLI({ testMatch: ['**/__tests__/dist.*.ts'], runInBand: true } as any, [__dirname]); } csstype-3.1.3/index.d.ts000066400000000000000000033437141453431544100151340ustar00rootroot00000000000000export {}; export type PropertyValue = TValue extends Array ? Array : TValue extends infer TUnpacked & {} ? TUnpacked : TValue; export type Fallback = { [P in keyof T]: T[P] | readonly NonNullable[] }; export interface StandardLonghandProperties { /** * The **`accent-color`** CSS property sets the accent color for user-interface controls generated by some elements. * * **Syntax**: `auto | ` * * **Initial value**: `auto` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :------: | :--: | :-: | * | **93** | **92** | **15.4** | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/accent-color */ accentColor?: Property.AccentColor | undefined; /** * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. * * **Syntax**: `normal | | | ? ` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **28** | **9** | **12** | **11** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-content */ alignContent?: Property.AlignContent | undefined; /** * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. * * **Syntax**: `normal | stretch | | [ ? ]` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **20** | **9** | **12** | **11** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-items */ alignItems?: Property.AlignItems | undefined; /** * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. * * **Syntax**: `auto | normal | stretch | | ? ` * * **Initial value**: `auto` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **20** | **9** | **12** | **10** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-self */ alignSelf?: Property.AlignSelf | undefined; /** * The **`align-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their block axis. * * **Syntax**: `[ normal | | | ? ]#` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :--: | :-: | * | No | n/a | No | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/align-tracks */ alignTracks?: Property.AlignTracks | undefined; /** * The **`animation-composition`** CSS property specifies the composite operation to use when multiple animations affect the same property simultaneously. * * **Syntax**: `#` * * **Initial value**: `replace` * * | Chrome | Firefox | Safari | Edge | IE | * | :-----: | :-----: | :----: | :--: | :-: | * | **112** | **115** | **16** | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/animation-composition */ animationComposition?: Property.AnimationComposition | undefined; /** * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. * * **Syntax**: `