alicezetion 1.8.7 → 1.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/.cache/replit/modules/{nodejs-20:v25-20240206-fdbd396.res → nodejs-20:v28-20240213-3f08513.res} +1 -1
  2. package/.cache/replit/modules/replit:v5-20240209-9e3a339.res +1 -0
  3. package/.cache/typescript/5.3/node_modules/.package-lock.json +32 -3
  4. package/.cache/typescript/5.3/node_modules/@types/prop-types/LICENSE +21 -0
  5. package/.cache/typescript/5.3/node_modules/@types/prop-types/README.md +15 -0
  6. package/.cache/typescript/5.3/node_modules/@types/prop-types/index.d.ts +98 -0
  7. package/.cache/typescript/5.3/node_modules/@types/prop-types/package.json +35 -0
  8. package/.cache/typescript/5.3/node_modules/@types/react/LICENSE +21 -0
  9. package/.cache/typescript/5.3/node_modules/@types/react/README.md +15 -0
  10. package/.cache/typescript/5.3/node_modules/@types/react/canary.d.ts +112 -0
  11. package/.cache/typescript/5.3/node_modules/@types/react/experimental.d.ts +126 -0
  12. package/.cache/typescript/5.3/node_modules/@types/react/global.d.ts +158 -0
  13. package/.cache/typescript/5.3/node_modules/@types/react/index.d.ts +4351 -0
  14. package/.cache/typescript/5.3/node_modules/@types/react/jsx-dev-runtime.d.ts +13 -0
  15. package/.cache/typescript/5.3/node_modules/@types/react/jsx-runtime.d.ts +13 -0
  16. package/.cache/typescript/5.3/node_modules/@types/react/package.json +206 -0
  17. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/canary.d.ts +112 -0
  18. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/experimental.d.ts +126 -0
  19. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/global.d.ts +158 -0
  20. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/index.d.ts +4333 -0
  21. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/jsx-dev-runtime.d.ts +12 -0
  22. package/.cache/typescript/5.3/node_modules/@types/react/ts5.0/jsx-runtime.d.ts +12 -0
  23. package/.cache/typescript/5.3/node_modules/@types/scheduler/LICENSE +21 -0
  24. package/.cache/typescript/5.3/node_modules/@types/scheduler/README.md +15 -0
  25. package/.cache/typescript/5.3/node_modules/@types/scheduler/index.d.ts +30 -0
  26. package/.cache/typescript/5.3/node_modules/@types/scheduler/package.json +30 -0
  27. package/.cache/typescript/5.3/node_modules/@types/scheduler/tracing.d.ts +127 -0
  28. package/.cache/typescript/5.3/node_modules/csstype/LICENSE +19 -0
  29. package/.cache/typescript/5.3/node_modules/csstype/README.md +277 -0
  30. package/.cache/typescript/5.3/node_modules/csstype/index.d.ts +21297 -0
  31. package/.cache/typescript/5.3/node_modules/csstype/index.js.flow +6612 -0
  32. package/.cache/typescript/5.3/node_modules/csstype/package.json +66 -0
  33. package/.cache/typescript/5.3/node_modules/types-registry/index.json +1 -1
  34. package/.cache/typescript/5.3/node_modules/types-registry/package.json +2 -2
  35. package/.cache/typescript/5.3/package-lock.json +34 -4
  36. package/.cache/typescript/5.3/package.json +1 -1
  37. package/leiamnash/listenMqtt.js +823 -814
  38. package/package.json +1 -1
  39. package/.cache/replit/modules/replit:v4-20240206-fdbd396.res +0 -1
@@ -0,0 +1,12 @@
1
+ import * as React from "./";
2
+
3
+ export namespace JSX {
4
+ interface Element extends React.JSX.Element {}
5
+ interface ElementClass extends React.JSX.ElementClass {}
6
+ interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
7
+ interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
8
+ type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
9
+ interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
10
+ interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
11
+ interface IntrinsicElements extends React.JSX.IntrinsicElements {}
12
+ }
@@ -0,0 +1,12 @@
1
+ import * as React from "./";
2
+
3
+ export namespace JSX {
4
+ interface Element extends React.JSX.Element {}
5
+ interface ElementClass extends React.JSX.ElementClass {}
6
+ interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
7
+ interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
8
+ type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
9
+ interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
10
+ interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
11
+ interface IntrinsicElements extends React.JSX.IntrinsicElements {}
12
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,15 @@
1
+ # Installation
2
+ > `npm install --save @types/scheduler`
3
+
4
+ # Summary
5
+ This package contains type definitions for scheduler (https://reactjs.org/).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scheduler.
9
+
10
+ ### Additional Details
11
+ * Last updated: Wed, 22 Nov 2023 00:24:48 GMT
12
+ * Dependencies: none
13
+
14
+ # Credits
15
+ These definitions were written by [Nathan Bierema](https://github.com/Methuselah96), and [Sebastian Silbermann](https://github.com/eps1lon).
@@ -0,0 +1,30 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
2
+ export type FrameCallbackType = (didTimeout: boolean) => FrameCallbackType | void;
3
+ export interface CallbackNode {
4
+ callback: FrameCallbackType;
5
+ priorityLevel: number;
6
+ expirationTime: number;
7
+ next: CallbackNode | null;
8
+ prev: CallbackNode | null;
9
+ }
10
+
11
+ export const unstable_ImmediatePriority = 1;
12
+ export const unstable_UserBlockingPriority = 2;
13
+ export const unstable_NormalPriority = 3;
14
+ export const unstable_IdlePriority = 5;
15
+ export const unstable_LowPriority = 4;
16
+ export function unstable_runWithPriority<T>(priorityLevel: number, eventHandler: () => T): T;
17
+ export function unstable_scheduleCallback(
18
+ priorityLevel: number,
19
+ callback: FrameCallbackType,
20
+ options?: { delay?: number | undefined; timeout?: number | undefined },
21
+ ): CallbackNode;
22
+ export function unstable_next<T>(eventHandler: () => T): T;
23
+ export function unstable_cancelCallback(callbackNode: CallbackNode): void;
24
+ export function unstable_wrapCallback(callback: FrameCallbackType): () => FrameCallbackType;
25
+ export function unstable_getCurrentPriorityLevel(): number;
26
+ export function unstable_shouldYield(): boolean;
27
+ export function unstable_continueExecution(): void;
28
+ export function unstable_pauseExecution(): void;
29
+ export function unstable_getFirstCallbackNode(): CallbackNode | null;
30
+ export function unstable_now(): number;
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@types/scheduler",
3
+ "version": "0.16.8",
4
+ "description": "TypeScript definitions for scheduler",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scheduler",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Nathan Bierema",
10
+ "githubUsername": "Methuselah96",
11
+ "url": "https://github.com/Methuselah96"
12
+ },
13
+ {
14
+ "name": "Sebastian Silbermann",
15
+ "githubUsername": "eps1lon",
16
+ "url": "https://github.com/eps1lon"
17
+ }
18
+ ],
19
+ "main": "",
20
+ "types": "index.d.ts",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
24
+ "directory": "types/scheduler"
25
+ },
26
+ "scripts": {},
27
+ "dependencies": {},
28
+ "typesPublisherContentHash": "9d7d043580552b4f12920f8562a456a2a9799eee67136f013daf1bf22f17fbb6",
29
+ "typeScriptVersion": "4.5"
30
+ }
@@ -0,0 +1,127 @@
1
+ // disable automatic export
2
+ export {};
3
+ /**
4
+ * This type is only interesting if you're only using this module for a specifc build environment.
5
+ *
6
+ * With module augmentation you can declare what build of scheduler you are using by
7
+ * augmenting this interface with e.g. `interface Build { type: 'development'; }`
8
+ * Depending on the build some exported members have different types.
9
+ * Possible values are `production`, `profiling` and `development`.
10
+ * The default behavior for the types is to use a union of all possible types.
11
+ */
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface Build {}
14
+
15
+ export type EnableSchedulerTracing = Build extends { type: infer BuildType }
16
+ ? BuildType extends "production" | "profiling" ? false
17
+ : BuildType extends "development" ? true
18
+ : undefined
19
+ : undefined;
20
+
21
+ type TypeByBuildFlag<
22
+ Flag extends boolean | undefined,
23
+ WhenTrue,
24
+ WhenFalse,
25
+ > = Flag extends undefined ? (WhenTrue | WhenFalse)
26
+ : Flag extends true ? WhenTrue
27
+ : WhenFalse;
28
+
29
+ type IfSchedulerTracing<WhenTrue, WhenFalse> = TypeByBuildFlag<
30
+ EnableSchedulerTracing,
31
+ WhenTrue,
32
+ WhenFalse
33
+ >;
34
+
35
+ export interface Interaction {
36
+ __count: number;
37
+ id: number;
38
+ name: string;
39
+ timestamp: number;
40
+ }
41
+
42
+ export interface Subscriber {
43
+ /**
44
+ * A new interaction has been created via the trace() method.
45
+ */
46
+ onInteractionTraced: (interaction: Interaction) => void;
47
+
48
+ /**
49
+ * All scheduled async work for an interaction has finished.
50
+ */
51
+ onInteractionScheduledWorkCompleted: (interaction: Interaction) => void;
52
+
53
+ /**
54
+ * New async work has been scheduled for a set of interactions.
55
+ * When this work is later run, onWorkStarted/onWorkStopped will be called.
56
+ * A batch of async/yieldy work may be scheduled multiple times before completing.
57
+ * In that case, onWorkScheduled may be called more than once before onWorkStopped.
58
+ * Work is scheduled by a "thread" which is identified by a unique ID.
59
+ */
60
+ onWorkScheduled: (interactions: Set<Interaction>, threadID: number) => void;
61
+
62
+ /**
63
+ * A batch of scheduled work has been canceled.
64
+ * Work is done by a "thread" which is identified by a unique ID.
65
+ */
66
+ onWorkCanceled: (interactions: Set<Interaction>, threadID: number) => void;
67
+
68
+ /**
69
+ * A batch of work has started for a set of interactions.
70
+ * When this work is complete, onWorkStopped will be called.
71
+ * Work is not always completed synchronously; yielding may occur in between.
72
+ * A batch of async/yieldy work may also be re-started before completing.
73
+ * In that case, onWorkStarted may be called more than once before onWorkStopped.
74
+ * Work is done by a "thread" which is identified by a unique ID.
75
+ */
76
+ onWorkStarted: (interactions: Set<Interaction>, threadID: number) => void;
77
+
78
+ /**
79
+ * A batch of work has completed for a set of interactions.
80
+ * Work is done by a "thread" which is identified by a unique ID.
81
+ */
82
+ onWorkStopped: (interactions: Set<Interaction>, threadID: number) => void;
83
+ }
84
+
85
+ export interface InteractionsRef {
86
+ current: Set<Interaction>;
87
+ }
88
+
89
+ export interface SubscriberRef {
90
+ current: Subscriber | null;
91
+ }
92
+
93
+ export const __interactionsRef: IfSchedulerTracing<InteractionsRef, null>;
94
+ export const __subscriberRef: IfSchedulerTracing<SubscriberRef, null>;
95
+
96
+ export function unstable_clear<T>(callback: () => T): T;
97
+
98
+ export function unstable_getCurrent(): Set<Interaction> | null;
99
+
100
+ export function unstable_getThreadID(): number;
101
+
102
+ export function unstable_trace<T>(
103
+ name: string,
104
+ timestamp: number,
105
+ callback: () => T,
106
+ threadID?: number,
107
+ ): T;
108
+
109
+ export type WrappedFunction<T extends (...args: any[]) => any> = T & {
110
+ cancel: () => void;
111
+ };
112
+
113
+ /**
114
+ * The callback is immediately returned if the enableSchedulerTracing is disabled.
115
+ * It is unclear for which bundles this is the case.
116
+ *
117
+ * @param callback
118
+ * @param threadID
119
+ */
120
+ export function unstable_wrap<T extends (...args: any[]) => any>(
121
+ callback: T,
122
+ threadID?: number,
123
+ ): IfSchedulerTracing<WrappedFunction<T>, T>;
124
+
125
+ export function unstable_subscribe(subscriber: Subscriber): void;
126
+
127
+ export function unstable_unsubscribe(subscriber: Subscriber): void;
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2017-2018 Fredrik Nicol
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,277 @@
1
+ # CSSType
2
+
3
+ [![npm](https://img.shields.io/npm/v/csstype.svg)](https://www.npmjs.com/package/csstype)
4
+
5
+ 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.
6
+
7
+ **TypeScript**
8
+
9
+ ```ts
10
+ import type * as CSS from 'csstype';
11
+
12
+ const style: CSS.Properties = {
13
+ colour: 'white', // Type error on property
14
+ textAlign: 'middle', // Type error on value
15
+ };
16
+ ```
17
+
18
+ **Flow**
19
+
20
+ ```js
21
+ // @flow strict
22
+ import * as CSS from 'csstype';
23
+
24
+ const style: CSS.Properties<> = {
25
+ colour: 'white', // Type error on property
26
+ textAlign: 'middle', // Type error on value
27
+ };
28
+ ```
29
+
30
+ _Further examples below will be in TypeScript!_
31
+
32
+ ## Getting started
33
+
34
+ ```sh
35
+ $ npm install csstype
36
+ ```
37
+
38
+ ## Table of content
39
+
40
+ - [Style types](#style-types)
41
+ - [At-rule types](#at-rule-types)
42
+ - [Pseudo types](#pseudo-types)
43
+ - [Generics](#generics)
44
+ - [Usage](#usage)
45
+ - [What should I do when I get type errors?](#what-should-i-do-when-i-get-type-errors)
46
+ - [Version 3.0](#version-30)
47
+ - [Contributing](#contributing)
48
+
49
+ ## Style types
50
+
51
+ Properties are categorized in different uses and in several technical variations to provide typings that suits as many as possible.
52
+
53
+ | | Default | `Hyphen` | `Fallback` | `HyphenFallback` |
54
+ | -------------- | -------------------- | -------------------------- | ---------------------------- | ---------------------------------- |
55
+ | **All** | `Properties` | `PropertiesHyphen` | `PropertiesFallback` | `PropertiesHyphenFallback` |
56
+ | **`Standard`** | `StandardProperties` | `StandardPropertiesHyphen` | `StandardPropertiesFallback` | `StandardPropertiesHyphenFallback` |
57
+ | **`Vendor`** | `VendorProperties` | `VendorPropertiesHyphen` | `VendorPropertiesFallback` | `VendorPropertiesHyphenFallback` |
58
+ | **`Obsolete`** | `ObsoleteProperties` | `ObsoletePropertiesHyphen` | `ObsoletePropertiesFallback` | `ObsoletePropertiesHyphenFallback` |
59
+ | **`Svg`** | `SvgProperties` | `SvgPropertiesHyphen` | `SvgPropertiesFallback` | `SvgPropertiesHyphenFallback` |
60
+
61
+ Categories:
62
+
63
+ - **All** - Includes `Standard`, `Vendor`, `Obsolete` and `Svg`
64
+ - **`Standard`** - Current properties and extends subcategories `StandardLonghand` and `StandardShorthand` _(e.g. `StandardShorthandProperties`)_
65
+ - **`Vendor`** - Vendor prefixed properties and extends subcategories `VendorLonghand` and `VendorShorthand` _(e.g. `VendorShorthandProperties`)_
66
+ - **`Obsolete`** - Removed or deprecated properties
67
+ - **`Svg`** - SVG-specific properties
68
+
69
+ Variations:
70
+
71
+ - **Default** - JavaScript (camel) cased property names
72
+ - **`Hyphen`** - CSS (kebab) cased property names
73
+ - **`Fallback`** - Also accepts array of values e.g. `string | string[]`
74
+
75
+ ## At-rule types
76
+
77
+ At-rule interfaces with descriptors.
78
+
79
+ **TypeScript**: These will be found in the `AtRule` namespace, e.g. `AtRule.Viewport`.
80
+ **Flow**: These will be prefixed with `AtRule$`, e.g. `AtRule$Viewport`.
81
+
82
+ | | Default | `Hyphen` | `Fallback` | `HyphenFallback` |
83
+ | -------------------- | -------------- | -------------------- | ---------------------- | ---------------------------- |
84
+ | **`@counter-style`** | `CounterStyle` | `CounterStyleHyphen` | `CounterStyleFallback` | `CounterStyleHyphenFallback` |
85
+ | **`@font-face`** | `FontFace` | `FontFaceHyphen` | `FontFaceFallback` | `FontFaceHyphenFallback` |
86
+ | **`@viewport`** | `Viewport` | `ViewportHyphen` | `ViewportFallback` | `ViewportHyphenFallback` |
87
+
88
+ ## Pseudo types
89
+
90
+ String literals of pseudo classes and pseudo elements
91
+
92
+ - `Pseudos`
93
+
94
+ Extends:
95
+
96
+ - `AdvancedPseudos`
97
+
98
+ 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.
99
+
100
+ - `SimplePseudos`
101
+
102
+ Plain pseudos e.g. `:hover` that can only be **one** variation.
103
+
104
+ ## Generics
105
+
106
+ All interfaces has two optional generic argument to define length and time: `CSS.Properties<TLength = string | 0, TTime = string>`
107
+
108
+ - **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.
109
+ ```tsx
110
+ const style: CSS.Properties<string | number> = {
111
+ width: 100,
112
+ };
113
+ ```
114
+ - **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.
115
+ ```tsx
116
+ const style: CSS.Properties<string | number, number> = {
117
+ transitionDuration: 1000,
118
+ };
119
+ ```
120
+
121
+ ## Usage
122
+
123
+ ```ts
124
+ import type * as CSS from 'csstype';
125
+
126
+ const style: CSS.Properties = {
127
+ width: '10px',
128
+ margin: '1em',
129
+ };
130
+ ```
131
+
132
+ 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.
133
+
134
+ ```ts
135
+ import type * as CSS from 'csstype';
136
+
137
+ const style: CSS.PropertiesFallback = {
138
+ display: ['-webkit-flex', 'flex'],
139
+ color: 'white',
140
+ };
141
+ ```
142
+
143
+ There's even string literals for pseudo selectors and elements.
144
+
145
+ ```ts
146
+ import type * as CSS from 'csstype';
147
+
148
+ const pseudos: { [P in CSS.SimplePseudos]?: CSS.Properties } = {
149
+ ':hover': {
150
+ display: 'flex',
151
+ },
152
+ };
153
+ ```
154
+
155
+ 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`.
156
+
157
+ ```ts
158
+ import type * as CSS from 'csstype';
159
+
160
+ interface Style extends CSS.Properties, CSS.PropertiesHyphen {}
161
+
162
+ const style: Style = {
163
+ 'flex-grow': 1,
164
+ 'flex-shrink': 0,
165
+ 'font-weight': 'normal',
166
+ backgroundColor: 'white',
167
+ };
168
+ ```
169
+
170
+ Adding type checked CSS properties to a `HTMLElement`.
171
+
172
+ ```ts
173
+ import type * as CSS from 'csstype';
174
+
175
+ const style: CSS.Properties = {
176
+ color: 'red',
177
+ margin: '1em',
178
+ };
179
+
180
+ let button = document.createElement('button');
181
+
182
+ Object.assign(button.style, style);
183
+ ```
184
+
185
+ ## What should I do when I get type errors?
186
+
187
+ 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:
188
+
189
+ _If you're using CSS Custom Properties you can step directly to step 3._
190
+
191
+ 1. **First of all, make sure you're doing it right.** A type error could also indicate that you're not :wink:
192
+
193
+ - 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
194
+ - 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
195
+
196
+ 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.
197
+ 3. Fix the issue locally with **TypeScript** (Flow further down):
198
+
199
+ - The recommended way is to use **module augmentation**. Here's a few examples:
200
+
201
+ ```ts
202
+ // My css.d.ts file
203
+ import type * as CSS from 'csstype';
204
+
205
+ declare module 'csstype' {
206
+ interface Properties {
207
+ // Add a missing property
208
+ WebkitRocketLauncher?: string;
209
+
210
+ // Add a CSS Custom Property
211
+ '--theme-color'?: 'black' | 'white';
212
+
213
+ // Allow namespaced CSS Custom Properties
214
+ [index: `--theme-${string}`]: any;
215
+
216
+ // Allow any CSS Custom Properties
217
+ [index: `--${string}`]: any;
218
+
219
+ // ...or allow any other property
220
+ [index: string]: any;
221
+ }
222
+ }
223
+ ```
224
+
225
+ - The alternative way is to use **type assertion**. Here's a few examples:
226
+
227
+ ```ts
228
+ const style: CSS.Properties = {
229
+ // Add a missing property
230
+ ['WebkitRocketLauncher' as any]: 'launching',
231
+
232
+ // Add a CSS Custom Property
233
+ ['--theme-color' as any]: 'black',
234
+ };
235
+ ```
236
+
237
+ Fix the issue locally with **Flow**:
238
+
239
+ - Use **type assertion**. Here's a few examples:
240
+
241
+ ```js
242
+ const style: $Exact<CSS.Properties<*>> = {
243
+ // Add a missing property
244
+ [('WebkitRocketLauncher': any)]: 'launching',
245
+
246
+ // Add a CSS Custom Property
247
+ [('--theme-color': any)]: 'black',
248
+ };
249
+ ```
250
+
251
+ ## Version 3.0
252
+
253
+ - **All property types are exposed with namespace**
254
+ TypeScript: `Property.AlignContent` (was `AlignContentProperty` before)
255
+ Flow: `Property$AlignContent`
256
+ - **All at-rules are exposed with namespace**
257
+ TypeScript: `AtRule.FontFace` (was `FontFace` before)
258
+ Flow: `AtRule$FontFace`
259
+ - **Data types are NOT exposed**
260
+ E.g. `Color` and `Box`. Because the generation of data types may suddenly be removed or renamed.
261
+ - **TypeScript hack for autocompletion**
262
+ Uses `(string & {})` for literal string unions and `(number & {})` for literal number unions ([related issue](https://github.com/microsoft/TypeScript/issues/29729)). Utilize `PropertyValue<T>` to unpack types from e.g. `(string & {})` to `string`.
263
+ - **New generic for time**
264
+ Read more on the ["Generics"](#generics) section.
265
+ - **Flow types improvements**
266
+ Flow Strict enabled and exact types are used.
267
+
268
+ ## Contributing
269
+
270
+ **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.
271
+
272
+ ### Commands
273
+
274
+ - `npm run build` Generates typings and type checks them
275
+ - `npm run watch` Runs build on each save
276
+ - `npm run test` Runs the tests
277
+ - `npm run lazy` Type checks, lints and formats everything