styled-components 6.0.0-beta.1 → 6.0.0-beta.10

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 (282) hide show
  1. package/dist/base.d.ts +3 -3
  2. package/dist/constructors/constructWithOptions.d.ts +24 -31
  3. package/dist/constructors/createGlobalStyle.d.ts +2 -2
  4. package/dist/constructors/css.d.ts +4 -4
  5. package/dist/constructors/keyframes.d.ts +1 -1
  6. package/dist/constructors/styled.d.ts +177 -181
  7. package/dist/hoc/withTheme.d.ts +2 -2
  8. package/dist/index.d.ts +2 -2
  9. package/dist/models/GlobalStyle.d.ts +1 -1
  10. package/dist/models/InlineStyle.d.ts +1 -1
  11. package/dist/models/StyleSheetManager.d.ts +58 -14
  12. package/dist/models/StyledComponent.d.ts +1 -1
  13. package/dist/models/StyledNativeComponent.d.ts +2 -2
  14. package/dist/models/ThemeProvider.d.ts +1 -1
  15. package/dist/native/index.d.ts +28 -32
  16. package/dist/styled-components-macro.cjs.js +46 -1
  17. package/dist/styled-components-macro.cjs.js.map +1 -1
  18. package/dist/styled-components-macro.esm.js +37 -1
  19. package/dist/styled-components-macro.esm.js.map +1 -1
  20. package/dist/styled-components.browser.cjs.js +1858 -1
  21. package/dist/styled-components.browser.cjs.js.map +1 -1
  22. package/dist/styled-components.browser.esm.js +1832 -1
  23. package/dist/styled-components.browser.esm.js.map +1 -1
  24. package/dist/styled-components.cjs.js +1879 -1
  25. package/dist/styled-components.cjs.js.map +1 -1
  26. package/dist/styled-components.esm.js +1853 -1
  27. package/dist/styled-components.esm.js.map +1 -1
  28. package/dist/styled-components.js +1978 -1
  29. package/dist/styled-components.js.map +1 -1
  30. package/dist/styled-components.min.js +1 -1
  31. package/dist/styled-components.min.js.map +1 -1
  32. package/dist/test/types.d.ts +1 -0
  33. package/dist/test/utils.d.ts +176 -180
  34. package/dist/tsconfig.tsbuildinfo +1 -1
  35. package/dist/types.d.ts +81 -73
  36. package/dist/utils/determineTheme.d.ts +2 -2
  37. package/dist/utils/domElements.d.ts +1 -1
  38. package/dist/utils/empties.d.ts +2 -2
  39. package/dist/utils/flatten.d.ts +3 -3
  40. package/dist/utils/generateDisplayName.d.ts +1 -1
  41. package/dist/utils/getComponentName.d.ts +1 -1
  42. package/dist/utils/interleave.d.ts +1 -1
  43. package/dist/utils/isStaticRules.d.ts +1 -1
  44. package/dist/utils/isStyledComponent.d.ts +1 -1
  45. package/dist/utils/isTag.d.ts +1 -1
  46. package/dist/utils/joinStrings.d.ts +1 -1
  47. package/dist/utils/mixinDeep.d.ts +1 -2
  48. package/dist/utils/stylis.d.ts +3 -3
  49. package/native/dist/base.d.ts +3 -3
  50. package/native/dist/constructors/constructWithOptions.d.ts +24 -31
  51. package/native/dist/constructors/createGlobalStyle.d.ts +2 -2
  52. package/native/dist/constructors/css.d.ts +4 -4
  53. package/native/dist/constructors/keyframes.d.ts +1 -1
  54. package/native/dist/constructors/styled.d.ts +177 -181
  55. package/native/dist/hoc/withTheme.d.ts +2 -2
  56. package/native/dist/index.d.ts +2 -2
  57. package/native/dist/models/GlobalStyle.d.ts +1 -1
  58. package/native/dist/models/InlineStyle.d.ts +1 -1
  59. package/native/dist/models/StyleSheetManager.d.ts +58 -14
  60. package/native/dist/models/StyledComponent.d.ts +1 -1
  61. package/native/dist/models/StyledNativeComponent.d.ts +2 -2
  62. package/native/dist/models/ThemeProvider.d.ts +1 -1
  63. package/native/dist/native/index.d.ts +28 -32
  64. package/native/dist/styled-components.native.cjs.js +87 -81
  65. package/native/dist/styled-components.native.cjs.js.map +1 -1
  66. package/native/dist/styled-components.native.esm.js +74 -69
  67. package/native/dist/styled-components.native.esm.js.map +1 -1
  68. package/native/dist/test/types.d.ts +1 -0
  69. package/native/dist/test/utils.d.ts +176 -180
  70. package/native/dist/types.d.ts +81 -73
  71. package/native/dist/utils/determineTheme.d.ts +2 -2
  72. package/native/dist/utils/domElements.d.ts +1 -1
  73. package/native/dist/utils/empties.d.ts +2 -2
  74. package/native/dist/utils/flatten.d.ts +3 -3
  75. package/native/dist/utils/generateDisplayName.d.ts +1 -1
  76. package/native/dist/utils/getComponentName.d.ts +1 -1
  77. package/native/dist/utils/interleave.d.ts +1 -1
  78. package/native/dist/utils/isStaticRules.d.ts +1 -1
  79. package/native/dist/utils/isStyledComponent.d.ts +1 -1
  80. package/native/dist/utils/isTag.d.ts +1 -1
  81. package/native/dist/utils/joinStrings.d.ts +1 -1
  82. package/native/dist/utils/mixinDeep.d.ts +1 -2
  83. package/native/dist/utils/stylis.d.ts +3 -3
  84. package/package.json +40 -39
  85. package/test-utils/index.ts +10 -6
  86. package/native/dist/base.d.ts.map +0 -1
  87. package/native/dist/constants.d.ts.map +0 -1
  88. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  89. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  90. package/native/dist/constructors/css.d.ts.map +0 -1
  91. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  92. package/native/dist/constructors/styled.d.ts.map +0 -1
  93. package/native/dist/dist/base.d.ts +0 -18
  94. package/native/dist/dist/base.d.ts.map +0 -1
  95. package/native/dist/dist/constants.d.ts +0 -9
  96. package/native/dist/dist/constants.d.ts.map +0 -1
  97. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  98. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  99. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  100. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  101. package/native/dist/dist/constructors/css.d.ts +0 -5
  102. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  103. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  104. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  105. package/native/dist/dist/constructors/styled.d.ts +0 -186
  106. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  107. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  108. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  109. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  110. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  111. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  112. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  113. package/native/dist/dist/index-standalone.d.ts +0 -3
  114. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  115. package/native/dist/dist/index.d.ts +0 -4
  116. package/native/dist/dist/index.d.ts.map +0 -1
  117. package/native/dist/dist/macro/index.d.ts +0 -3
  118. package/native/dist/dist/macro/index.d.ts.map +0 -1
  119. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  120. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  121. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  122. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  123. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  124. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  125. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  126. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  127. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  128. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  129. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  130. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  131. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  132. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  133. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  134. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  135. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  136. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  137. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  138. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  139. package/native/dist/dist/native/index.d.ts +0 -65
  140. package/native/dist/dist/native/index.d.ts.map +0 -1
  141. package/native/dist/dist/primitives/index.d.ts +0 -23
  142. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  143. package/native/dist/dist/secretInternals.d.ts +0 -6
  144. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  145. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  146. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  147. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  148. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  149. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  150. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  151. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  152. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  153. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  154. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  155. package/native/dist/dist/sheet/dom.d.ts +0 -5
  156. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  157. package/native/dist/dist/sheet/index.d.ts +0 -2
  158. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  159. package/native/dist/dist/sheet/types.d.ts +0 -35
  160. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  161. package/native/dist/dist/test/globals.d.ts +0 -3
  162. package/native/dist/dist/test/globals.d.ts.map +0 -1
  163. package/native/dist/dist/test/utils.d.ts +0 -192
  164. package/native/dist/dist/test/utils.d.ts.map +0 -1
  165. package/native/dist/dist/types.d.ts +0 -121
  166. package/native/dist/dist/types.d.ts.map +0 -1
  167. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  168. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  169. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  170. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  171. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  172. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  173. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  174. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  175. package/native/dist/dist/utils/domElements.d.ts +0 -3
  176. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  177. package/native/dist/dist/utils/empties.d.ts +0 -4
  178. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  179. package/native/dist/dist/utils/error.d.ts +0 -6
  180. package/native/dist/dist/utils/error.d.ts.map +0 -1
  181. package/native/dist/dist/utils/errors.d.ts +0 -21
  182. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  183. package/native/dist/dist/utils/escape.d.ts +0 -6
  184. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  185. package/native/dist/dist/utils/flatten.d.ts +0 -5
  186. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  187. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  188. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  189. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  190. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  191. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  192. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  193. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  194. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  195. package/native/dist/dist/utils/hash.d.ts +0 -4
  196. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  197. package/native/dist/dist/utils/hoist.d.ts +0 -52
  198. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  199. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  200. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  201. package/native/dist/dist/utils/interleave.d.ts +0 -3
  202. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  203. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  204. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  205. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  206. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  207. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  208. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  209. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  210. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  211. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  212. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  213. package/native/dist/dist/utils/isTag.d.ts +0 -3
  214. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  215. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  216. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  217. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  218. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  219. package/native/dist/dist/utils/nonce.d.ts +0 -2
  220. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  221. package/native/dist/dist/utils/stylis.d.ts +0 -10
  222. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  223. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  224. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  225. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  226. package/native/dist/index-standalone.d.ts.map +0 -1
  227. package/native/dist/index.d.ts.map +0 -1
  228. package/native/dist/macro/index.d.ts.map +0 -1
  229. package/native/dist/macro/test/babel.config.d.ts +0 -1
  230. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  231. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  232. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  233. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  234. package/native/dist/models/Keyframes.d.ts.map +0 -1
  235. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  236. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  237. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  238. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  239. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  240. package/native/dist/native/index.d.ts.map +0 -1
  241. package/native/dist/primitives/index.d.ts +0 -23
  242. package/native/dist/primitives/index.d.ts.map +0 -1
  243. package/native/dist/secretInternals.d.ts.map +0 -1
  244. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  245. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  246. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  247. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  248. package/native/dist/sheet/Tag.d.ts.map +0 -1
  249. package/native/dist/sheet/dom.d.ts.map +0 -1
  250. package/native/dist/sheet/index.d.ts.map +0 -1
  251. package/native/dist/sheet/types.d.ts.map +0 -1
  252. package/native/dist/test/globals.d.ts.map +0 -1
  253. package/native/dist/test/utils.d.ts.map +0 -1
  254. package/native/dist/types.d.ts.map +0 -1
  255. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  256. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  257. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  258. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  259. package/native/dist/utils/domElements.d.ts.map +0 -1
  260. package/native/dist/utils/empties.d.ts.map +0 -1
  261. package/native/dist/utils/error.d.ts.map +0 -1
  262. package/native/dist/utils/errors.d.ts.map +0 -1
  263. package/native/dist/utils/escape.d.ts.map +0 -1
  264. package/native/dist/utils/flatten.d.ts.map +0 -1
  265. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  266. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  267. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  268. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  269. package/native/dist/utils/hash.d.ts.map +0 -1
  270. package/native/dist/utils/hoist.d.ts.map +0 -1
  271. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  272. package/native/dist/utils/interleave.d.ts.map +0 -1
  273. package/native/dist/utils/isFunction.d.ts.map +0 -1
  274. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  275. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  276. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  277. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  278. package/native/dist/utils/isTag.d.ts.map +0 -1
  279. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  280. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  281. package/native/dist/utils/nonce.d.ts.map +0 -1
  282. package/native/dist/utils/stylis.d.ts.map +0 -1
package/dist/base.d.ts CHANGED
@@ -5,7 +5,7 @@ import keyframes from './constructors/keyframes';
5
5
  import withTheme from './hoc/withTheme';
6
6
  import useTheme from './hooks/useTheme';
7
7
  import ServerStyleSheet from './models/ServerStyleSheet';
8
- import StyleSheetManager, { StyleSheetConsumer, StyleSheetContext } from './models/StyleSheetManager';
8
+ import { IStyleSheetContext, IStyleSheetManager, IStylisContext, StyleSheetConsumer, StyleSheetContext, StyleSheetManager } from './models/StyleSheetManager';
9
9
  import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
10
10
  import isStyledComponent from './utils/isStyledComponent';
11
11
  declare global {
@@ -14,5 +14,5 @@ declare global {
14
14
  }
15
15
  }
16
16
  export * from './secretInternals';
17
- 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, };
17
+ export { AttrsArg as Attrs, DefaultTheme, ShouldForwardProp } from './types';
18
+ export { createGlobalStyle, css, isStyledComponent, IStyleSheetManager, IStyleSheetContext, IStylisContext, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
@@ -1,32 +1,25 @@
1
- /// <reference types="react" />
2
- import { Attrs, ExecutionContext, Interpolation, IStyledComponent, IStyledComponentFactory, IStyledNativeComponent, IStyledNativeComponentFactory, KnownTarget, NativeTarget, StyledNativeOptions, StyledOptions, StyledTarget, Styles, WebTarget } from '../types';
3
- export interface NativeStyled<Target extends NativeTarget, DerivedProps = Target extends KnownTarget ? React.ComponentProps<Target> : unknown, OuterProps = unknown, OuterStatics = unknown> {
4
- <Props = unknown, Statics = unknown>(initialStyles: Styles<DerivedProps & OuterProps & Props>, ...interpolations: Exclude<Interpolation<ExecutionContext & DerivedProps & OuterProps & Props>, IStyledComponent<any>>[]): IStyledNativeComponent<Target, DerivedProps & OuterProps & Props> & OuterStatics & Statics;
5
- attrs(attrs: Attrs<ExecutionContext & DerivedProps & OuterProps>): NativeStyled<Target, DerivedProps, OuterProps, OuterStatics>;
6
- withConfig(config: StyledNativeOptions<DerivedProps & OuterProps>): NativeStyled<Target, DerivedProps, OuterProps, OuterStatics>;
7
- }
8
- export interface WebStyled<Target extends WebTarget, DerivedProps = Target extends KnownTarget ? React.ComponentProps<Target> : unknown, OuterProps = unknown, OuterStatics = unknown> {
9
- <Props = unknown, Statics = unknown>(initialStyles: Styles<DerivedProps & OuterProps & Props>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & Props>[]): IStyledComponent<Target, DerivedProps & OuterProps & Props> & OuterStatics & Statics;
10
- attrs(attrs: Attrs<ExecutionContext & DerivedProps & OuterProps>): WebStyled<Target, DerivedProps, OuterProps, OuterStatics>;
11
- withConfig(config: StyledOptions<DerivedProps & OuterProps>): WebStyled<Target, DerivedProps, OuterProps, OuterStatics>;
12
- }
13
- export default function constructWithOptions<Environment extends 'web' | 'native', Target extends StyledTarget, DerivedProps = Target extends KnownTarget ? React.ComponentProps<Target> : unknown, OuterProps = unknown, // used for styled<{}>().attrs() so attrs() gets the generic prop context
14
- OuterStatics = unknown>(componentConstructor: Environment extends 'web' ? IStyledComponentFactory<any, any, any> : IStyledNativeComponentFactory<any, any, any>, tag: Target, options?: Environment extends 'web' ? StyledOptions<DerivedProps & OuterProps> : StyledNativeOptions<DerivedProps & OuterProps>): {
15
- <Props = unknown, Statics = unknown>(initialStyles: Styles<DerivedProps & OuterProps & Props>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & Props>[]): ReturnType<Environment extends "web" ? IStyledComponentFactory<Target, DerivedProps & OuterProps & Props, OuterStatics & Statics> : IStyledNativeComponentFactory<Target, DerivedProps & OuterProps & Props, OuterStatics & Statics>>;
16
- attrs(attrs: Attrs<ExecutionContext & DerivedProps & OuterProps>): {
17
- <Props_1 = unknown, Statics_1 = unknown>(initialStyles: Styles<DerivedProps & OuterProps & OuterStatics & Props_1>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & OuterStatics & Props_1>[]): ReturnType<Environment extends "web" ? IStyledComponentFactory<Target, DerivedProps & OuterProps & OuterStatics & Props_1, Statics_1> : IStyledNativeComponentFactory<Target, DerivedProps & OuterProps & OuterStatics & Props_1, Statics_1>>;
18
- attrs(attrs: Attrs<ExecutionContext & DerivedProps & OuterProps & OuterStatics>): {
19
- <Props_2 = unknown, Statics_2 = unknown>(initialStyles: Styles<DerivedProps & OuterProps & OuterStatics & Props_2>, ...interpolations: Interpolation<ExecutionContext & DerivedProps & OuterProps & OuterStatics & Props_2>[]): ReturnType<Environment extends "web" ? IStyledComponentFactory<Target, DerivedProps & OuterProps & OuterStatics & Props_2, Statics_2> : IStyledNativeComponentFactory<Target, DerivedProps & OuterProps & OuterStatics & Props_2, Statics_2>>;
20
- attrs(attrs: Attrs<ExecutionContext & DerivedProps & OuterProps & OuterStatics>): any;
21
- /**
22
- * If config methods are called, wrap up a new template function and merge options */
23
- withConfig(config: Environment extends "web" ? StyledOptions<DerivedProps & OuterProps & OuterStatics> : StyledNativeOptions<DerivedProps & OuterProps & OuterStatics>): any;
24
- };
25
- /**
26
- * If config methods are called, wrap up a new template function and merge options */
27
- withConfig(config: Environment extends "web" ? StyledOptions<DerivedProps & OuterProps & OuterStatics> : StyledNativeOptions<DerivedProps & OuterProps & OuterStatics>): any;
28
- };
29
- /**
30
- * If config methods are called, wrap up a new template function and merge options */
31
- withConfig(config: Environment extends 'web' ? StyledOptions<DerivedProps & OuterProps> : StyledNativeOptions<DerivedProps & OuterProps>): any;
1
+ import React from 'react';
2
+ import { Attrs, AttrsArg, ExecutionProps, Interpolation, IStyledComponent, IStyledComponentFactory, KnownTarget, Runtime, StyledOptions, StyledTarget, Styles } from '../types';
3
+ /**
4
+ * for types a and b, if b shares a field with a, mark a's field as optional
5
+ */
6
+ declare type OptionalIntersection<A, B> = {
7
+ [K in Extract<keyof A, keyof B>]?: A[K];
32
8
  };
9
+ declare type AttrsResult<T extends Attrs> = T extends (...args: any) => infer P ? P : T;
10
+ declare 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
+ declare 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
+ export interface Styled<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object = object, OuterStatics extends object = object, RuntimeInjectedProps extends ExecutionProps = object> {
19
+ <Props extends object = object, Statics extends object = object>(initialStyles: Styles<OuterProps & RuntimeInjectedProps & Props>, ...interpolations: Interpolation<OuterProps & RuntimeInjectedProps & Props>[]): // @ts-expect-error KnownTarget is a subset of StyledTarget<R>
20
+ IStyledComponent<R, ExtractAttrsTarget<R, RuntimeInjectedProps, Target>, OuterProps & Props> & OuterStatics & Statics;
21
+ attrs: <T extends Attrs, TResult extends ExecutionProps = AttrsResult<T>, TTarget extends StyledTarget<R> = ExtractAttrsTarget<R, TResult, Target>>(attrs: AttrsArg<T extends (...args: any) => infer P ? OuterProps & P : OuterProps & T>) => Styled<R, TTarget, PropsSatisfiedByAttrs<T, OuterProps>, OuterStatics, Omit<RuntimeInjectedProps, keyof TResult> & TResult>;
22
+ withConfig: (config: StyledOptions<R, OuterProps>) => Styled<R, Target, OuterProps, OuterStatics>;
23
+ }
24
+ 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>;
25
+ 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 | import("../types").Keyframes | TemplateStringsArray | import("../types").IStyledComponent<any, any> | StyledObject<Props> | StyleFunction<Props> | (Interpolation<Props>[] & {
3
- isCss?: boolean | undefined;
4
- });
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;