appWithI18n.d.ts 783 B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import { LoaderConfig } from '.';
  3. declare type Props = {
  4. [key: string]: any;
  5. };
  6. interface PartialNextContext {
  7. res?: any;
  8. AppTree?: NextComponentType<PartialNextContext>;
  9. Component?: NextComponentType<PartialNextContext>;
  10. ctx?: PartialNextContext;
  11. [key: string]: any;
  12. }
  13. declare type NextComponentType<C extends PartialNextContext = PartialNextContext, IP = {}, P = {}> = React.ComponentType<P> & {
  14. getInitialProps?(context: C): IP | Promise<IP>;
  15. };
  16. export default function appWithI18n(AppToTranslate: NextComponentType, config?: LoaderConfig): {
  17. (props: Props): JSX.Element;
  18. getInitialProps(appCtx: any): Promise<{
  19. __lang: string;
  20. __namespaces?: Record<string, object> | undefined;
  21. }>;
  22. };
  23. export {};