inferred-types 0.52.4 → 0.52.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/Tailwind.d.ts +56 -7
- package/dist/constants/Tailwind.d.ts.map +1 -1
- package/dist/constants/Tailwind.js +67 -7
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs +148 -26
- package/dist/index.js +130 -26
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/datetime/asDate.d.ts +1 -1
- package/dist/runtime/datetime/asDate.d.ts.map +1 -1
- package/dist/runtime/datetime/asDate.js +1 -1
- package/dist/runtime/datetime/getDay.d.ts.map +1 -1
- package/dist/runtime/datetime/getDay.js +3 -0
- package/dist/runtime/datetime/getDaysBetween.d.ts.map +1 -1
- package/dist/runtime/datetime/getDaysBetween.js +3 -0
- package/dist/runtime/datetime/getWeekNumber.d.ts.map +1 -1
- package/dist/runtime/datetime/getWeekNumber.js +3 -0
- package/dist/runtime/datetime/isLeapYear.d.ts.map +1 -1
- package/dist/runtime/datetime/isLeapYear.js +4 -1
- package/dist/runtime/runtime-types/css/createCssKeyframe.d.ts +7 -0
- package/dist/runtime/runtime-types/css/createCssKeyframe.d.ts.map +1 -0
- package/dist/runtime/runtime-types/css/createCssKeyframe.js +7 -0
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/type-conversion/index.d.ts +1 -0
- package/dist/runtime/type-conversion/index.d.ts.map +1 -1
- package/dist/runtime/type-conversion/index.js +1 -0
- package/dist/runtime/type-conversion/tw-conversion.d.ts +13 -0
- package/dist/runtime/type-conversion/tw-conversion.d.ts.map +1 -0
- package/dist/runtime/type-conversion/tw-conversion.js +20 -0
- package/dist/runtime/type-guards/date-time/isThisWeek.d.ts.map +1 -1
- package/dist/runtime/type-guards/date-time/isThisWeek.js +2 -5
- package/dist/runtime/type-guards/date-time/isThisYear.d.ts +10 -1
- package/dist/runtime/type-guards/date-time/isThisYear.d.ts.map +1 -1
- package/dist/runtime/type-guards/date-time/isThisYear.js +17 -23
- package/dist/runtime/type-guards/date-time/isTomorrow.d.ts +1 -1
- package/dist/runtime/type-guards/date-time/isTomorrow.js +1 -1
- package/dist/runtime/type-guards/date-time/isYesterday.d.ts +2 -2
- package/dist/runtime/type-guards/date-time/isYesterday.d.ts.map +1 -1
- package/dist/runtime/type-guards/date-time/isYesterday.js +1 -1
- package/dist/runtime/type-guards/index.d.ts +1 -0
- package/dist/runtime/type-guards/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/index.js +1 -0
- package/dist/runtime/type-guards/tw/index.d.ts +2 -0
- package/dist/runtime/type-guards/tw/index.d.ts.map +1 -0
- package/dist/runtime/type-guards/tw/index.js +1 -0
- package/dist/runtime/type-guards/tw/tw-color.d.ts +79 -0
- package/dist/runtime/type-guards/tw/tw-color.d.ts.map +1 -0
- package/dist/runtime/type-guards/tw/tw-color.js +105 -0
- package/dist/types/string-literals/character-sets/css/absolute.d.ts +54 -0
- package/dist/types/string-literals/character-sets/css/absolute.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/absolute.js +1 -0
- package/dist/types/string-literals/character-sets/css/align.d.ts +15 -0
- package/dist/types/string-literals/character-sets/css/align.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/align.js +1 -0
- package/dist/types/string-literals/character-sets/css/animation.d.ts +46 -0
- package/dist/types/string-literals/character-sets/css/animation.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/animation.js +1 -0
- package/dist/types/string-literals/character-sets/css/background.d.ts +17 -0
- package/dist/types/string-literals/character-sets/css/background.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/background.js +1 -0
- package/dist/types/string-literals/character-sets/css/border.d.ts +201 -0
- package/dist/types/string-literals/character-sets/css/border.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/border.js +1 -0
- package/dist/types/string-literals/character-sets/css/box.d.ts +18 -0
- package/dist/types/string-literals/character-sets/css/box.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/box.js +1 -0
- package/dist/types/string-literals/character-sets/css/break.d.ts +12 -0
- package/dist/types/string-literals/character-sets/css/break.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/break.js +1 -0
- package/dist/types/string-literals/character-sets/css/color.d.ts +2 -1
- package/dist/types/string-literals/character-sets/css/color.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/definition.d.ts +185 -0
- package/dist/types/string-literals/character-sets/css/definition.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/definition.js +1 -0
- package/dist/types/string-literals/character-sets/css/display-position.d.ts +2 -2
- package/dist/types/string-literals/character-sets/css/display-position.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/font.d.ts +75 -0
- package/dist/types/string-literals/character-sets/css/font.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/font.js +1 -0
- package/dist/types/string-literals/character-sets/css/functions.d.ts +1 -1
- package/dist/types/string-literals/character-sets/css/functions.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/index.d.ts +20 -1
- package/dist/types/string-literals/character-sets/css/index.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/index.js +20 -1
- package/dist/types/string-literals/character-sets/css/justify.d.ts +15 -0
- package/dist/types/string-literals/character-sets/css/justify.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/justify.js +1 -0
- package/dist/types/string-literals/character-sets/css/keyframe.d.ts +6 -0
- package/dist/types/string-literals/character-sets/css/keyframe.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/keyframe.js +1 -0
- package/dist/types/string-literals/character-sets/css/margin.d.ts +28 -0
- package/dist/types/string-literals/character-sets/css/margin.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/margin.js +2 -0
- package/dist/types/string-literals/character-sets/css/offset.d.ts +21 -0
- package/dist/types/string-literals/character-sets/css/offset.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/offset.js +1 -0
- package/dist/types/string-literals/character-sets/css/outline.d.ts +21 -0
- package/dist/types/string-literals/character-sets/css/outline.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/outline.js +1 -0
- package/dist/types/string-literals/character-sets/css/overflow.d.ts +25 -2
- package/dist/types/string-literals/character-sets/css/overflow.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/padding.d.ts +27 -0
- package/dist/types/string-literals/character-sets/css/padding.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/padding.js +2 -0
- package/dist/types/string-literals/character-sets/css/place.d.ts +15 -0
- package/dist/types/string-literals/character-sets/css/place.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/place.js +1 -0
- package/dist/types/string-literals/character-sets/css/props.d.ts +44 -2
- package/dist/types/string-literals/character-sets/css/props.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/sizing.d.ts +2 -3
- package/dist/types/string-literals/character-sets/css/sizing.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/css/stroke.d.ts +17 -0
- package/dist/types/string-literals/character-sets/css/stroke.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/stroke.js +1 -0
- package/dist/types/string-literals/character-sets/css/text.d.ts +46 -0
- package/dist/types/string-literals/character-sets/css/text.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/text.js +1 -0
- package/dist/types/string-literals/character-sets/css/transform.d.ts +19 -0
- package/dist/types/string-literals/character-sets/css/transform.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/css/transform.js +1 -0
- package/dist/types/string-literals/character-sets/tw/TwColor.d.ts +27 -7
- package/dist/types/string-literals/character-sets/tw/TwColor.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/tw/TwModifer.d.ts +23 -0
- package/dist/types/string-literals/character-sets/tw/TwModifer.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/tw/TwModifer.js +1 -0
- package/dist/types/string-literals/character-sets/tw/TwSize.d.ts +8 -0
- package/dist/types/string-literals/character-sets/tw/TwSize.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/tw/TwSize.js +1 -0
- package/dist/types/string-literals/character-sets/tw/TwTarget.d.ts +56 -0
- package/dist/types/string-literals/character-sets/tw/TwTarget.d.ts.map +1 -0
- package/dist/types/string-literals/character-sets/tw/TwTarget.js +1 -0
- package/dist/types/string-literals/character-sets/tw/index.d.ts +4 -0
- package/dist/types/string-literals/character-sets/tw/index.d.ts.map +1 -1
- package/dist/types/string-literals/character-sets/tw/index.js +4 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TwModifier } from "inferred-types/types";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts all the modifiers found on the passed in string and
|
|
4
|
+
* removes them.
|
|
5
|
+
*
|
|
6
|
+
* **Related:** `getTailwindModifiers`
|
|
7
|
+
*/
|
|
8
|
+
export declare const removeTailwindModifiers: (val: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Extracts an array of Tailwind Modifiers found at the start of a Tailwind string.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getTailwindModifiers: (val: string) => TwModifier[];
|
|
13
|
+
//# sourceMappingURL=tw-conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tw-conversion.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-conversion/tw-conversion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKlD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAAS,MAAM,KAAG,MAIrD,CAAA;AAGD;;GAEG;AACH,eAAO,MAAM,oBAAoB,QAAS,MAAM,KAAG,UAAU,EAI5D,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TW_MODIFIERS } from "inferred-types/constants";
|
|
2
|
+
import { isTailwindModifier } from "inferred-types/runtime";
|
|
3
|
+
const MODS = TW_MODIFIERS.map(i => `${i}:`);
|
|
4
|
+
/**
|
|
5
|
+
* Extracts all the modifiers found on the passed in string and
|
|
6
|
+
* removes them.
|
|
7
|
+
*
|
|
8
|
+
* **Related:** `getTailwindModifiers`
|
|
9
|
+
*/
|
|
10
|
+
export const removeTailwindModifiers = (val) => {
|
|
11
|
+
return MODS.some(i => val.startsWith(i))
|
|
12
|
+
? removeTailwindModifiers(val.replace(MODS.find(i => val.startsWith(i)), ""))
|
|
13
|
+
: val;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Extracts an array of Tailwind Modifiers found at the start of a Tailwind string.
|
|
17
|
+
*/
|
|
18
|
+
export const getTailwindModifiers = (val) => {
|
|
19
|
+
return val.split(":").filter(i => isTailwindModifier(i));
|
|
20
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isThisWeek.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isThisWeek.ts"],"names":[],"mappings":"AAEA;;;;;;;EAOE;AACF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QACzE,CAAC,KACN,
|
|
1
|
+
{"version":3,"file":"isThisWeek.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isThisWeek.ts"],"names":[],"mappings":"AAEA;;;;;;;EAOE;AACF,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QACzE,CAAC,KACN,OAWF,CAAC"}
|
|
@@ -8,11 +8,8 @@ import { asDate, getWeekNumber } from "inferred-types/runtime";
|
|
|
8
8
|
* Luxon DateTime objects, and Moment.js objects.
|
|
9
9
|
*/
|
|
10
10
|
export const isThisWeek = (date) => {
|
|
11
|
-
let targetDate;
|
|
12
|
-
|
|
13
|
-
targetDate = asDate(date);
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
11
|
+
let targetDate = asDate(date);
|
|
12
|
+
if (!targetDate) {
|
|
16
13
|
return false;
|
|
17
14
|
}
|
|
18
15
|
const currentWeek = getWeekNumber();
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* A validation -- not typeguard -- on whether the passed in `val` is a date or date-time
|
|
3
3
|
* representation and that it's year is the same as the current year.
|
|
4
|
+
*
|
|
5
|
+
* Types correctly handled are:
|
|
6
|
+
*
|
|
7
|
+
* - **JS Date** object
|
|
8
|
+
* - **ISO Date** or **ISO Datetime**
|
|
9
|
+
* - a number representing a **epoch** timestamp (in seconds, not miliseconds)
|
|
10
|
+
* - **MomentJS** and **Luxon** datetime objects
|
|
11
|
+
*
|
|
12
|
+
* **Note:** an invalidate date/datetime passed in will always resolve to `false`
|
|
4
13
|
*/
|
|
5
14
|
export declare const isThisYear: (val: unknown) => boolean;
|
|
6
15
|
//# sourceMappingURL=isThisYear.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isThisYear.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isThisYear.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isThisYear.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isThisYear.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;EAYE;AACF,eAAO,MAAM,UAAU,QAChB,OAAO,KACX,OAcF,CAAC"}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isLuxonDateTime } from "./isLuxonDateTime";
|
|
1
|
+
import { asDate, isNumber, isObject, isString } from "inferred-types/runtime";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* A validation -- not typeguard -- on whether the passed in `val` is a date or date-time
|
|
5
4
|
* representation and that it's year is the same as the current year.
|
|
5
|
+
*
|
|
6
|
+
* Types correctly handled are:
|
|
7
|
+
*
|
|
8
|
+
* - **JS Date** object
|
|
9
|
+
* - **ISO Date** or **ISO Datetime**
|
|
10
|
+
* - a number representing a **epoch** timestamp (in seconds, not miliseconds)
|
|
11
|
+
* - **MomentJS** and **Luxon** datetime objects
|
|
12
|
+
*
|
|
13
|
+
* **Note:** an invalidate date/datetime passed in will always resolve to `false`
|
|
6
14
|
*/
|
|
7
15
|
export const isThisYear = (val) => {
|
|
8
16
|
// Get current year
|
|
9
17
|
const currentYear = new Date().getFullYear();
|
|
10
|
-
if (val
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return val.year() === currentYear;
|
|
15
|
-
}
|
|
16
|
-
if (isLuxonDateTime(val)) {
|
|
17
|
-
return val.year === currentYear;
|
|
18
|
-
}
|
|
19
|
-
// Handle ISO 8601 strings
|
|
20
|
-
if (typeof val === "string") {
|
|
21
|
-
// Match for full ISO 8601 date (YYYY-MM-DD) or datetime (YYYY-MM-DDThh:mm:ssZ) format
|
|
22
|
-
const isoDateRegex = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])(?:T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[-+][01]\d:[0-5]\d))?$/;
|
|
23
|
-
if (!isoDateRegex.test(val)) {
|
|
24
|
-
return false;
|
|
18
|
+
if (isObject(val) || isNumber(val) || isString(val)) {
|
|
19
|
+
const date = asDate(val);
|
|
20
|
+
if (date) {
|
|
21
|
+
return date.getFullYear() === currentYear;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (yearMatch) {
|
|
29
|
-
const year = parseInt(yearMatch[1], 10);
|
|
30
|
-
return year === currentYear;
|
|
23
|
+
else {
|
|
24
|
+
return false;
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* **isTomorrow`(val)`**
|
|
3
|
-
* A
|
|
3
|
+
* A boolean test which validates whether the passed in value _represents_ tomorrow's date
|
|
4
4
|
* as either a:
|
|
5
5
|
*
|
|
6
6
|
* - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date string, or
|
|
@@ -2,7 +2,7 @@ import { getTomorrow, isDate, isLuxonDateTime } from "inferred-types/runtime";
|
|
|
2
2
|
import { isIsoExplicitDate, isMoment, isString, stripAfter } from "inferred-types/runtime";
|
|
3
3
|
/**
|
|
4
4
|
* **isTomorrow`(val)`**
|
|
5
|
-
* A
|
|
5
|
+
* A boolean test which validates whether the passed in value _represents_ tomorrow's date
|
|
6
6
|
* as either a:
|
|
7
7
|
*
|
|
8
8
|
* - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date string, or
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* **isYesterday`(val)`**
|
|
3
|
-
* A
|
|
3
|
+
* A boolean test whether on whether the passed in value _represents_ yesterday's date
|
|
4
4
|
* as either a:
|
|
5
5
|
*
|
|
6
6
|
* - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date string, or
|
|
7
7
|
* - [Moment.js](https://momentjs.com/docs/#/displaying/) DateTime object, or
|
|
8
8
|
* - [Luxon](https://moment.github.io/luxon/#/?id=luxon) DateTime object
|
|
9
9
|
*/
|
|
10
|
-
export declare const isYesterday:
|
|
10
|
+
export declare const isYesterday: (test: unknown) => boolean;
|
|
11
11
|
//# sourceMappingURL=isYesterday.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isYesterday.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isYesterday.ts"],"names":[],"mappings":"AAIA;;;;;;;;EAQE;AACF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"isYesterday.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/date-time/isYesterday.ts"],"names":[],"mappings":"AAIA;;;;;;;;EAQE;AACF,eAAO,MAAM,WAAW,SAChB,OAAO,KACZ,OAeF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { getYesterday, isDate, isLuxonDateTime } from "inferred-types/runtime";
|
|
|
2
2
|
import { isIsoExplicitDate, isMoment, isString, stripAfter } from "inferred-types/runtime";
|
|
3
3
|
/**
|
|
4
4
|
* **isYesterday`(val)`**
|
|
5
|
-
* A
|
|
5
|
+
* A boolean test whether on whether the passed in value _represents_ yesterday's date
|
|
6
6
|
* as either a:
|
|
7
7
|
*
|
|
8
8
|
* - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date string, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/type-guards/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;A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,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/tw/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tw-color";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Opt, TwColor, TwColorOptionalOpacity, TwColorTarget, TwColorWithLuminosity, TwColorWithLuminosityOpacity, TwModifier, TwTarget__Color, TwTarget__Color__Light } from "inferred-types/types";
|
|
2
|
+
/**
|
|
3
|
+
* **isTailwindColor**`(val)`
|
|
4
|
+
*
|
|
5
|
+
* A type guard which validates whether the `val` passed in is a
|
|
6
|
+
* [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
7
|
+
* color (e.g., `blue`, `sky`, `slate`, etc.).
|
|
8
|
+
*
|
|
9
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosityAndOpacity`
|
|
10
|
+
*/
|
|
11
|
+
export declare const isTailwindColorName: (val: unknown) => val is TwColor;
|
|
12
|
+
/**
|
|
13
|
+
* **isTailwindColorWithLuminosity**`(val)`
|
|
14
|
+
*
|
|
15
|
+
* A type guard which validates whether the `val` passed in is a [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
16
|
+
* color with luminosity string (e.g., `blue-300`, `purple-900`).
|
|
17
|
+
*
|
|
18
|
+
* - this also allows the colors `white` and `black` which are mapped to a luminosity level
|
|
19
|
+
* but do not have variant luminosities
|
|
20
|
+
*
|
|
21
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosityAndOpacity`
|
|
22
|
+
*/
|
|
23
|
+
export declare const isTailwindColorWithLuminosity: (val: unknown) => val is TwColorWithLuminosity;
|
|
24
|
+
/**
|
|
25
|
+
* **isTailwindColorWithLuminosityAndOpacity**`(val)`
|
|
26
|
+
*
|
|
27
|
+
* A type guard which validates whether the `val` passed in is a [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
28
|
+
* color string with both **luminosity** and **opacity** expressed (e.g., `blue-300/40`, `purple-900/75`).
|
|
29
|
+
*
|
|
30
|
+
* - this also allows the colors `white` and `black` which are mapped to a luminosity level
|
|
31
|
+
* but do not have variant luminosities
|
|
32
|
+
*
|
|
33
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosity`, `isTailwindColorName`
|
|
34
|
+
*/
|
|
35
|
+
export declare const isTailwindColorWithLuminosityAndOpacity: (val: unknown) => val is TwColorWithLuminosityOpacity;
|
|
36
|
+
/**
|
|
37
|
+
* **isTailwindColor**`(val)`
|
|
38
|
+
*
|
|
39
|
+
* A type guard which validates whether the `val` passed in is a
|
|
40
|
+
* "fully qualified" [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
41
|
+
* color string.
|
|
42
|
+
*
|
|
43
|
+
* - All color string must include a luminosity value except `white` and `black`
|
|
44
|
+
* - You may _optionally_ add an opacity value.
|
|
45
|
+
* - Examples:
|
|
46
|
+
* - `blue-500`
|
|
47
|
+
* - `white`
|
|
48
|
+
* - `black/50`
|
|
49
|
+
* - `red-700/25`
|
|
50
|
+
*
|
|
51
|
+
* **Related:** `isTailwindColorWithLuminosityAndOpacity`, `isTailwindColorWithLuminosity`, `isTargetedTailwindColor`
|
|
52
|
+
*/
|
|
53
|
+
export declare const isTailwindColor: (val: unknown) => val is TwColorOptionalOpacity;
|
|
54
|
+
/**
|
|
55
|
+
* Type guard which validates that `val` is a `TwModifier` (e.g., "dark", "focus", etc.).
|
|
56
|
+
*/
|
|
57
|
+
export declare const isTailwindModifier: (val: unknown) => val is TwModifier;
|
|
58
|
+
/**
|
|
59
|
+
* A type guard which validates that `val` is a viable "target" for a Tailwind
|
|
60
|
+
* color string (e.g., "bg", "text", "border", etc.).
|
|
61
|
+
*/
|
|
62
|
+
export declare const isTailwindColorTarget: (val: unknown) => val is TwColorTarget;
|
|
63
|
+
type FullTailwindColorClass<TAllow extends readonly TwModifier[] | readonly [true]> = TAllow["length"] extends 0 ? TwTarget__Color : TAllow["length"] extends 1 ? TAllow[0] extends TwModifier ? `${Opt<TAllow[0]>}:${TwTarget__Color}` : `${Opt<`${string}:`>}${TwTarget__Color__Light}` : TAllow["length"] extends 2 ? TAllow[0] extends TwModifier ? TAllow[1] extends TwModifier ? `${TAllow[0]}:${TAllow[1]}:${TwTarget__Color__Light}` | `${TAllow[1]}:${TAllow[0]}:${TwTarget__Color__Light}` | `${TAllow[0]}:${TwTarget__Color__Light}` | `${TAllow[1]}:${TwTarget__Color__Light}` | TwTarget__Color__Light : never : never : `${Opt<`${string}:`>}${TwTarget__Color}`;
|
|
64
|
+
/**
|
|
65
|
+
* A type guard which validates that `val` is a fully qualified Tailwind class which:
|
|
66
|
+
*
|
|
67
|
+
* - targets a valid source (e.g., "bg", "text", etc.)
|
|
68
|
+
* - has a valid color and luminosity (and optionally an opacity)
|
|
69
|
+
* - and if any _modifiers_ were at start of string they are part of the
|
|
70
|
+
* those authorized by the the `allowedModifiers` string
|
|
71
|
+
*
|
|
72
|
+
* **Note:** if `allowedModifiers` is set with a single value of `true` then all known modifiers
|
|
73
|
+
* are allowed.
|
|
74
|
+
*
|
|
75
|
+
* **Related:** `isTailwindColor`, `isTailwindColorTarget`, `isTailwindModifier`
|
|
76
|
+
*/
|
|
77
|
+
export declare const isTailwindColorClass: <TAllow extends readonly TwModifier[] | readonly [true]>(val: unknown, ...allowedModifiers: TAllow) => val is FullTailwindColorClass<TAllow>;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=tw-color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tw-color.d.ts","sourceRoot":"","sources":["../../../../src/runtime/type-guards/tw/tw-color.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,GAAG,EACH,OAAO,EACP,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,4BAA4B,EAC5B,UAAU,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,sBAAsB,CAAA;AAG7B;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QACzB,OAAO,KACX,GAAG,IAAI,OAET,CAAA;AAGD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,QAAS,OAAO,KAAG,GAAG,IAAI,qBAMnE,CAAA;AAED;;;;;;;;;;GAUG;AACH,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;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,SAAS,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,OAEjD,OAAO,uBACS,MAAM,KAC1B,GAAG,IAAI,sBAAsB,CAAC,MAAM,CAgBtC,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { TW_COLOR_TARGETS, TW_HUE, TW_LUMINOSITY, TW_MODIFIERS } from "inferred-types/constants";
|
|
2
|
+
import { getTailwindModifiers, isNumberLike, isString, removeTailwindModifiers, retainAfter, } from "inferred-types/runtime";
|
|
3
|
+
/**
|
|
4
|
+
* **isTailwindColor**`(val)`
|
|
5
|
+
*
|
|
6
|
+
* A type guard which validates whether the `val` passed in is a
|
|
7
|
+
* [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
8
|
+
* color (e.g., `blue`, `sky`, `slate`, etc.).
|
|
9
|
+
*
|
|
10
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosityAndOpacity`
|
|
11
|
+
*/
|
|
12
|
+
export const isTailwindColorName = (val) => {
|
|
13
|
+
return isString(val) && Object.keys(TW_HUE).includes(val);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* **isTailwindColorWithLuminosity**`(val)`
|
|
17
|
+
*
|
|
18
|
+
* A type guard which validates whether the `val` passed in is a [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
19
|
+
* color with luminosity string (e.g., `blue-300`, `purple-900`).
|
|
20
|
+
*
|
|
21
|
+
* - this also allows the colors `white` and `black` which are mapped to a luminosity level
|
|
22
|
+
* but do not have variant luminosities
|
|
23
|
+
*
|
|
24
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosityAndOpacity`
|
|
25
|
+
*/
|
|
26
|
+
export const isTailwindColorWithLuminosity = (val) => {
|
|
27
|
+
return isString(val) && isTailwindColorName(val.split("-")[0]) && (!["white", "black"].includes(val.split("-")[0]) || val.split("-").length === 1) && (!val.includes("-") || Object.keys(TW_LUMINOSITY).includes(retainAfter(val, "-")));
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* **isTailwindColorWithLuminosityAndOpacity**`(val)`
|
|
31
|
+
*
|
|
32
|
+
* A type guard which validates whether the `val` passed in is a [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
33
|
+
* color string with both **luminosity** and **opacity** expressed (e.g., `blue-300/40`, `purple-900/75`).
|
|
34
|
+
*
|
|
35
|
+
* - this also allows the colors `white` and `black` which are mapped to a luminosity level
|
|
36
|
+
* but do not have variant luminosities
|
|
37
|
+
*
|
|
38
|
+
* **Related:** `isTailwindColor`, `isTailwindColorWithLuminosity`, `isTailwindColorName`
|
|
39
|
+
*/
|
|
40
|
+
export const isTailwindColorWithLuminosityAndOpacity = (val) => {
|
|
41
|
+
return isString(val) &&
|
|
42
|
+
val.includes("/") &&
|
|
43
|
+
isTailwindColorWithLuminosity(val.split("/")[0]) &&
|
|
44
|
+
isNumberLike(val.split("/")[1]) &&
|
|
45
|
+
([1, 2].includes(val.split("/")[1].length) || val.split("/")[1] === "100");
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* **isTailwindColor**`(val)`
|
|
49
|
+
*
|
|
50
|
+
* A type guard which validates whether the `val` passed in is a
|
|
51
|
+
* "fully qualified" [Tailwind](https://tailwindcss.com/docs/customizing-colors)
|
|
52
|
+
* color string.
|
|
53
|
+
*
|
|
54
|
+
* - All color string must include a luminosity value except `white` and `black`
|
|
55
|
+
* - You may _optionally_ add an opacity value.
|
|
56
|
+
* - Examples:
|
|
57
|
+
* - `blue-500`
|
|
58
|
+
* - `white`
|
|
59
|
+
* - `black/50`
|
|
60
|
+
* - `red-700/25`
|
|
61
|
+
*
|
|
62
|
+
* **Related:** `isTailwindColorWithLuminosityAndOpacity`, `isTailwindColorWithLuminosity`, `isTargetedTailwindColor`
|
|
63
|
+
*/
|
|
64
|
+
export const isTailwindColor = (val) => {
|
|
65
|
+
return isTailwindColorWithLuminosity(val) || isTailwindColorWithLuminosityAndOpacity(val);
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Type guard which validates that `val` is a `TwModifier` (e.g., "dark", "focus", etc.).
|
|
69
|
+
*/
|
|
70
|
+
export const isTailwindModifier = (val) => {
|
|
71
|
+
return isString(val) && TW_MODIFIERS.some(i => val === i);
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A type guard which validates that `val` is a viable "target" for a Tailwind
|
|
75
|
+
* color string (e.g., "bg", "text", "border", etc.).
|
|
76
|
+
*/
|
|
77
|
+
export const isTailwindColorTarget = (val) => {
|
|
78
|
+
return isString(val) && TW_COLOR_TARGETS.includes(val);
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A type guard which validates that `val` is a fully qualified Tailwind class which:
|
|
82
|
+
*
|
|
83
|
+
* - targets a valid source (e.g., "bg", "text", etc.)
|
|
84
|
+
* - has a valid color and luminosity (and optionally an opacity)
|
|
85
|
+
* - and if any _modifiers_ were at start of string they are part of the
|
|
86
|
+
* those authorized by the the `allowedModifiers` string
|
|
87
|
+
*
|
|
88
|
+
* **Note:** if `allowedModifiers` is set with a single value of `true` then all known modifiers
|
|
89
|
+
* are allowed.
|
|
90
|
+
*
|
|
91
|
+
* **Related:** `isTailwindColor`, `isTailwindColorTarget`, `isTailwindModifier`
|
|
92
|
+
*/
|
|
93
|
+
export const isTailwindColorClass = (val, ...allowedModifiers) => {
|
|
94
|
+
if (isString(val)) {
|
|
95
|
+
const mods = getTailwindModifiers(val);
|
|
96
|
+
const targetted = removeTailwindModifiers(val);
|
|
97
|
+
const target = targetted.split("-")[0];
|
|
98
|
+
const color = targetted.split("-").slice(1).join("-");
|
|
99
|
+
return isTailwindColorTarget(target) &&
|
|
100
|
+
isTailwindColor(color) &&
|
|
101
|
+
(allowedModifiers[0] === true ||
|
|
102
|
+
mods.every(i => allowedModifiers.includes(i)));
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CssSizing } from "./sizing";
|
|
2
|
+
export type CssAbsolutionPositioningProperties = {
|
|
3
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/top) */
|
|
4
|
+
top?: CssSizing;
|
|
5
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/bottom) */
|
|
6
|
+
bottom?: CssSizing;
|
|
7
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/left) */
|
|
8
|
+
left?: CssSizing;
|
|
9
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/right) */
|
|
10
|
+
right?: CssSizing;
|
|
11
|
+
/**
|
|
12
|
+
* The inset CSS property is a shorthand that corresponds to the top, right, bottom,
|
|
13
|
+
* and/or left properties. It has the same multi-value syntax of the margin shorthand.
|
|
14
|
+
*
|
|
15
|
+
* This inset properties, including inset, have no effect on non-positioned elements.
|
|
16
|
+
*
|
|
17
|
+
* - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset)
|
|
18
|
+
*/
|
|
19
|
+
inset?: CssSizing | `${CssSizing} ${string}`;
|
|
20
|
+
/**
|
|
21
|
+
* The `inset-block` CSS property defines the logical block start and end offsets of an
|
|
22
|
+
* element, which maps to physical offsets depending on the element's writing mode,
|
|
23
|
+
* directionality, and text orientation. It corresponds to the top and bottom, or
|
|
24
|
+
* right and left properties depending on the values defined for writing-mode, direction,
|
|
25
|
+
* and text-orientation.
|
|
26
|
+
*
|
|
27
|
+
* This inset property has no effect on non-positioned elements.
|
|
28
|
+
*
|
|
29
|
+
* - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block)
|
|
30
|
+
*/
|
|
31
|
+
"inset-block"?: CssSizing | `${CssSizing} ${string}`;
|
|
32
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-end) */
|
|
33
|
+
"inset-block-end"?: CssSizing;
|
|
34
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-start) */
|
|
35
|
+
"inset-block-start"?: CssSizing;
|
|
36
|
+
/**
|
|
37
|
+
* The `inset-inline` CSS property defines the logical start and end offsets of an element
|
|
38
|
+
* in the inline direction, which maps to physical offsets depending on the element's
|
|
39
|
+
*
|
|
40
|
+
* writing mode, directionality, and text orientation. It corresponds to the top and
|
|
41
|
+
* bottom, or right and left properties depending on the values defined for writing-mode,
|
|
42
|
+
* direction, and text-orientation.
|
|
43
|
+
*
|
|
44
|
+
* This inset property has no effect on non-positioned elements.
|
|
45
|
+
*
|
|
46
|
+
* - [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline)
|
|
47
|
+
*/
|
|
48
|
+
"inset-inline"?: CssSizing | `${CssSizing} ${string}`;
|
|
49
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end) */
|
|
50
|
+
"inset-inline-end"?: CssSizing;
|
|
51
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start) */
|
|
52
|
+
"inset-inline-start"?: CssSizing;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=absolute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"absolute.d.ts","sourceRoot":"","sources":["../../../../../src/types/string-literals/character-sets/css/absolute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGpC,MAAM,MAAM,kCAAkC,GAAG;IAE/C,wEAAwE;IACxE,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yEAAyE;IACzE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,GAAG,SAAS,IAAI,MAAM,EAAE,CAAA;IAG5C;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;IACrD,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAEhC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,GAAG,SAAS,IAAI,MAAM,EAAE,CAAC;IACtD,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,uFAAuF;IACvF,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAGlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CssGlobal } from "./global";
|
|
2
|
+
type Positions = "normal" | "start" | "center" | "end" | "flex-start" | "flex-end" | "baseline" | "first baseline" | "space-between" | "space-around" | "space-evenly" | "stretch" | "safe center" | "unsafe center" | CssGlobal;
|
|
3
|
+
export type CssAlignContent = Positions;
|
|
4
|
+
export type CssAlignItems = Positions | "anchor-center";
|
|
5
|
+
export type CssAlignSelf = Positions | "anchor-center";
|
|
6
|
+
export type CssAlignProperties = {
|
|
7
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) */
|
|
8
|
+
"align-content"?: CssAlignContent;
|
|
9
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) */
|
|
10
|
+
"align-items"?: CssAlignItems;
|
|
11
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) */
|
|
12
|
+
"align-self"?: CssAlignSelf;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=align.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"align.d.ts","sourceRoot":"","sources":["../../../../../src/types/string-literals/character-sets/css/align.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,SAAS,GAAK,QAAQ,GACzB,OAAO,GACP,QAAQ,GACR,KAAK,GACL,YAAY,GACZ,UAAU,GACV,UAAU,GACV,gBAAgB,GAChB,eAAe,GACf,cAAc,GACd,cAAc,GACd,SAAS,GACT,aAAa,GACb,eAAe,GACf,SAAS,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,eAAe,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,eAAe,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kFAAkF;IAClF,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gFAAgF;IAChF,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Opt } from "../Optional";
|
|
2
|
+
import { CssGlobal } from "./global";
|
|
3
|
+
import { CssTiming } from "./props";
|
|
4
|
+
export type CssAnimationDelay = CssTiming;
|
|
5
|
+
type Direction = "normal" | "reverse" | "alternate" | "alternate-reverse";
|
|
6
|
+
export type CssAnimationDirection = Direction | `${Direction}${Opt<`, ${Direction}`>}` | `${Direction}${Opt<`, ${Direction}`>}${Opt<`, ${Direction}`>}${string}`;
|
|
7
|
+
export type CssAnimationDuration = CssTiming;
|
|
8
|
+
type FillMode = "none" | "forwards" | "backwards" | "both";
|
|
9
|
+
export type CssAnimationFillMode = FillMode | `${FillMode}${Opt<`, ${FillMode}`>}` | `${FillMode}${Opt<`, ${FillMode}`>}${Opt<`, ${FillMode}`>}${string}`;
|
|
10
|
+
type Count = `${number}` | "infinite";
|
|
11
|
+
export type CssAnimationIterationCount = Count | `${Count}${Opt<`, ${Count}`>}` | `${Count}${Opt<`, ${Count}`>}${Opt<`, ${Count}`>}${string}`;
|
|
12
|
+
type Composition = "replace" | "add" | "accumulate";
|
|
13
|
+
export type CssAnimationComposition = Composition | `${Composition}${Opt<`, ${Composition}`>}` | `${Composition}${Opt<`, ${Composition}`>}${Opt<`, ${Composition}`>}${string}`;
|
|
14
|
+
type TimingFunction = "ease" | "ease-in" | "ease-out" | "ease-in-out" | "linear" | "step-start" | "step-end" | `cubic-bezier(${string})` | `linear(${string})` | `steps(${string})`;
|
|
15
|
+
export type CssAnimationTimingFunction = TimingFunction | `${TimingFunction}${Opt<`, ${TimingFunction}`>}${string}`;
|
|
16
|
+
type PlayState = "paused" | "running";
|
|
17
|
+
export type CssAnimationPlayState = PlayState | `${PlayState}${Opt<`, ${PlayState}`>}` | `${PlayState}${Opt<`, ${PlayState}`>}${Opt<`, ${PlayState}`>}${string}`;
|
|
18
|
+
export type CssAnimation = `${CssAnimationDuration} ${CssAnimationTimingFunction}${string}`;
|
|
19
|
+
export type CssAnimationProperties = {
|
|
20
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation) */
|
|
21
|
+
animation?: CssAnimation | CssGlobal;
|
|
22
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-composition) */
|
|
23
|
+
"animation-composition"?: CssAnimationComposition | CssGlobal;
|
|
24
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay) */
|
|
25
|
+
"animation-delay"?: CssAnimationDelay | CssGlobal;
|
|
26
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction) */
|
|
27
|
+
"animation-direction"?: CssAnimationDirection | CssGlobal;
|
|
28
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode) */
|
|
29
|
+
"animation-fill-mode"?: CssAnimationFillMode | CssGlobal;
|
|
30
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name) */
|
|
31
|
+
"animation-name"?: string;
|
|
32
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state) */
|
|
33
|
+
"animation-play-state"?: CssAnimationPlayState | CssGlobal;
|
|
34
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range) */
|
|
35
|
+
"animation-range"?: string;
|
|
36
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-end) */
|
|
37
|
+
"animation-range-end"?: string;
|
|
38
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-range-start) */
|
|
39
|
+
"animation-range-start"?: string;
|
|
40
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timeline) */
|
|
41
|
+
"animation-timeline"?: string;
|
|
42
|
+
/** [Reference](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function) */
|
|
43
|
+
"animation-timing-function"?: CssAnimationTimingFunction | CssGlobal;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../../src/types/string-literals/character-sets/css/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE1C,KAAK,SAAS,GACZ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,mBAAmB,CAAA;AAErB,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAC3C,GAAG,SAAS,GAAG,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC,EAAE,GACtC,GAAG,SAAS,GAAG,GAAG,CAAC,KAAK,SAAS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,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CssColor } from "./color";
|
|
2
|
+
import { CssSizing } from "./sizing";
|
|
3
|
+
export type CssBackgroundProperties = {
|
|
4
|
+
background?: string;
|
|
5
|
+
"background-attachement"?: string;
|
|
6
|
+
"background-blend-mode"?: string;
|
|
7
|
+
"background-clip"?: string;
|
|
8
|
+
"background-color"?: CssColor;
|
|
9
|
+
"background-image"?: string;
|
|
10
|
+
"background-origin"?: string;
|
|
11
|
+
"background-position"?: string;
|
|
12
|
+
"background-position-x"?: string;
|
|
13
|
+
"background-position-y"?: string;
|
|
14
|
+
"background-repeat"?: string;
|
|
15
|
+
"background-size"?: CssSizing;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../../src/types/string-literals/character-sets/css/background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,QAAQ,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|