// flow-typed signature: 8ae4cfa383fc58443d8d65b5301bf1c1 // flow-typed version: 1a7d5ca288/styled-components_v4.x.x/flow_>=v0.75.x // @flow declare module 'styled-components' { declare export type Interpolation = | ((executionContext: PropsWithTheme) => string) | CSSRules | KeyFrames | string | number; declare export type CSSRules = Interpolation[]; // This is not exported on purpose, since it's an implementation detail declare type TaggedTemplateLiteral = ( strings: string[], ...interpolations: Interpolation[] ) => R; declare export type CSSConstructor = TaggedTemplateLiteral; declare export type KeyFramesConstructor = TaggedTemplateLiteral; declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral>; declare interface Tag { styleTag: HTMLStyleElement | null; getIds(): string[]; hasNameForId(id: string, name: string): boolean; insertMarker(id: string): T; insertRules(id: string, cssRules: string[], name: ?string): void; removeRules(id: string): void; css(): string; toHTML(additionalAttrs: ?string): string; toElement(): React$Element<*>; clone(): Tag; sealed: boolean; } // The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over declare export class StyleSheet { static get master(): StyleSheet; static get instance(): StyleSheet; static reset(forceServer?: boolean): void; id: number; forceServer: boolean; target: ?HTMLElement; tagMap: { [string]: Tag }; // eslint-disable-line flowtype/no-weak-types deferred: { [string]: string[] | void }; rehydratedNames: { [string]: boolean }; ignoreRehydratedNames: { [string]: boolean }; tags: Tag[]; // eslint-disable-line flowtype/no-weak-types importRuleTag: Tag; // eslint-disable-line flowtype/no-weak-types capacity: number; clones: StyleSheet[]; constructor(?HTMLElement): this; rehydrate(): this; clone(): StyleSheet; sealAllTags(): void; makeTag(tag: ?Tag): Tag; // eslint-disable-line flowtype/no-weak-types getImportRuleTag(): Tag; // eslint-disable-line flowtype/no-weak-types getTagForId(id: string): Tag; // eslint-disable-line flowtype/no-weak-types hasId(id: string): boolean; hasNameForId(id: string, name: string): boolean; deferredInject(id: string, cssRules: string[]): void; inject(id: string, cssRules: string[], name?: string): void; remove(id: string): void; toHtml(): string; toReactElements(): React$ElementType[]; } declare export class KeyFrames { id: string; name: string; rules: string[]; constructor(name: string, rules: string[]): this; inject(StyleSheet): void; toString(): string; getName(): string; } // I think any is appropriate here? // eslint-disable-next-line flowtype/no-weak-types declare export type Theme = { +[string]: any }; declare export var css: CSSConstructor; declare export var keyframes: KeyFramesConstructor; declare export var createGlobalStyle: CreateGlobalStyleConstructor; declare export var ThemeProvider: React$ComponentType<{ children?: ?React$Node, theme: Theme | (Theme => Theme), }>; // This is a bit hard to read. Not sure how to make it more readable. I think adding line-breaks makes it worse. declare type InjectedProps = { theme: Theme | void }; declare export function withTheme>( WrappedComponent: Component, ): React$ComponentType<$Diff>, InjectedProps>>; // @HACK This is a cheat to hide that the underlying type is "just a string" // once we know of a better way, we should be able to update this accordingly. // I don't think there _is_ a good way, currently. // @NOTE Also not too sure about the naming of this... declare export type StyledElementType = T; declare export type StyledComponentType = { [[call]]: TaggedTemplateLiteral, +attrs: ( attributes: A | ((props: React$ElementConfig) => A), ) => TaggedTemplateLiteral, A>>>, }; declare type StyledComponentList = { a: StyledComponentType>, abbr: StyledComponentType>, address: StyledComponentType>, area: StyledComponentType>, article: StyledComponentType>, aside: StyledComponentType>, audio: StyledComponentType>, b: StyledComponentType>, base: StyledComponentType>, bdi: StyledComponentType>, bdo: StyledComponentType>, big: StyledComponentType>, blockquote: StyledComponentType>, body: StyledComponentType>, br: StyledComponentType>, button: StyledComponentType>, canvas: StyledComponentType>, caption: StyledComponentType>, cite: StyledComponentType>, code: StyledComponentType>, col: StyledComponentType>, colgroup: StyledComponentType>, data: StyledComponentType>, datalist: StyledComponentType>, dd: StyledComponentType>, del: StyledComponentType>, details: StyledComponentType>, dfn: StyledComponentType>, dialog: StyledComponentType>, div: StyledComponentType>, dl: StyledComponentType>, dt: StyledComponentType>, em: StyledComponentType>, embed: StyledComponentType>, fieldset: StyledComponentType>, figcaption: StyledComponentType>, figure: StyledComponentType>, footer: StyledComponentType>, form: StyledComponentType>, h1: StyledComponentType>, h2: StyledComponentType>, h3: StyledComponentType>, h4: StyledComponentType>, h5: StyledComponentType>, h6: StyledComponentType>, head: StyledComponentType>, header: StyledComponentType>, hgroup: StyledComponentType>, hr: StyledComponentType>, html: StyledComponentType>, i: StyledComponentType>, iframe: StyledComponentType>, img: StyledComponentType>, input: StyledComponentType>, ins: StyledComponentType>, kbd: StyledComponentType>, keygen: StyledComponentType>, label: StyledComponentType>, legend: StyledComponentType>, li: StyledComponentType>, link: StyledComponentType>, main: StyledComponentType>, map: StyledComponentType>, mark: StyledComponentType>, menu: StyledComponentType>, menuitem: StyledComponentType>, meta: StyledComponentType>, meter: StyledComponentType>, nav: StyledComponentType>, noscript: StyledComponentType>, object: StyledComponentType>, ol: StyledComponentType>, optgroup: StyledComponentType>, option: StyledComponentType>, output: StyledComponentType>, p: StyledComponentType>, param: StyledComponentType>, picture: StyledComponentType>, pre: StyledComponentType>, progress: StyledComponentType>, q: StyledComponentType>, rp: StyledComponentType>, rt: StyledComponentType>, ruby: StyledComponentType>, s: StyledComponentType>, samp: StyledComponentType>, script: StyledComponentType>, section: StyledComponentType>, select: StyledComponentType>, small: StyledComponentType>, source: StyledComponentType>, span: StyledComponentType>, strong: StyledComponentType>, style: StyledComponentType>, sub: StyledComponentType>, summary: StyledComponentType>, sup: StyledComponentType>, table: StyledComponentType>, tbody: StyledComponentType>, td: StyledComponentType>, textarea: StyledComponentType>, tfoot: StyledComponentType>, th: StyledComponentType>, thead: StyledComponentType>, time: StyledComponentType>, title: StyledComponentType>, tr: StyledComponentType>, track: StyledComponentType>, u: StyledComponentType>, ul: StyledComponentType>, var: StyledComponentType>, video: StyledComponentType>, wbr: StyledComponentType>, // SVG circle: StyledComponentType>, clipPath: StyledComponentType>, defs: StyledComponentType>, ellipse: StyledComponentType>, g: StyledComponentType>, image: StyledComponentType>, line: StyledComponentType>, linearGradient: StyledComponentType>, mask: StyledComponentType>, path: StyledComponentType>, pattern: StyledComponentType>, polygon: StyledComponentType>, polyline: StyledComponentType>, radialGradient: StyledComponentType>, rect: StyledComponentType>, stop: StyledComponentType>, svg: StyledComponentType>, text: StyledComponentType>, tspan: StyledComponentType>, }; declare export default StyledComponentList & { [[call]]: (S) => $ElementType, [[call]]: >(C) => StyledComponentType, }; } declare module 'styled-components/native' { declare export type Interpolation = | ((executionContext: P) => string) | CSSRules | KeyFrames | string | number; declare export type CSSRules = Interpolation[]; // This is not exported on purpose, since it's an implementation detail declare type TaggedTemplateLiteral = ( strings: string[], ...interpolations: Interpolation[] ) => R; declare export type CSSConstructor = TaggedTemplateLiteral; declare export type KeyFramesConstructor = TaggedTemplateLiteral; declare export type CreateGlobalStyleConstructor = TaggedTemplateLiteral>; declare interface Tag { styleTag: HTMLStyleElement | null; getIds(): string[]; hasNameForId(id: string, name: string): boolean; insertMarker(id: string): T; insertRules(id: string, cssRules: string[], name: ?string): void; removeRules(id: string): void; css(): string; toHTML(additionalAttrs: ?string): string; toElement(): React$Element<*>; clone(): Tag; sealed: boolean; } // The `any`/weak types in here all come from `styled-components` directly, since those definitions were just copied over declare export class StyleSheet { static get master(): StyleSheet; static get instance(): StyleSheet; static reset(forceServer?: boolean): void; id: number; forceServer: boolean; target: ?HTMLElement; tagMap: { [string]: Tag }; // eslint-disable-line flowtype/no-weak-types deferred: { [string]: string[] | void }; rehydratedNames: { [string]: boolean }; ignoreRehydratedNames: { [string]: boolean }; tags: Tag[]; // eslint-disable-line flowtype/no-weak-types importRuleTag: Tag; // eslint-disable-line flowtype/no-weak-types capacity: number; clones: StyleSheet[]; constructor(?HTMLElement): this; rehydrate(): this; clone(): StyleSheet; sealAllTags(): void; makeTag(tag: ?Tag): Tag; // eslint-disable-line flowtype/no-weak-types getImportRuleTag(): Tag; // eslint-disable-line flowtype/no-weak-types getTagForId(id: string): Tag; // eslint-disable-line flowtype/no-weak-types hasId(id: string): boolean; hasNameForId(id: string, name: string): boolean; deferredInject(id: string, cssRules: string[]): void; inject(id: string, cssRules: string[], name?: string): void; remove(id: string): void; toHtml(): string; toReactElements(): React$ElementType[]; } declare export class KeyFrames { id: string; name: string; rules: string[]; constructor(name: string, rules: string[]): this; inject(StyleSheet): void; toString(): string; getName(): string; } // I think any is appropriate here? // eslint-disable-next-line flowtype/no-weak-types declare export type Theme = { +[string]: any }; declare export var css: CSSConstructor; declare export var keyframes: KeyFramesConstructor; declare export var createGlobalStyle: CreateGlobalStyleConstructor; declare export var ThemeProvider: React$ComponentType<{ children?: ?React$Node, theme: Theme | (Theme => Theme), }>; // This is a bit hard to read. Not sure how to make it more readable. I think adding line-breaks makes it worse. declare type InjectedProps = { theme: Theme | void }; declare export function withTheme>( WrappedComponent: Component, ): React$ComponentType<$Diff>, InjectedProps>>; // @HACK This is a cheat to hide that the underlying type is "just a string" // once we know of a better way, we should be able to update this accordingly. // I don't think there _is_ a good way, currently. // @NOTE Also not too sure about the naming of this... declare export type StyledElementType = T; declare export type StyledComponentType = { [[call]]: TaggedTemplateLiteral, +attrs: ( attributes: A, ) => TaggedTemplateLiteral, A>>>, }; declare type StyledComponentList = { ActivityIndicator: StyledComponentType>, ActivityIndicatorIOS: StyledComponentType>, ART: StyledComponentType>, Button: StyledComponentType>, DatePickerIOS: StyledComponentType>, DrawerLayoutAndroid: StyledComponentType>, Image: StyledComponentType>, ImageBackground: StyledComponentType>, ImageEditor: StyledComponentType>, ImageStore: StyledComponentType>, KeyboardAvoidingView: StyledComponentType>, ListView: StyledComponentType>, MapView: StyledComponentType>, Modal: StyledComponentType>, NavigatorIOS: StyledComponentType>, Picker: StyledComponentType>, PickerIOS: StyledComponentType>, ProgressBarAndroid: StyledComponentType>, ProgressViewIOS: StyledComponentType>, ScrollView: StyledComponentType>, SegmentedControlIOS: StyledComponentType>, Slider: StyledComponentType>, SliderIOS: StyledComponentType>, SnapshotViewIOS: StyledComponentType>, Switch: StyledComponentType>, RecyclerViewBackedScrollView: StyledComponentType>, RefreshControl: StyledComponentType>, SafeAreaView: StyledComponentType>, StatusBar: StyledComponentType>, SwipeableListView: StyledComponentType>, SwitchAndroid: StyledComponentType>, SwitchIOS: StyledComponentType>, TabBarIOS: StyledComponentType>, Text: StyledComponentType>, TextInput: StyledComponentType>, ToastAndroid: StyledComponentType>, ToolbarAndroid: StyledComponentType>, Touchable: StyledComponentType>, TouchableHighlight: StyledComponentType>, TouchableNativeFeedback: StyledComponentType>, TouchableOpacity: StyledComponentType>, TouchableWithoutFeedback: StyledComponentType>, View: StyledComponentType>, ViewPagerAndroid: StyledComponentType>, WebView: StyledComponentType>, FlatList: StyledComponentType>, SectionList: StyledComponentType>, VirtualizedList: StyledComponentType>, }; declare export default StyledComponentList & { [[call]]: (S) => $ElementType, [[call]]: >(C) => StyledComponentType, }; }