styled-components 5.3.6 → 5.3.11

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.
Files changed (256) hide show
  1. package/dist/styled-components.browser.cjs.js +1 -1
  2. package/dist/styled-components.browser.cjs.js.map +1 -1
  3. package/dist/styled-components.browser.esm.js +1 -1
  4. package/dist/styled-components.browser.esm.js.map +1 -1
  5. package/dist/styled-components.cjs.js +1 -1
  6. package/dist/styled-components.cjs.js.map +1 -1
  7. package/dist/styled-components.esm.js +1 -1
  8. package/dist/styled-components.esm.js.map +1 -1
  9. package/dist/styled-components.js +1 -1
  10. package/dist/styled-components.js.map +1 -1
  11. package/dist/styled-components.min.js +1 -1
  12. package/dist/styled-components.min.js.map +1 -1
  13. package/native/dist/base.d.ts +3 -9
  14. package/native/dist/constructors/constructWithOptions.d.ts +39 -14
  15. package/native/dist/constructors/createGlobalStyle.d.ts +2 -2
  16. package/native/dist/constructors/css.d.ts +4 -4
  17. package/native/dist/constructors/keyframes.d.ts +1 -1
  18. package/native/dist/constructors/styled.d.ts +176 -180
  19. package/native/dist/hoc/withTheme.d.ts +2 -2
  20. package/native/dist/index.d.ts +2 -2
  21. package/native/dist/models/ComponentStyle.d.ts +0 -1
  22. package/native/dist/models/GlobalStyle.d.ts +1 -1
  23. package/native/dist/models/InlineStyle.d.ts +1 -1
  24. package/native/dist/models/StyleSheetManager.d.ts +58 -15
  25. package/native/dist/models/StyledComponent.d.ts +1 -1
  26. package/native/dist/models/StyledNativeComponent.d.ts +2 -2
  27. package/native/dist/models/ThemeProvider.d.ts +5 -4
  28. package/native/dist/native/index.d.ts +28 -33
  29. package/native/dist/sheet/GroupedTag.d.ts +1 -1
  30. package/native/dist/sheet/Sheet.d.ts +3 -3
  31. package/native/dist/sheet/types.d.ts +1 -1
  32. package/native/dist/styled-components.native.cjs.js +6 -6
  33. package/native/dist/styled-components.native.cjs.js.map +1 -1
  34. package/native/dist/styled-components.native.esm.js +6 -6
  35. package/native/dist/styled-components.native.esm.js.map +1 -1
  36. package/native/dist/test/types.d.ts +9 -0
  37. package/native/dist/test/utils.d.ts +176 -180
  38. package/native/dist/test/veryLargeUnionType.d.ts +1 -0
  39. package/native/dist/types.d.ts +85 -62
  40. package/native/dist/utils/determineTheme.d.ts +4 -2
  41. package/native/dist/utils/domElements.d.ts +1 -1
  42. package/native/dist/utils/empties.d.ts +2 -2
  43. package/native/dist/utils/flatten.d.ts +3 -3
  44. package/native/dist/utils/hoist.d.ts +3 -3
  45. package/native/dist/utils/interleave.d.ts +1 -1
  46. package/native/dist/utils/isFunction.d.ts +1 -1
  47. package/native/dist/utils/isPlainObject.d.ts +1 -1
  48. package/native/dist/utils/isStatelessFunction.d.ts +1 -1
  49. package/native/dist/utils/isStaticRules.d.ts +1 -1
  50. package/native/dist/utils/joinStrings.d.ts +2 -1
  51. package/native/dist/utils/mixinDeep.d.ts +1 -2
  52. package/native/dist/utils/stylis.d.ts +3 -3
  53. package/package.json +2 -4
  54. package/primitives/dist/styled-components-primitives.cjs.js +6 -6
  55. package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
  56. package/primitives/dist/styled-components-primitives.esm.js +6 -6
  57. package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
  58. package/native/dist/base.d.ts.map +0 -1
  59. package/native/dist/constants.d.ts.map +0 -1
  60. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  61. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  62. package/native/dist/constructors/css.d.ts.map +0 -1
  63. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  64. package/native/dist/constructors/styled.d.ts.map +0 -1
  65. package/native/dist/dist/base.d.ts +0 -18
  66. package/native/dist/dist/base.d.ts.map +0 -1
  67. package/native/dist/dist/constants.d.ts +0 -9
  68. package/native/dist/dist/constants.d.ts.map +0 -1
  69. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  70. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  71. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  72. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  73. package/native/dist/dist/constructors/css.d.ts +0 -5
  74. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  75. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  76. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  77. package/native/dist/dist/constructors/styled.d.ts +0 -186
  78. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  79. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  80. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  81. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  82. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  83. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  84. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  85. package/native/dist/dist/index-standalone.d.ts +0 -3
  86. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  87. package/native/dist/dist/index.d.ts +0 -4
  88. package/native/dist/dist/index.d.ts.map +0 -1
  89. package/native/dist/dist/macro/index.d.ts +0 -3
  90. package/native/dist/dist/macro/index.d.ts.map +0 -1
  91. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  92. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  93. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  94. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  95. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  96. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  97. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  98. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  99. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  100. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  101. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  102. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  103. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  104. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  105. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  106. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  107. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  108. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  109. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  110. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  111. package/native/dist/dist/native/index.d.ts +0 -65
  112. package/native/dist/dist/native/index.d.ts.map +0 -1
  113. package/native/dist/dist/primitives/index.d.ts +0 -23
  114. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  115. package/native/dist/dist/secretInternals.d.ts +0 -6
  116. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  117. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  118. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  119. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  120. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  121. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  122. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  123. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  124. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  125. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  126. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  127. package/native/dist/dist/sheet/dom.d.ts +0 -5
  128. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  129. package/native/dist/dist/sheet/index.d.ts +0 -2
  130. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  131. package/native/dist/dist/sheet/types.d.ts +0 -35
  132. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  133. package/native/dist/dist/test/globals.d.ts +0 -3
  134. package/native/dist/dist/test/globals.d.ts.map +0 -1
  135. package/native/dist/dist/test/utils.d.ts +0 -192
  136. package/native/dist/dist/test/utils.d.ts.map +0 -1
  137. package/native/dist/dist/types.d.ts +0 -121
  138. package/native/dist/dist/types.d.ts.map +0 -1
  139. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  140. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  141. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  142. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  143. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  144. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  145. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  146. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  147. package/native/dist/dist/utils/domElements.d.ts +0 -3
  148. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  149. package/native/dist/dist/utils/empties.d.ts +0 -4
  150. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  151. package/native/dist/dist/utils/error.d.ts +0 -6
  152. package/native/dist/dist/utils/error.d.ts.map +0 -1
  153. package/native/dist/dist/utils/errors.d.ts +0 -21
  154. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  155. package/native/dist/dist/utils/escape.d.ts +0 -6
  156. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  157. package/native/dist/dist/utils/flatten.d.ts +0 -5
  158. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  159. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  160. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  161. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  162. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  163. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  164. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  165. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  166. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  167. package/native/dist/dist/utils/hash.d.ts +0 -4
  168. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  169. package/native/dist/dist/utils/hoist.d.ts +0 -52
  170. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  171. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  172. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  173. package/native/dist/dist/utils/interleave.d.ts +0 -3
  174. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  175. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  176. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  177. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  178. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  179. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  180. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  181. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  182. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  183. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  184. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  185. package/native/dist/dist/utils/isTag.d.ts +0 -3
  186. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  187. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  188. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  189. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  190. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  191. package/native/dist/dist/utils/nonce.d.ts +0 -2
  192. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  193. package/native/dist/dist/utils/stylis.d.ts +0 -10
  194. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  195. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  196. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  197. package/native/dist/hooks/useTheme.d.ts +0 -3
  198. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  199. package/native/dist/index-standalone.d.ts.map +0 -1
  200. package/native/dist/index.d.ts.map +0 -1
  201. package/native/dist/macro/index.d.ts.map +0 -1
  202. package/native/dist/macro/test/babel.config.d.ts +0 -1
  203. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  204. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  205. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  206. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  207. package/native/dist/models/Keyframes.d.ts.map +0 -1
  208. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  209. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  210. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  211. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  212. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  213. package/native/dist/native/index.d.ts.map +0 -1
  214. package/native/dist/primitives/index.d.ts +0 -23
  215. package/native/dist/primitives/index.d.ts.map +0 -1
  216. package/native/dist/secretInternals.d.ts.map +0 -1
  217. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  218. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  219. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  220. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  221. package/native/dist/sheet/Tag.d.ts.map +0 -1
  222. package/native/dist/sheet/dom.d.ts.map +0 -1
  223. package/native/dist/sheet/index.d.ts.map +0 -1
  224. package/native/dist/sheet/types.d.ts.map +0 -1
  225. package/native/dist/test/globals.d.ts.map +0 -1
  226. package/native/dist/test/utils.d.ts.map +0 -1
  227. package/native/dist/types.d.ts.map +0 -1
  228. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  229. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  230. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  231. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  232. package/native/dist/utils/domElements.d.ts.map +0 -1
  233. package/native/dist/utils/empties.d.ts.map +0 -1
  234. package/native/dist/utils/error.d.ts.map +0 -1
  235. package/native/dist/utils/errors.d.ts.map +0 -1
  236. package/native/dist/utils/escape.d.ts.map +0 -1
  237. package/native/dist/utils/flatten.d.ts.map +0 -1
  238. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  239. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  240. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  241. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  242. package/native/dist/utils/hash.d.ts.map +0 -1
  243. package/native/dist/utils/hoist.d.ts.map +0 -1
  244. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  245. package/native/dist/utils/interleave.d.ts.map +0 -1
  246. package/native/dist/utils/isFunction.d.ts.map +0 -1
  247. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  248. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  249. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  250. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  251. package/native/dist/utils/isTag.d.ts.map +0 -1
  252. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  253. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  254. package/native/dist/utils/nonce.d.ts.map +0 -1
  255. package/native/dist/utils/stylis.d.ts.map +0 -1
  256. package/postinstall.js +0 -82
@@ -3,16 +3,10 @@ import createGlobalStyle from './constructors/createGlobalStyle';
3
3
  import css from './constructors/css';
4
4
  import keyframes from './constructors/keyframes';
5
5
  import withTheme from './hoc/withTheme';
6
- import useTheme from './hooks/useTheme';
7
6
  import ServerStyleSheet from './models/ServerStyleSheet';
8
- import StyleSheetManager, { StyleSheetConsumer, StyleSheetContext } from './models/StyleSheetManager';
9
- import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
7
+ import { IStyleSheetContext, IStyleSheetManager, IStylisContext, StyleSheetConsumer, StyleSheetContext, StyleSheetManager } from './models/StyleSheetManager';
8
+ import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from './models/ThemeProvider';
10
9
  import isStyledComponent from './utils/isStyledComponent';
11
- declare global {
12
- interface Window {
13
- '__styled-components-init__'?: number;
14
- }
15
- }
16
10
  export * from './secretInternals';
17
11
  export { Attrs, DefaultTheme, ShouldForwardProp } from './types';
18
- export { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
12
+ export { createGlobalStyle, css, isStyledComponent, IStyleSheetManager, IStyleSheetContext, IStylisContext, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
@@ -1,15 +1,40 @@
1
- /// <reference types="react" />
2
- import { Attrs, ExecutionContext, ExtensibleObject, Interpolation, IStyledComponent, IStyledComponentFactory, KnownTarget, Runtime, StyledOptions, StyledTarget, Styles } from '../types';
3
- export interface Styled<R extends Runtime, Target extends StyledTarget<R>, DerivedProps = Target extends KnownTarget ? React.ComponentProps<Target> : unknown, OuterProps extends {} = {}, OuterStatics = unknown> {
4
- <Props = unknown, Statics = unknown>(initialStyles: Styles<DerivedProps & OuterProps & Props>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & Props>[]): IStyledComponent<R, Target, DerivedProps & OuterProps & Props> & OuterStatics & Statics;
5
- attrs(attrs: Attrs<ExtensibleObject & DerivedProps & OuterProps>): Styled<R, Target, DerivedProps, OuterProps, OuterStatics>;
6
- withConfig(config: StyledOptions<R, DerivedProps & OuterProps>): Styled<R, Target, DerivedProps, OuterProps, OuterStatics>;
7
- }
8
- export default function constructWithOptions<R extends Runtime, Target extends StyledTarget<R>, DerivedProps = Target extends KnownTarget ? React.ComponentProps<Target> : unknown, OuterProps = unknown, // used for styled<{}>().attrs() so attrs() gets the generic prop context
9
- OuterStatics = unknown>(componentConstructor: IStyledComponentFactory<R, any, any, any>, tag: Target, options?: StyledOptions<R, DerivedProps & OuterProps>): {
10
- <Props extends {} = {}, Statics = unknown>(initialStyles: Styles<DerivedProps & OuterProps & Props>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & Props>[]): IStyledComponent<R, Target, DerivedProps & OuterProps & Props> & OuterStatics & Statics;
11
- attrs(attrs: Attrs<ExtensibleObject & DerivedProps & OuterProps>): any;
12
- /**
13
- * If config methods are called, wrap up a new template function and merge options */
14
- withConfig(config: StyledOptions<R, DerivedProps & OuterProps>): any;
1
+ import React from 'react';
2
+ import { Attrs, DataAttributes, ExecutionContext, ExecutionProps, Interpolation, IStyledComponent, IStyledComponentFactory, KnownTarget, NoInfer, Runtime, StyledOptions, StyledTarget, Styles, SubsetOnly } from '../types';
3
+ /**
4
+ * for types a and b, if b shares a field with a, mark a's field as optional
5
+ */
6
+ type OptionalIntersection<A, B> = {
7
+ [K in Extract<keyof A, keyof B>]?: A[K];
15
8
  };
9
+ type AttrsResult<T extends Attrs> = T extends (...args: any) => infer P ? P : T;
10
+ type ExtractAttrsTarget<R extends Runtime, P extends ExecutionProps, DefaultTarget extends StyledTarget<R>> = P['as'] extends KnownTarget ? P['as'] : DefaultTarget;
11
+ /**
12
+ * If attrs type is a function (no type provided, inferring from usage), extract the return value
13
+ * and merge it with the existing type to hole-punch any required fields that are satisfied as
14
+ * a result of running attrs. Otherwise if we have a definite type then union the base props
15
+ * with the passed attr type to capture any intended overrides.
16
+ */
17
+ type PropsSatisfiedByAttrs<T extends Attrs, Props extends object, Result extends ExecutionProps = AttrsResult<T>> = Omit<Props, keyof Result> & OptionalIntersection<Props, Result> & Partial<Omit<Result, keyof Props | 'as'>>;
18
+ /**
19
+ * Rejects an attr factory function argument (T) if it returns any properties not defined in Props.
20
+ */
21
+ type StrictAttrFactory<T, Props> = T extends ((props: ExecutionContext & Props) => infer TResult) ? TResult extends SubsetOnly<TResult, (Partial<Props> & ExecutionProps & DataAttributes & React.AriaAttributes)> ? (props: ExecutionContext & Props) => TResult : never : never;
22
+ export interface Styled<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object = object, OuterStatics extends object = object, RuntimeInjectedProps extends ExecutionProps = object> {
23
+ <Props extends object = object, Statics extends object = object>(initialStyles: Styles<OuterProps & RuntimeInjectedProps & NoInfer<Props>>, ...interpolations: Interpolation<OuterProps & RuntimeInjectedProps & NoInfer<Props>>[]): // @ts-expect-error KnownTarget is a subset of StyledTarget<R>
24
+ IStyledComponent<R, ExtractAttrsTarget<R, RuntimeInjectedProps, Target>, OuterProps & Props> & OuterStatics & Statics;
25
+ /**
26
+ * This is a chainable method that attaches some props to a styled component.
27
+ * @param props An object containing prop values that will be merged into the rest of the component's props
28
+ * @argument Props Additional props being injected in `props`
29
+ */
30
+ attrs<Props extends object = object, PropValues extends Partial<OuterProps> & ExecutionProps & DataAttributes & React.AriaAttributes & NoInfer<Props> = Partial<OuterProps> & ExecutionProps & DataAttributes & React.AriaAttributes & NoInfer<Props>>(props: PropValues & SubsetOnly<PropValues, Partial<OuterProps> & ExecutionProps & DataAttributes & React.AriaAttributes & NoInfer<Props>>): Styled<R, Target, PropsSatisfiedByAttrs<PropValues, OuterProps>, OuterStatics, Omit<RuntimeInjectedProps, keyof PropValues> & PropValues>;
31
+ /**
32
+ * This is a chainable method that attaches some props to a styled component.
33
+ * @param propFactory A function that receives the props that are passed into the component and computes a value, that is then going to be merged into the existing component props.
34
+ * @argument Props Additional props being returned by `propFactory`
35
+ */
36
+ attrs<Props extends object = object, Factory extends ((...args: any[]) => any) = (...args: any[]) => any, TTarget extends StyledTarget<R> = ExtractAttrsTarget<R, AttrsResult<Factory>, Target>>(propFactory: Factory & StrictAttrFactory<Factory, OuterProps & NoInfer<Props>>): Styled<R, TTarget, PropsSatisfiedByAttrs<Factory, OuterProps>, OuterStatics, Omit<RuntimeInjectedProps, keyof AttrsResult<Factory>> & AttrsResult<Factory>>;
37
+ withConfig: (config: StyledOptions<R, OuterProps>) => Styled<R, Target, OuterProps, OuterStatics>;
38
+ }
39
+ export default function constructWithOptions<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object = Target extends KnownTarget ? React.ComponentPropsWithRef<Target> : object, OuterStatics extends object = object>(componentConstructor: IStyledComponentFactory<R, Target, OuterProps, OuterStatics>, tag: Target, options?: StyledOptions<R, OuterProps>): Styled<R, Target, OuterProps, OuterStatics>;
40
+ export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ExtensibleObject, Interpolation, Styles } from '../types';
3
- export default function createGlobalStyle<Props = unknown>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): React.NamedExoticComponent<ExtensibleObject>;
2
+ import { ExecutionProps, Interpolation, Styles } from '../types';
3
+ export default function createGlobalStyle<Props extends object>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): React.NamedExoticComponent<ExecutionProps & Props>;
@@ -1,4 +1,4 @@
1
- import { Interpolation, StyledObject, StyleFunction, Styles } from '../types';
2
- export default function css<Props>(styles: Styles<Props>, ...interpolations: Interpolation<Props>[]): string | number | false | import("../types").Keyframes | import("../types").IStyledComponent<"web", any, any> | TemplateStringsArray | StyledObject<Props> | StyleFunction<Props> | (Interpolation<Props>[] & {
3
- isCss?: boolean | undefined;
4
- }) | null | undefined;
1
+ import { Interpolation, RuleSet, Styles } from '../types';
2
+ declare function css(styles: Styles<object>, ...interpolations: Interpolation<object>[]): RuleSet<object>;
3
+ declare function css<Props extends object>(styles: Styles<Props>, ...interpolations: Interpolation<Props>[]): RuleSet<Props>;
4
+ export default css;
@@ -1,3 +1,3 @@
1
1
  import Keyframes from '../models/Keyframes';
2
2
  import { Interpolation, Styles } from '../types';
3
- export default function keyframes<Props = unknown>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): Keyframes;
3
+ export default function keyframes<Props extends object = object>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): Keyframes;