script.d.ts 717 B

123456789101112131415161718
  1. import React from 'react';
  2. import { ScriptHTMLAttributes } from 'react';
  3. export interface ScriptProps extends ScriptHTMLAttributes<HTMLScriptElement> {
  4. strategy?: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive' | 'worker';
  5. id?: string;
  6. onLoad?: (e: any) => void;
  7. onReady?: () => void | null;
  8. onError?: (e: any) => void;
  9. children?: React.ReactNode;
  10. }
  11. /**
  12. * @deprecated Use `ScriptProps` instead.
  13. */
  14. export declare type Props = ScriptProps;
  15. export declare function handleClientScriptLoad(props: ScriptProps): void;
  16. export declare function initScriptLoader(scriptLoaderItems: ScriptProps[]): void;
  17. declare function Script(props: ScriptProps): JSX.Element | null;
  18. export default Script;