import React from 'react'; /** * Use the StyleCollector to extract style during server-side rendering * to have style as soon as the app is rendered (no flickering) * * This StyleCollectors wrap styled-component API in order to hide this * implementation detail from users. * * @see https://styled-components.com/docs/advanced#server-side-rendering * * @example import * as StyleCollector from '@blablacar/ui-library/dist/serverStyleExtractor' import { renderToString } from 'react-dom/server' // ... const styleCollector = StyleCollector.init() try { const markup: string = renderToString( styleCollector.wrapComponent() ) const styleTag: string = styleCollector.extractStyleTag() // do something } catch (error) { // do something } finally { styleCollector.cleanup() } */ declare type StyleCollector = { wrapComponent: (component: React.ReactNode) => React.ReactElement; extractStyleTag: () => string; cleanup: () => void; }; export declare function init(): StyleCollector; export {};