<commit_before>import * as React from "react";
import StyletronServer from "styletron-server";
import StyletronClient from "styletron-client";

declare namespace StyletronReact {
  export class StyletronProvider extends React.Component<{styletron: StyletronServer | StyletronClient}, void> {}

  type InnerRef<TInstance> = {
    innerRef?: (instance: TInstance) => any;
  };

  // This is not entierly true, but extending `CSSProperties` enables
  // autocompletion for CSS properties as plain objects and not only
  // for function return objects
  interface StyleFunction<TProps> extends React.CSSProperties {
    (props: TProps): React.CSSProperties;
  }

  type Style<TProps> = React.CSSProperties | StyleFunction<TProps>;

  class CStyledHTMLElement<TProps, TElement extends HTMLElement> extends React.Component<TProps & React.HTMLAttributes<TElement> & InnerRef<TElement>, void> {
    // We define the render method to force a difference between all styled
    // components, otherwise TypeScript thinks that any component passed as
    // base argument to `styled` is a `StyledHTMLElement` since it's the first
    // one matching
    render(): React.DOMElement<React.HTMLAttributes<TElement>, TElement>
  }
<commit_msg>Intersect `CSSProperties` instead of extending<commit_after>import * as React from "react";
import StyletronServer from "styletron-server";
import StyletronClient from "styletron-client";

declare namespace StyletronReact {
  export class StyletronProvider extends React.Component<{styletron: StyletronServer | StyletronClient}, void> {}

  type InnerRef<TInstance> = {
    innerRef?: (instance: TInstance) => any;
  };

  // Intersecting `CSSProperties` enables autocompletion for CSS properties as
  // plain objects and not only for function return objects
  type StyleFunction<TProps> = React.CSSProperties & ((props: TProps) => React.CSSProperties);

  type Style<TProps> = React.CSSProperties | StyleFunction<TProps>;

  class CStyledHTMLElement<TProps, TElement extends HTMLElement> extends React.Component<TProps & React.HTMLAttributes<TElement> & InnerRef<TElement>, void> {
    // We define the render method to force a difference between all styled
    // components, otherwise TypeScript thinks that any component passed as
    // base argument to `styled` is a `StyledHTMLElement` since it's the first
    // one matching
    render(): React.DOMElement<React.HTMLAttributes<TElement>, TElement>
  }

{'fraction_non_alphanumeric': 0.08938089380893809, 'fraction_numerical': 0.0, 'mean_word_length': 4.893719806763285, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2346380', 'n_tokens_mistral': 679, 'n_tokens_neox': 666, 'n_words': 219}